Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Re: Request
- Sounds like fun, count me in. I'm not terribly good with libs and such, it's mostly a frustrating process of trial and error... I wish we had the source code and some documentation for our expensive devices.
- Anyways, from the stack trace, it looks like your bluetooth stack does not start at all?
- Code:
- E/dalvikvm( 2529): ERROR: couldn't find native method
- E/dalvikvm( 2529): Requested: Lcom/android/bluetooth/btservice/AdapterService;.enableRadioNative:()Z
- E/dalvikvm( 2529): JNI posting fatal error: RegisterNatives failed for 'com/android/bluetooth/btservice/AdapterService'; aborting...
- I/dalvikvm( 2529): "main" prio=5 tid=1 NATIVE
- I/dalvikvm( 2529): | group="main" sCount=0 dsCount=0 obj=0x42048e88 self=0x420375b8
- I/dalvikvm( 2529): | sysTid=2529 nice=0 sched=0/0 cgrp=apps handle=1074139476
- I/dalvikvm( 2529): | state=R schedstat=( 25874007 9273698 52 ) utm=0 stm=2 core=3
- I/dalvikvm( 2529): #00 pc 0000132e /system/lib/libcorkscrew.so (unwind_backtrace_thread 29)
- I/dalvikvm( 2529): #01 pc 00063502 /system/lib/libdvm.so (dvmDumpNativeStack(DebugOutputTarget const*, int) 33)
- I/dalvikvm( 2529): #02 pc 000574e8 /system/lib/libdvm.so (dvmDumpThreadEx(DebugOutputTarget const*, Thread*, bool) 395)
- I/dalvikvm( 2529): #03 pc 00057556 /system/lib/libdvm.so (dvmDumpThread(Thread*, bool) 25)
- I/dalvikvm( 2529): #04 pc 0004bf6c /system/lib/libdvm.so
- I/dalvikvm( 2529): #05 pc 00001fd2 /system/lib/libnativehelper.so (jniRegisterNativeMethods 81)
- I/dalvikvm( 2529): #06 pc 00004d74 /system/lib/libbluetooth_jni.so (JNI_OnLoad 31)
- I/dalvikvm( 2529): #07 pc 00052eae /system/lib/libdvm.so (dvmLoadNativeCode(char const*, Object*, char**) 465)
- I/dalvikvm( 2529): #08 pc 0006a6e8 /system/lib/libdvm.so
- I/dalvikvm( 2529): #09 pc 000297e0 /system/lib/libdvm.so
- I/dalvikvm( 2529): #10 pc 00030c6c /system/lib/libdvm.so (dvmMterpStd(Thread*) 76)
- I/dalvikvm( 2529): #11 pc 0002e304 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*) 184)
- I/dalvikvm( 2529): #12 pc 00063430 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list) 335)
- I/dalvikvm( 2529): #13 pc 00063454 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...) 19)
- I/dalvikvm( 2529): #14 pc 0006eb58 /system/lib/libdvm.so (dvmInitClass 663)
- I/dalvikvm( 2529): #15 pc 0006a006 /system/lib/libdvm.so
- I/dalvikvm( 2529): #16 pc 000297e0 /system/lib/libdvm.so
- I/dalvikvm( 2529): #17 pc 00030c6c /system/lib/libdvm.so (dvmMterpStd(Thread*) 76)
- I/dalvikvm( 2529): #18 pc 0002e304 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*) 184)
- I/dalvikvm( 2529): #19 pc 00063714 /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool) 391)
- I/dalvikvm( 2529): #20 pc 00002686 /system/bin/app_process
- I/dalvikvm( 2529): #21 pc 000297e0 /system/lib/libdvm.so
- I/dalvikvm( 2529): #22 pc 00030c6c /system/lib/libdvm.so (dvmMterpStd(Thread*) 76)
- I/dalvikvm( 2529): #23 pc 0002e304 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*) 184)
- I/dalvikvm( 2529): #24 pc 00063430 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list) 335)
- I/dalvikvm( 2529): #25 pc 00063454 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...) 19)
- I/dalvikvm( 2529): #26 pc 000028be /system/bin/app_process
- I/dalvikvm( 2529): #27 pc 000297e0 /system/lib/libdvm.so
- I/dalvikvm( 2529): #28 pc 00030c6c /system/lib/libdvm.so (dvmMterpStd(Thread*) 76)
- I/dalvikvm( 2529): #29 pc 0002e304 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*) 184)
- I/dalvikvm( 2529): #30 pc 00063714 /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool) 391)
- I/dalvikvm( 2529): #31 pc 0006b6e2 /system/lib/libdvm.so
- I/dalvikvm( 2529): at java.lang.Runtime.nativeLoad(Native Method)
- I/dalvikvm( 2529): at java.lang.Runtime.doLoad(Runtime.java:421)
- I/dalvikvm( 2529): at java.lang.Runtime.loadLibrary(Runtime.java:362)
- I/dalvikvm( 2529): at java.lang.System.loadLibrary(System.java:526)
- I/dalvikvm( 2529): at com.android.bluetooth.btservice.AdapterApp.<clinit>(AdapterApp.java:34)
- I/dalvikvm( 2529): at java.lang.Class.newInstanceImpl(Native Method)
- I/dalvikvm( 2529): at java.lang.Class.newInstance(Class.java:1208)
- I/dalvikvm( 2529): at android.app.Instrumentation.newApplication(Instrumentation.java:990)
- I/dalvikvm( 2529): at android.app.Instrumentation.newApplication(Instrumentation.java:975)
- I/dalvikvm( 2529): at android.app.LoadedApk.makeApplication(LoadedApk.java:515)
- I/dalvikvm( 2529): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4435)
- I/dalvikvm( 2529): at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)
- I/dalvikvm( 2529): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:631)
- I/dalvikvm( 2529): at android.app.ActivityThread.handleBindApplication(Native Method)
- I/dalvikvm( 2529): at android.app.ActivityThread.access$1500(ActivityThread.java:144)
- I/dalvikvm( 2529): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
- I/dalvikvm( 2529): at android.os.Handler.dispatchMessage(Handler.java:102)
- I/dalvikvm( 2529): at android.os.Looper.loop(Looper.java:212)
- I/dalvikvm( 2529): at android.app.ActivityThread.main(ActivityThread.java:5135)
- I/dalvikvm( 2529): at java.lang.reflect.Method.invokeNative(Native Method)
- I/dalvikvm( 2529): at java.lang.reflect.Method.invoke(Method.java:515)
- I/dalvikvm( 2529): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
- I/dalvikvm( 2529): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
- I/dalvikvm( 2529): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
- I/dalvikvm( 2529): at dalvik.system.NativeStart.main(Native Method)
- I/dalvikvm( 2529):
- E/dalvikvm( 2529): VM aborting
- F/libc ( 2529): Fatal signal 6 (SIGABRT) at 0x000009e1 (code=-6), thread 2529 (droid.bluetooth)
- The counterpart for libbluetooth_jni.so probably lives in framework.jar (not sure?):
- Code:
- Lcom/android/bluetooth/btservice/AdapterService;.enableRadioNative:()Z
- I'd deodex and decompile framework.jar and look at the differences. Let's see, I happen to have the decompiled framework in front of me.
- z3 framework.jar has the following in IBluetooth.smali:
- Code:
- .method public abstract enableRadio(I)Z
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Landroid/os/RemoteException;
- }
- .end annotation
- .end method
- Code:
- .method public abstract isEnabled()Z
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Landroid/os/RemoteException;
- }
- .end annotation
- .end method
- Let's grep:
- Code:
- $ grep -r enableRadio *
- framework.jar.out/smali/android/bluetooth/IBluetoothManager$Stub$Proxy.smali:.method public enableRadio(I)Z
- framework.jar.out/smali/android/bluetooth/IBluetoothManager.smali:.method public abstract enableRadio(I)Z
- framework.jar.out/smali/android/bluetooth/IBluetooth$Stub.smali:.field static final TRANSACTION_enableRadio:I = 0x7
- framework.jar.out/smali/android/bluetooth/IBluetooth$Stub.smali: invoke-virtual {p0, v1}, Landroid/bluetooth/IBluetooth$Stub;->enableRadio(I)Z
- framework.jar.out/smali/android/bluetooth/IBluetooth$Stub$Proxy.smali:.method public enableRadio(I)Z
- framework.jar.out/smali/android/bluetooth/IBluetoothManager$Stub.smali:.field static final TRANSACTION_enableRadio:I = 0xe
- framework.jar.out/smali/android/bluetooth/IBluetoothManager$Stub.smali: invoke-virtual {p0, v0}, Landroid/bluetooth/IBluetoothManager$Stub;->enableRadio(I)Z
- framework.jar.out/smali/android/bluetooth/IBluetooth.smali:.method public abstract enableRadio(I)Z
- framework.jar.out/smali/android/bluetooth/BluetoothAdapter.smali:.method public enableRadio(I)Z
- framework.jar.out/smali/android/bluetooth/BluetoothAdapter.smali: invoke-interface {v2, p1}, Landroid/bluetooth/IBluetoothManager;->enableRadio(I)Z
- So, apparently, the Z3 has that code in android.bluetooth - and it's nowhere to be found in the Z1 framework.jar. From your logcat, it seems that the code request the JNI methods in com/android/bluetooth/btservice/AdapterService. So, hypothesis: your new Z3 libbluetooth_jni.so has the required methods, but the Z1 java counterpart is looking in the wrong place. Possibly because the Bluetooth stack got moved around in between Android versions? Z3 is on 4.4.3 or 4.4.2, Z1 on 4.4.4.
- Looking at this again, I see your stack crashes in "Requested: Lcom/android/bluetooth/btservice/AdapterService;.enableRadioNative)Z" which, according to Google, lives in the Bluetooth package: https://android.googlesource.com/pla...pps/Bluetooth/
- Sony decided to move these to the Z3 framework for some reason - the code I pasted above is only found in Z3 framework.
- So your Bluetooth stack on the Z1 is trying to load some native methods which are not there anymore - Sony moved them into the framework for some reason. It'd be interesting to decompile Bluetooth.apk to verify this idea.
- A possible course of action is to port the full bluetooth stack from the Z3 to the Z1. This includes Bluetooth.apk (com.android.bluetooth), android.bluetooth from framework and associated JNI.
- Code:
- $ strings z3/lib/libbluetooth_jni.so | grep enableRadioNative
- enableRadioNative
- t$ strings z1/lib/libbluetooth_jni.so | grep enableRadioNative
- I wonder why I can't find any mention of enableRadioNative in the Z1. It's also possible that the code is only there in Z3, but then it shouldn't crash IF you have the proper libbluetooth_jni.so.
Advertisement
Add Comment
Please, Sign In to add comment