Skip to content

Commit

Permalink
v4 (20200306)
Browse files Browse the repository at this point in the history
新增:支持骁龙865和骁龙765/765g
新增:补充骁龙855+和骁龙712的CPUID
新增:高通perf-hal运行状态显示
新增:迁移到Magisk 20.3模板,向下兼容到19.0
新增:兼容上游Linux 4.19触摸升频位点新路径
修复:指纹识别和相机服务性能受到限制
修复:减少均衡模式吃鸡卡顿,恢复性能最高的集群的负载预测
修复:减少MIUI的app启动动画卡顿,1阶段boost=30时长800ms,2阶段boost=10时长2000ms
改进:三集群设备补充设置超大核的访存延迟控制
改进:去除关于sched_boost_enabled的更改,已被上游弃用

Signed-off-by: Matt Yang <yccy@outlook.com>
  • Loading branch information
yc9559 committed Mar 6, 2020
1 parent b082527 commit b7e3654
Show file tree
Hide file tree
Showing 71 changed files with 2,906 additions and 440 deletions.
180 changes: 101 additions & 79 deletions META-INF/com/google/android/update-binary
Original file line number Diff line number Diff line change
@@ -1,46 +1,59 @@
#!/sbin/sh

TMPDIR=/dev/tmp
MOUNTPATH=/dev/magisk_img
#################
# Initialization
#################

# Default permissions
umask 022

# Initial cleanup
# Global vars
TMPDIR=/dev/tmp
PERSISTDIR=/sbin/.magisk/mirror/persist

rm -rf $TMPDIR 2>/dev/null
mkdir -p $TMPDIR

# echo before loading util_functions
ui_print() { echo "$1"; }

require_new_magisk() {
ui_print "***********************************"
ui_print " Please install the latest Magisk! "
ui_print "***********************************"
ui_print "*******************************"
ui_print " Please install Magisk v19.0+! "
ui_print "*******************************"
exit 1
}

imageless_magisk() {
[ $MAGISK_VER_CODE -gt 18100 ]
is_legacy_script() {
unzip -l "$ZIPFILE" install.sh | grep -q install.sh
return $?
}

##########################################################################################
print_modname() {
local len
len=`echo -n $MODNAME | wc -c`
len=$((len + 2))
local pounds=`printf "%${len}s" | tr ' ' '*'`
ui_print "$pounds"
ui_print " $MODNAME "
ui_print "$pounds"
ui_print "*******************"
ui_print " Powered by Magisk "
ui_print "*******************"
}

##############
# Environment
##########################################################################################
##############

OUTFD=$2
ZIPFILE=$3

mount /data 2>/dev/null

# Load utility functions
if [ -f /data/adb/magisk/util_functions.sh ]; then
. /data/adb/magisk/util_functions.sh
NVBASE=/data/adb
else
require_new_magisk
fi
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk
. /data/adb/magisk/util_functions.sh
[ $MAGISK_VER_CODE -gt 18100 ] || require_new_magisk

# Preperation for flashable zips
setup_flashable
Expand All @@ -54,98 +67,107 @@ api_level_arch_detect
# Setup busybox and binaries
$BOOTMODE && boot_actions || recovery_actions

##########################################################################################
##############
# Preparation
##########################################################################################

# Extract common files
unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2

[ ! -f $TMPDIR/install.sh ] && abort "! Unable to extract zip file!"
# Load install script
. $TMPDIR/install.sh
##############

if imageless_magisk; then
$BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules
MODULEROOT=$NVBASE/$MODDIRNAME
else
$BOOTMODE && IMGNAME=magisk_merge.img || IMGNAME=magisk.img
IMG=$NVBASE/$IMGNAME
request_zip_size_check "$ZIPFILE"
mount_magisk_img
MODULEROOT=$MOUNTPATH
fi
# Extract prop file
unzip -o "$ZIPFILE" module.prop -d $TMPDIR >&2
[ ! -f $TMPDIR/module.prop ] && abort "! Unable to extract zip file!"

$BOOTMODE && MODDIRNAME=modules_update || MODDIRNAME=modules
MODULEROOT=$NVBASE/$MODDIRNAME
MODID=`grep_prop id $TMPDIR/module.prop`
MODPATH=$MODULEROOT/$MODID

print_modname

ui_print "******************************"
ui_print "Powered by Magisk (@topjohnwu)"
ui_print "******************************"

##########################################################################################
# Install
##########################################################################################
MODNAME=`grep_prop name $TMPDIR/module.prop`

# Create mod paths
rm -rf $MODPATH 2>/dev/null
mkdir -p $MODPATH

on_install
##########
# Install
##########

if is_legacy_script; then
unzip -oj "$ZIPFILE" module.prop install.sh uninstall.sh 'common/*' -d $TMPDIR >&2

# Load install script
. $TMPDIR/install.sh

# Remove placeholder
rm -f $MODPATH/system/placeholder 2>/dev/null
# Callbacks
print_modname
on_install

# Custom uninstaller
[ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh
# Custom uninstaller
[ -f $TMPDIR/uninstall.sh ] && cp -af $TMPDIR/uninstall.sh $MODPATH/uninstall.sh

# Auto Mount
if imageless_magisk; then
# Skip mount
$SKIPMOUNT && touch $MODPATH/skip_mount

# prop file
$PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop

# Module info
cp -af $TMPDIR/module.prop $MODPATH/module.prop

# post-fs-data scripts
$POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh

# service scripts
$LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh

ui_print "- Setting permissions"
set_permissions
else
$SKIPMOUNT || touch $MODPATH/auto_mount
fi
print_modname

# prop files
$PROPFILE && cp -af $TMPDIR/system.prop $MODPATH/system.prop
unzip -o "$ZIPFILE" customize.sh -d $MODPATH >&2

# Module info
cp -af $TMPDIR/module.prop $MODPATH/module.prop
if $BOOTMODE; then
# Update info for Magisk Manager
if imageless_magisk; then
mktouch $NVBASE/modules/$MODID/update
cp -af $TMPDIR/module.prop $NVBASE/modules/$MODID/module.prop
else
mktouch /sbin/.magisk/img/$MODID/update
cp -af $TMPDIR/module.prop /sbin/.magisk/img/$MODID/module.prop
fi
fi
if ! grep -q '^SKIPUNZIP=1$' $MODPATH/customize.sh 2>/dev/null; then
ui_print "- Extracting module files"
unzip -o "$ZIPFILE" -x 'META-INF/*' -d $MODPATH >&2

# post-fs-data mode scripts
$POSTFSDATA && cp -af $TMPDIR/post-fs-data.sh $MODPATH/post-fs-data.sh
# Default permissions
set_perm_recursive $MODPATH 0 0 0755 0644
fi

# service mode scripts
$LATESTARTSERVICE && cp -af $TMPDIR/service.sh $MODPATH/service.sh
# Load customization script
[ -f $MODPATH/customize.sh ] && . $MODPATH/customize.sh
fi

# Handle replace folders
for TARGET in $REPLACE; do
ui_print "- Replace target: $TARGET"
mktouch $MODPATH$TARGET/.replace
done

ui_print "- Setting permissions"
set_permissions
if $BOOTMODE; then
# Update info for Magisk Manager
mktouch $NVBASE/modules/$MODID/update
cp -af $MODPATH/module.prop $NVBASE/modules/$MODID/module.prop
fi

# Copy over custom sepolicy rules
if [ -f $MODPATH/sepolicy.rule -a -e $PERSISTDIR ]; then
ui_print "- Installing custom sepolicy patch"
PERSISTMOD=$PERSISTDIR/magisk/$MODID
mkdir -p $PERSISTMOD
cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule
fi

# Remove stuffs that don't belong to modules
rm -rf \
$MODPATH/system/placeholder $MODPATH/customize.sh \
$MODPATH/README.md $MODPATH/.git* 2>/dev/null

##########################################################################################
##############
# Finalizing
##########################################################################################
##############

cd /
imageless_magisk || unmount_magisk_img
$BOOTMODE || recovery_cleanup
rm -rf $TMPDIR $MOUNTPATH
rm -rf $TMPDIR

ui_print "- Done"
exit 0
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Details see [the lead project](https://github.com/yc9559/sdm855-tune/commits/mas
- fast: providing stable performance capacity considering the TDP limitation of device chassis

```plain
sdm865
- powersave: 1.8+1.6+2.4g, boost 1.8+2.0+2.6g, min 0.3+0.7+1.1
- balance: 1.8+2.0+2.6g, boost 1.8+2.4+2.7g, min 0.7+0.7+1.1
- performance: 1.8+2.4+2.8g, boost 1.8+2.4+2.8g, min 0.7+0.7+1.1
- fast: 1.8+2.0+2.7g, boost 1.8+2.4+2.8g, min 0.7+1.2+1.2
sdm855/sdm855+
- powersave: 1.7+1.6+2.4g, boost 1.7+2.0+2.6g, min 0.3+0.7+0.8
- balance: 1.7+2.0+2.6g, boost 1.7+2.4+2.7g, min 0.5+0.7+0.8
Expand All @@ -26,7 +32,13 @@ sdm845
- performance: 1.7+2.8g, boost 1.7+2.8g, min 0.5+0.8
- fast: 1.7+2.4g, boost 1.7+2.8g, min 0.5+1.6
sdm730
sdm765/sdm765g
- powersave: 1.8+1.7+2.0g, boost 1.8+2.0+2.2g, min 0.3+0.6+0.8
- balance: 1.8+2.0+2.2g, boost 1.8+2.2+2.3/2.4g, min 0.5+0.6+0.6
- performance: 1.8+2.2+2.3g, boost 1.8+2.2+2.3/2.4g, min 0.5+0.6+0.8
- fast: 1.8+2.0+2.2g, boost 1.8+2.2+2.3/2.4g, min 0.5+1.1+1.4
sdm730/sdm730g
- powersave: 1.7+1.5g, boost 1.7+1.9g, min 0.3+0.3
- balance: 1.7+1.9g, boost 1.7+2.1g, min 0.5+0.6
- performance: 1.8+2.2g, boost 1.8+2.2g, min 0.5+0.6
Expand All @@ -38,19 +50,18 @@ sdm675
- performance: 1.8+2.0g, boost 1.8+2.0g, min 0.5+0.6
- fast: 1.8+1.7g, boost 1.8+2.0g, min 0.5+1.2
sdm710
sdm710/sdm712
- powersave: 1.7+1.8g, boost 1.7+2.0g, min 0.3+0.3
- balance: 1.7+2.0g, boost 1.7+2.2g, min 0.5+0.6
- performance: 1.7+2.2g, boost 1.7+2.2g, min 0.5+0.6
- fast: 1.7+2.0g, boost 1.7+2.2g, min 0.5+1.5
- balance: 1.7+2.0g, boost 1.7+2.2/2.3g, min 0.5+0.6
- performance: 1.7+2.2g, boost 1.7+2.2/2.3g, min 0.5+0.6
- fast: 1.7+2.0g, boost 1.7+2.2/2.3g, min 0.5+1.5
```

## Requirements

1. sdm855 or sdm845 or sdm730 or sdm675 or sdm710
2. Android >= 8.0
3. Rooted
4. Magisk >= 17.0
1. Android >= 8.0
2. Rooted
3. Magisk >= 19.0

## Installation

Expand Down
Loading

0 comments on commit b7e3654

Please sign in to comment.