Closed CaptainThrowback closed 1 month ago
Yeah as I see, after fix it, if can add a option like, if you want the patch for ApplicationPackageManager.smali press the Volume+ if not press Volume-
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?
I agree. Will make the patching portion to be optional in the upcoming release.
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
Thanks for the debug log. The log does shows some unexpected output from $apm_line, which I'm thinking is what causing the error. Please try this test version to see if it solves the issue that @VisionR1 and you are encountering when patching the hasSystemFeature method.
@changhuapeng
Unfortunately still say the same.
And mine, original (A11) ApplicationPackageManager.smali
@changhuapeng Unfortunately still say the same.
And mine, original (A11) ApplicationPackageManager.smali
Same result with the test build here for me.
Thanks for testing. Would it be possible for the both of you to send me your unedited framework.jar? You can get it by running adb pull /system/framework/framework.jar
Thanks for testing. Would it be possible for the both of you to send me your unedited framework.jar? You can get it by running
adb pull /system/framework/framework.jar
Thanks for testing. Would it be possible for the both of you to send me your unedited framework.jar? You can get it by running
adb pull /system/framework/framework.jar
Hopefully this will do the job: FrameworkPatcherGo-test2.zip
Hopefully this will do the job: FrameworkPatcherGo-test2.zip
Yeah, this working, even in emulator i tried it and it works. Thanks for all your hard work on this! And to see if all is added proper, I decompile the classes.dex and 2 all is the same. So now this is fix it, if you can add a option like, if you want the patch for ApplicationPackageManager.smali press the Volume+ if not press Volume-
Hopefully this will do the job: FrameworkPatcherGo-test2.zip
Yes! This one works.
Interestingly, on the version where I commented out the "optional" portion so that the patch would complete, I ended up with a "bad signature" error in Key Attestation Demo, resulting in the certificate appearing to be revoked. However, now that it patched completely, the app no longer shows that error.
Unfortunately, I'm still only passing Basic Integrity, so I still need to find a different keybox that actually works. I tried adding a different keybox with 3 certs, but it ends up in a bootloop. I'm going to try changing the props to see if maybe I need to use props from a device that supports HARDWARE-BACKED Attestation.
Thanks for all your hard work on this!
P.S. While the installation and patching went fine, I think the logging may be slightly incorrect, as seen below:
******************************
> Patching ApplicationPackageManager.smali file ...
******************************
--------------------
Patching hasSystemFeature method:
move-result v0
replaced by:
move-result v0
Edited: "/dev/tmp2065/framework/smali/android/app/ApplicationPackageManager.smali"
--------------------
invoke-static {v0, p1}, Lcom/android/internal/util/framework/Android;->hasSystemFeature(ZLjava/lang/String;)Z
move-result v0
added.
Edited: "/dev/tmp2065/framework/smali/android/app/ApplicationPackageManager.smali"
--------------------
return v0
replaced by:
return v0
Edited: "/dev/tmp2065/framework/smali/android/app/ApplicationPackageManager.smali"
--------------------
The "replaced by" section appears to be the same as what precedes it, so not sure what it's supposed to be showing there. But again, that's just a visual error and the actual patching appears to be working correctly.
Edited: "/dev/tmp2065/framework/smali/android/app/ApplicationPackageManager.smali"
The "replaced by" section appears to be the same as what precedes it, so not sure what it's supposed to be showing there. But again, that's just a visual error and the actual patching appears to be working correctly.
Yeah and mine the same, but like you say is just a visual error, the main purpose works.
Thanks to you both for testing and verifying that this new fix is working correctly! Upcoming release will contain this fix as well as providing user a choice to patch ApplicationPackageManager or not.
The "replaced by" section appears to be the same as what precedes it, so not sure what it's supposed to be showing there. But again, that's just a visual error and the actual patching appears to be working correctly.
That's not a visual bug since the script actually did replaced the original string with a new similar string. The reason is that from the few framework.jar that I referenced from during development, none of the original string was the correct string right from the start. Hence, the script wasn't expecting such and simply overwriting what was originally correct with what it should be corrected with. I supposed I can write a simple check to fix this confusion. Thanks for highlighting this!
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:
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 inMETA-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:
And this is the corresponding log output:
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.