让ps touch兼容9.0
2018-11-24 本文已影响76人
琴梨梨
升到9.0几天,没遇到什么兼容性问题,除了miui计算器有一个不合规api调用,改了一下就好了,结果偶然打开ps touch,却发现打不开了
让ps touch兼容9.0看了一下错误日志
Process: air.com.adobe.pstouch, PID: 14055
java.lang.UnsatisfiedLinkError: No implementation found for void com.adobe.air.AIRWindowSurfaceView.nativeSurfaceCreated() (tried Java_com_adobe_air_AIRWindowSurfaceView_nativeSurfaceCreated and Java_com_adobe_air_AIRWindowSurfaceView_nativeSurfaceCreated__)
at com.adobe.air.AIRWindowSurfaceView.nativeSurfaceCreated(Native Method)
at com.adobe.air.AIRWindowSurfaceView.surfaceCreated(AIRWindowSurfaceView.java:721)
at android.view.SurfaceView.updateSurface(SurfaceView.java:670)
at android.view.SurfaceView$2.onPreDraw(SurfaceView.java:143)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:977)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2475)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7184)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
问题集中在nativeSurfaceCreated这个方法上,看样子也是一个违规api调用,直接去dex里搜
然而...
native方法,固化在so文件里,不可编辑。
让ps touch兼容9.0本以为没有办法了,突然想到ps touch是基于adobe air开发的,而琴梨梨前段时间基于adobe air移植了一个游戏,赶紧去试了试那个游戏能不能在9.0上打开
让ps touch兼容9.0天无绝人之路,思路来了。
把这个能运行的air的so文件替换过去
让ps touch兼容9.0安装测试,还是闪退,但是抓log发现闪退的问题变了
LineageOS Version: '16.0-20181017_160230-UNOFFICIAL-natrium'
Build fingerprint: 'Xiaomi/natrium/natrium:7.0/NRD90M/V9.6.2.0.NBGMIFD:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 15955, tid: 15955, name: m.adobe.pstouch >>> air.com.adobe.pstouch <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'thread.cc:2148] No pending exception expected: java.lang.NoSuchMethodError: no static or non-static method "Lcom/adobe/air/AIRWindowSurfaceView;.nativeGetSoftKeyboardType()I"'
r0 00000000 r1 00003e53 r2 00000006 r3 00000008
r4 00003e53 r5 00003e53 r6 ffb092fc r7 0000010c
r8 00000002 r9 ffb09369 r10 0000000a r11 ffb09368
ip ffb09298 sp ffb092e8 lr f51a9e89 pc f51a1d2a
这次的闪退问题是找不到method。推测因为这不是一个完全的native activity,在dex里也有对应的部分被更新了,需要同步过来。
让ps touch兼容9.0因为能正常运行的那个游戏的dex部分没有其他第三方库,就是air的基本组件,所以直接用快速patch法,把原dex改成2,把patch dex丢在前面,可以参考琴梨梨之前写的这篇文章https://www.jianshu.com/p/cf63266cca86
再次安装,这次可以运行了
让ps touch兼容9.0ps touch安装包可以在apk mirror下载,我就不把patch过的包放出来了,你们自己折腾玩吧