Closed pedro-araujo closed 8 years ago
Thanks for the bug report. I quickly flashed cm13 onto a spare phone and I see the issue. The generatePackageInfo function's signature has changed from using android/util/ArraySet to java/util/Set - a minor difference but it means the patching script is unable to add in the function call to my fillinsig() function.
Have committed a fix - please let me know if it works for you! Just run the patch.py script again, should patch it properly and then reboot your device to use the new framework.jar :)
Thank you for the quick fix @moosd , it improved the situation, I don't get any more invalid signature errors.
But I'm getting these errors when opening the Uber app (which uses Google services):
12-31 13:38:51.268 2432 4325 W ActivityManager: Unable to start service Intent { act=com.google.android.gms.ads.identifier.service.START pkg=com.google.android.gms } U=0: not found 12-31 13:38:51.269 6009 6009 E AndroidRuntime: FATAL EXCEPTION: main 12-31 13:38:51.269 6009 6009 E AndroidRuntime: Process: com.ubercab, PID: 6009 12-31 13:38:51.269 6009 6009 E AndroidRuntime: java.lang.AbstractMethodError: abstract method "java.lang.String android.content.Context.getOpPackageName()" 12-31 13:38:51.269 6009 6009 E AndroidRuntime: at android.view.inputmethod.InputMethodManager.startInputInner(InputMethodManager.java:1175) 12-31 13:38:51.269 6009 6009 E AndroidRuntime: at android.view.inputmethod.InputMethodManager.onPostWindowFocus(InputMethodManager.java:1445) 12-31 13:38:51.269 6009 6009 E AndroidRuntime: at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3386) 12-31 13:38:51.269 6009 6009 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 12-31 13:38:51.269 6009 6009 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148) 12-31 13:38:51.269 6009 6009 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5466) 12-31 13:38:51.269 6009 6009 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 12-31 13:38:51.269 6009 6009 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 12-31 13:38:51.269 6009 6009 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 12-31 13:38:51.271 2432 2443 W ActivityManager: Force finishing activity com.ubercab/.client.feature.trip.TripActivity
It seems to be the same error as this one: https://github.com/microg/android_packages_apps_GmsCore/issues/22
Could it be possible that the patched code you are basing on on doesn't apply to CM13?
It's not quite the same error as that - the error in the issue you linked to relates to an invalid signature check and a java.lang.NullPointerException
, while your error refers to a java.lang.AbstractMethodError: abstract method "java.lang.String android.content.Context.getOpPackageName()
I got the same issue as you upon trying out an app. This could have been due to my patching script, so I had a quick go on a system with an unpatched framework.jar, manually subverting the signature check in the app itself (so that it accepts any signature, and this does not need to be Google's - the system patch is neater because it doesn't need every app using gms to be patched) yet the same error persists.
This suggests that the issue is not the patching script at all (which appears to work just fine and as expected), but some other bug with CM13 and microg play-services. :(
Looking at line 1179 in https://github.com/android/platform_frameworks_base/blob/lollipop-release/core/java/android/view/inputmethod/InputMethodManager.java vs https://github.com/android/platform_frameworks_base/blob/marshmallow-release/core/java/android/view/inputmethod/InputMethodManager.java where the error is happening, I can make a really dirty fix using the patching tool (by patching the call to getOpPackageName to getPackageName).
It should really be fixed properly upstream but I can fix it for you so that things at least work without crashing. I'm hesitant to put it into the main script, but if you checkout the branch cm13-fix-bug
that I've just committed, and run patch_next.py
, then reboot to use the new framework.jar, you should have a working microg play-services on cm13.
Let me know if this works for you and I will close the issue.
@moosd your new branch worked! Many thanks!
But now I'm wondering:
Have played around with this further. It's a bug in microG's implementation and I have submitted a pull request to fix this properly. Should fix the issue for the future without needing an extra framework patch.
I tried to run this script with CM13 on my Nexus 5 (2013) and I restarted the phone but I keep having the same invalid signature errors on logcat when opening an app that uses Google services.
Is the script compatible with CM13?