Remove final modifier to bypass A17 reflection restrictions#147
Conversation
|
@aviraxp can you check my changes? It works on Android 17 Beta 2+ (at least fixes the ART crash, I didn't tested all functionality yet). |
|
The function likely won't work (I think ART is starting to use aggressive optimizations so that static final field modification won't take any effect). I used another way to fix it in LSPosed IT, but this way seems reasonable too. I will merge it! |
|
To not forget it, I will write down here: This commit doesn't work (I have verified on AVD 37.1). This is because ART checks for ArtField but not field. ArtField is native pointer and won't change if accessFlags is changed with reflection. It can only be modified with ART hook. https://cs.android.com/android/_/android/platform/art/+/b1037e104255080ff7616858df4e640304be1514 |
I tested it on 17 Beta 2 and the system_server isn't crashed while booting. Removing the FINAL access flag allows us to set value.