-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: add file system cache control, caching common framework and library files new: customizable ZRAM compression algorithm improve: move panel file to /sdcard/Android improve: disable oneplus kswapd modification improve: take memcg back improve: update powercfg lib to 20200104 improve: unify code style fix: lmk doesn't work well on Android <=8 fix: ZRAM doen't initialize correctly on Xiaomi K20pro fix: use binary tools of magisk, not system Signed-off-by: Matt Yang <yccy@outlook.com>
- Loading branch information
Showing
8 changed files
with
437 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
#!/system/bin/sh | ||
# File System Cache Control Library | ||
# https://github.com/yc9559/ | ||
# Author: Matt Yang | ||
# Version: 20200104 | ||
|
||
# include PATH | ||
BASEDIR="$(dirname "$0")" | ||
. $BASEDIR/pathinfo.sh | ||
|
||
############################### | ||
# PATHs | ||
############################### | ||
|
||
FSCC_REL="$BIN_DIR" | ||
FSCC_NAME="fscache-ctrl" | ||
|
||
############################### | ||
# Abbreviations | ||
############################### | ||
|
||
SYS_FRAME="/system/framework" | ||
SYS_LIB="/system/lib64" | ||
DALVIK="/data/dalvik-cache/arm64" | ||
APEX1="/apex/com.android.art/javalib" | ||
APEX2="/apex/com.android.runtime/javalib" | ||
|
||
############################### | ||
# FSCC tool functions | ||
############################### | ||
|
||
fscc_file_list="" | ||
|
||
# $1:apk_path $return:oat_path | ||
fscc_path_apk_to_oat() | ||
{ | ||
# OPSystemUI/OPSystemUI.apk -> OPSystemUI/oat | ||
echo "${1%/*}/oat" | ||
} | ||
|
||
# $1:file/dir | ||
fscc_list_append() | ||
{ | ||
fscc_file_list="$fscc_file_list $1" | ||
} | ||
|
||
# $1:file/dir | ||
fscc_add_obj() | ||
{ | ||
# whether file or dir exists | ||
if [ -e "$1" ]; then | ||
fscc_list_append "$1" | ||
fi | ||
} | ||
|
||
# $1:package_name | ||
fscc_add_apk_usr() | ||
{ | ||
local package_apk_path | ||
# pm path -> "package:/system/product/priv-app/OPSystemUI/OPSystemUI.apk" | ||
package_apk_path="$(pm path "$1" | cut -d: -f2)" | ||
fscc_add_obj "$(fscc_path_apk_to_oat "$package_apk_path")" | ||
} | ||
|
||
# $1:package_name | ||
fscc_add_apk_sys() | ||
{ | ||
local package_apk_path | ||
local apk_name | ||
# pm path -> "package:/system/product/priv-app/OPSystemUI/OPSystemUI.apk" | ||
package_apk_path="$(pm path "$1" | cut -d: -f2)" | ||
# remove apk name suffix | ||
apk_name="${package_apk_path%/*}" | ||
# remove path prefix | ||
apk_name="${apk_name##*/}" | ||
# get dex & vdex | ||
for dex in $(ls "$DALVIK" | grep "$apk_name"); do | ||
fscc_add_obj "$DALVIK/$dex" | ||
done | ||
} | ||
|
||
fscc_add_apk_home() | ||
{ | ||
local intent_act="android.intent.action.MAIN" | ||
local intent_cat="android.intent.category.HOME" | ||
local ret | ||
# " sourceDir=/data/app/net.oneplus.launcher-8ZzsYNYdJ8-6TM74OstKvg==/base.apk" | ||
ret="$(pm resolve-activity -a "$intent_act" -c "$intent_cat" | grep sourceDir | head -n 1)" | ||
# remove sourceDir prefix | ||
fscc_add_obj "$(fscc_path_apk_to_oat "${ret#*=}")" | ||
} | ||
|
||
# $1:package_name | ||
fscc_add_apex_lib() | ||
{ | ||
fscc_add_obj "$(find /apex -name "$1" | head -n 1)" | ||
} | ||
|
||
# after appending fscc_file_list | ||
fscc_start_svc() | ||
{ | ||
# multiple parameters, cannot be warped by "" | ||
"$MODULE_PATH/$FSCC_REL/$FSCC_NAME" -fdlb0 $fscc_file_list | ||
} | ||
|
||
fscc_stop_svc() | ||
{ | ||
killall "$FSCC_NAME" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/system/bin/sh | ||
# Module Path Header | ||
# https://github.com/yc9559/ | ||
# Author: Matt Yang | ||
# Version: 20200104 | ||
|
||
MODULE_NAME="qti-mem-opt" | ||
MODULE_PATH="/data/adb/modules/$MODULE_NAME" | ||
SCRIPT_DIR="./script" | ||
BIN_DIR="./bin" | ||
PANEL_FILE="/sdcard/Android/panel_qti_mem.txt" | ||
|
||
# fix compatibility issues, do not use magisk busybox | ||
PATH="/sbin:/system/sbin:/product/bin:/apex/com.android.runtime/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin" |
Oops, something went wrong.