First of all, great work on this! I just tried to install it, and everything is fine up to the above item. I believe that portion of the process is optional, so perhaps if that method can't be found, the install should continue rather than exit?
Install log below:
_ __ _ ____ _ _
| |/ /___ _ __ _ __ ___| / ___|| | | |
| ' // _ \ '__| '_ \ / _ \ \___ \| | | |
| . \ __/ | | | | | __/ |___) | |_| |
|_|\_\___|_| |_| |_|\___|_|____/ \___/
- Preparing image
- Module size: 8.22 MB
- Mounting image
- Current boot slot: _a
- Device is system-as-root
Archive: /data/user/0/me.weishu.kernelsu/cache/module.zip
inflating: module.prop
**********************
Framework Patcher GO
by changhuapeng
**********************
*********************
Powered by KernelSU
*********************
Archive: /data/user/0/me.weishu.kernelsu/cache/module.zip
inflating: customize.sh
- Extracting module files
Archive: /data/user/0/me.weishu.kernelsu/cache/module.zip
inflating: customize.sh
inflating: module.prop
Getting: busybox
Getting: bash
Getting: bin
Getting: core
------------Device INFO------------
API=34
ABI=arm
ABILONG=arm64-v8a
arch=arm64
arch32=arm
max_arch=arm64
is64bit=true
status=Enforcing
encrypted=true
slot=_a
dynamic_partitions=true
virtual_partitions=true
free_root=0
free_system=1071231320064
free_vendor=0
------------Setup INFO------------
CUSTOM_SETUP=2
TMP=/dev/tmp19970
MODPATH=/data/adb/modules_update/FrameworkPatcherGo
SKIPUNZIP=0
KSU=true
KSU_VER=0.9.4-33-gf381e324
KSU_VER_CODE=11871
KSU_KERNEL_VER_CODE=11871
ARCH=arm64
di_version=4.8-b
main_version=4.8
----------------------------------
Currently using: "/dev/tmp19970/ugu/unzip" binary
No possible changes found for: "unzip" binary
---------Installer Configs----------
devices=off
apex_mount=off
magisk_support=on
ensure_root=on
import_addons=off
extraction_speed=default
permissions=0:0:0755:0644
-----------------------------------
ZIP: Cant find folder [META-INF/addons]
----------------Running SCRIPTs------------
- Setting common permissions/contexts
- Installing from KernelSU app
Installation may seem stuck at times, please wait patiently ...
******************************
> Decompiling framework.jar ...
******************************
I: Using Apktool 2.7.0 on framework.jar
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Baksmaling classes5.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
******************************
> Patching AndroidKeyStoreSpi.smali file...
******************************
--------------------
Patching engineGetCertificateChain method:
invoke-static {v3}, Lcom/android/internal/util/framework/Android;->engineGetCertificateChain([Ljava/security/cert/Certificate;)[Ljava/security/cert/Certificate;
move-result-object v3
added.
Edited: "/dev/tmp19970/framework/smali_classes3/android/security/keystore2/AndroidKeyStoreSpi.smali"
--------------------
******************************
> Patching Instrumentation.smali file ...
******************************
--------------------
Patching newApplication static method:
invoke-static {p1}, Lcom/android/internal/util/framework/Android;->newApplication(Landroid/content/Context;)V
added.
Edited: "/dev/tmp19970/framework/smali/android/app/Instrumentation.smali"
--------------------
--------------------
Patching newApplication method:
invoke-static {p3}, Lcom/android/internal/util/framework/Android;->newApplication(Landroid/content/Context;)V
added.
Edited: "/dev/tmp19970/framework/smali/android/app/Instrumentation.smali"
--------------------
******************************
> Patching ApplicationPackageManager.smali file ...
******************************
sed: unmatched '/'
Name register not found in hasSystemFeature method
Mounting:auto:ro:1: /dev/block/dm-3 /system_ext
Mounting:auto:ro:1: /dev/block/dm-4 /vendor
Mounting:auto:ro:1: /dev/block/dm-1 /product
Mounting:auto:ro:1: /dev/block/dm-0 /odm
- Error: Failed to install module script
Error: Failed to install module script
EDIT: It could also just be an error with the sed command, upon reviewing the above output...
EDIT 2: Seems like the sed command reporting the error is from line 158 in META-INF/com/google/android/magisk/customize.sh
, which uses the "name_regex" variable from line 157. That's the one that seems to be causing the error.
EDIT 3: Okay, I did some actual Debugging by adding a few echo commands to the code to see where that sed error is coming from. This is what I added:
ui_print " "
ui_print "******************************"
ui_print "> Patching ApplicationPackageManager.smali file ..."
ui_print "******************************"
apm_line=$(grep -w "$app_package_manager_file" -e "$apm_method")
echo -e "DEBUG: apm_line: $apm_line"
apm_method_code=$(string -f "$app_package_manager_file" extract "$apm_line" ".end method")
echo -e "DEBUG: apm_method_code: $apm_method_code"
And this is the corresponding log output:
******************************
> Patching ApplicationPackageManager.smali file ...
******************************
DEBUG: apm_line: invoke-virtual {p0, v0}, Landroid/app/ApplicationPackageManager;->hasSystemFeature(Ljava/lang/String;)Z
.method public whitelist hasSystemFeature(Ljava/lang/String;)Z
sed: unmatched '/'
DEBUG: apm_method_code:
Name register not found in hasSystemFeature method
So I guess the issue is the apm_method_code variable? Something in that command is causing a sed error, and making that variable end up blank.