Building Xiaomi Mi Note 2 Kernel - Xiaomi Mi Note 2 Questions & Answers

Hi guys,
First time posting on XDA so hope I have the right section etc...
I am trying to compile and boot the kernel for the Xiaomi Mi Note 2 and have had some success, but the image created causes the phone to boot into recover. Can I check my build procedure with your please?
The Xiaomi GitHub wiki page has an guide for another phone, which I have followed as far as possible.
Anyway, here are the steps I have taken. Have I missed anything out in terms of configuration?
Step 1: Clone the Xiaomi git repo using:
git clone [email protected]:MiCode/Xiaomi_Kernel_OpenSource.git
Step 2: Checkout the Scorpio branch:
git checkout scorpio-m-oss
Step 3: Get the release tag for the QualComm suported Android Enablement Project: For the Mi Note 2 it I have used LA.UM.5.5.r1-04600-8x96.0.
Step 4: Download the QAEP:
repo init -u git://codeaurora.org/platform/manifest.git -b release -m LA.UM.5.5.r1-04600-8x96.0.xml –-repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable --depth=1
repo sync -j8
Step 7: Merge Xioami Linux Kernel into QAEP: From the QAEP repo dir...
rm -rf kernel/*
mkdir kernel
cp -rf ~/Mi_Kernel/Xiaomi_Kernel_OpenSource/* kernel/
Step 8: Build Kernel
source build/envsetup.sh
lunch msm8996-userdebug
make bootimage BOARD_USES_LIBC_WRAPPER=true
I found that I had to specify BOARD_USES_LIBC_WRAPPER=true as otherwise there would be a link error in the build as the symbol __propClientDispatchWrite would not be defined. Searching for this symbol I found that it is defined in ./bionic/libc/codeaurora/PropClientDispatchWrite.cpp:48. Looking at the Makefile ./bionic/libc/Android.mk one can see that this file is only compiled if ifeq ($(BOARD_USES_LIBC_WRAPPER),true), hence the need for the extra define in the command line for make.
Step 9: Put kernel image into original
Download the original image and unpack:
adb pull /dev/block/sde36 boot_minote2_original.img
./mkboot boot_minote2_original.img boot_minote2_original
Do that same with mkboot for the image I built and unpack that. Then copy the file kernel from the newly build version into boot_minote2_original and repackage:
./mkboot boot_minote2_original boot_minote2_new.img
Step 9: Attempt to boot new image
adb reboot bootloader
fastboot boot boot_minote2_new.img
And, almost there. The new image boots to a state where I can at least ADB shell into the device. The logcat shows the following significant errors when compared to the logcat of the original xiaomi image:
W SystemServer: ***********************************************
E SystemServer: BOOT FAILURE making display ready
E SystemServer: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.server.wm.WindowManagerService.displayReady()' on a null object reference
E SystemServer: at com.android.server.SystemServer.startOtherServices(SystemServer.java:594)
E SystemServer: at com.android.server.SystemServer.run(SystemServer.java:281)
E SystemServer: at com.android.server.SystemServer.main(SystemServer.java:179)
E SystemServer: at java.lang.reflect.Method.invoke(Native Method)
E SystemServer: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
E SystemServer: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
E System : ******************************************
E System : ************ Failure starting system services
E System : java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.server.wm.WindowManagerService.showBootMessage(java.lang.CharSequence, boolean)' on a null object reference
E System : at com.android.server.am.ActivityManagerService.showBootMessage(ActivityManagerService.java:6474)
E System : at com.android.server.SystemServer.startOtherServices(SystemServer.java:627)
E System : at com.android.server.SystemServer.run(SystemServer.java:281)
E System : at com.android.server.SystemServer.main(SystemServer.java:179)
E System : at java.lang.reflect.Method.invoke(Native Method)
E System : at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
E System : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
D AndroidRuntime: Shutting down VM
E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main
E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.server.wm.WindowManagerService.showBootMessage(java.lang.CharSequence, boolean)' on a null object reference
E AndroidRuntime: at com.android.server.am.ActivityManagerService.showBootMessage(ActivityManagerService.java:6474)
E AndroidRuntime: at com.android.server.SystemServer.startOtherServices(SystemServer.java:627)
E AndroidRuntime: at com.android.server.SystemServer.run(SystemServer.java:281)
E AndroidRuntime: at com.android.server.SystemServer.main(SystemServer.java:179)
E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
So, onwards with my investigations but if any one has tips and clues to share, please lemme know

Trying to ask help from StoneTrapper !! He is the only one developer in this forum until now ...

Hey did you ever figure this out? Struggling with my Blu Life One X2 kernel. Compiling it without the QAEP tree boots, but the display goes all glitchy and just shows black. I can adb and everything else works.
Trying your method of QAEP now. Please let me know if you found anything new!

Hey, sorry I hadn't been keeping an eye on this thread.
I don't really use MIUI so haven't tried to compile the kernel for it. The current kernels that are around for these devices are based on generic similar devices with source code taken and adjusted from MiCode where needed.
Since this kernel base is also marshmallow for the more recent MIUI releases it'll need updating for that too.
For building a MIUI kernel your best bet is to take a look at other devices in the same family that currently have third party MIUI kernels. A good example is the DragonXia Kernel which is MIUI compatible. You'll need to add the missing features required for scorpio and add msm8996pro support but between MiCode and various sources it's do-able.
If you're successful and happy with the result then the author may be happy for you to release with permission.

Related

Fingerprint Sensor not surviving reboot

All apps I have that use the fingerprint sensor only work until I reboot the phone, any idea why? Here's some logs
Code:
-----
App Version: 1.13.0
App Version Code: 46
OS Version: 3.18.31-perf-g336fddd-00001-g0103837
API Level: 25
Android Version: 7.1.1
Device Manufacturer: motorola
Device Codename: perry_f
Device Model: Moto E (4)
Stacktrace: de.devland.masterpassword.util.FingerprintException: Could not create cipher for encryption. Seems your device is unsupported.
at de.devland.masterpassword.util.FingerprintUtil.getCipher(FingerprintUtil.java:226)
at de.devland.masterpassword.util.FingerprintUtil.initDecryptCipher(FingerprintUtil.java:121)
at de.devland.masterpassword.ui.LoginFragment.onResume(LoginFragment.java:117)
at android.support.v4.app.Fragment.performResume(Fragment.java:2238)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1346)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:2914)
at android.support.v4.app.FragmentController.dispatchResume(FragmentController.java:223)
at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:509)
at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:498)
at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:172)
at android.app.Activity.performResume(Activity.java:6815)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3427)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3490)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2749)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1490)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
Caused by: android.security.keystore.KeyPermanentlyInvalidatedException: Key permanently invalidated
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:724)
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:748)
at android.security.keystore.KeyStoreCryptoOperationUtils.getInvalidKeyExceptionForInit(KeyStoreCryptoOperationUtils.java:54)
at android.security.keystore.KeyStoreCryptoOperationUtils.getExceptionForCipherInit(KeyStoreCryptoOperationUtils.java:89)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.ensureKeystoreOperationInitialized(AndroidKeyStoreCipherSpiBase.java:265)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineInit(AndroidKeyStoreCipherSpiBase.java:148)
at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2973)
at javax.crypto.Cipher.tryCombinations(Cipher.java:2884)
at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2789)
at javax.crypto.Cipher.chooseProvider(Cipher.java:956)
at javax.crypto.Cipher.init(Cipher.java:1329)
at javax.crypto.Cipher.init(Cipher.java:1267)
at de.devland.masterpassword.util.FingerprintUtil.getCipher(FingerprintUtil.java:222)
... 23 more
android.security.keystore.KeyPermanentlyInvalidatedException: Key permanently invalidated
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:724)
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:748)
at android.security.keystore.KeyStoreCryptoOperationUtils.getInvalidKeyExceptionForInit(KeyStoreCryptoOperationUtils.java:54)
at android.security.keystore.KeyStoreCryptoOperationUtils.getExceptionForCipherInit(KeyStoreCryptoOperationUtils.java:89)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.ensureKeystoreOperationInitialized(AndroidKeyStoreCipherSpiBase.java:265)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineInit(AndroidKeyStoreCipherSpiBase.java:148)
at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2973)
at javax.crypto.Cipher.tryCombinations(Cipher.java:2884)
at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2789)
at javax.crypto.Cipher.chooseProvider(Cipher.java:956)
at javax.crypto.Cipher.init(Cipher.java:1329)
at javax.crypto.Cipher.init(Cipher.java:1267)
at de.devland.masterpassword.util.FingerprintUtil.getCipher(FingerprintUtil.java:222)
at de.devland.masterpassword.util.FingerprintUtil.initDecryptCipher(FingerprintUtil.java:121)
at de.devland.masterpassword.ui.LoginFragment.onResume(LoginFragment.java:117)
at android.support.v4.app.Fragment.performResume(Fragment.java:2238)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1346)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:2914)
at android.support.v4.app.FragmentController.dispatchResume(FragmentController.java:223)
at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:509)
at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:498)
at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:172)
at android.app.Activity.performResume(Activity.java:6815)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3427)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3490)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2749)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1490)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
mendelgordon said:
All apps I have that use the fingerprint sensor only work until I reboot the phone, any idea why? Here's some logs
Code:
-----
App Version: 1.13.0
App Version Code: 46
OS Version: 3.18.31-perf-g336fddd-00001-g0103837
API Level: 25
Android Version: 7.1.1
Device Manufacturer: motorola
Device Codename: perry_f
Device Model: Moto E (4)
Stacktrace: de.devland.masterpassword.util.FingerprintException: Could not create cipher for encryption. Seems your device is unsupported.
at de.devland.masterpassword.util.FingerprintUtil.getCipher(FingerprintUtil.java:226)
at de.devland.masterpassword.util.FingerprintUtil.initDecryptCipher(FingerprintUtil.java:121)
at de.devland.masterpassword.ui.LoginFragment.onResume(LoginFragment.java:117)
at android.support.v4.app.Fragment.performResume(Fragment.java:2238)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1346)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:2914)
at android.support.v4.app.FragmentController.dispatchResume(FragmentController.java:223)
at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:509)
at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:498)
at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:172)
at android.app.Activity.performResume(Activity.java:6815)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3427)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3490)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2749)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1490)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
Caused by: android.security.keystore.KeyPermanentlyInvalidatedException: Key permanently invalidated
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:724)
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:748)
at android.security.keystore.KeyStoreCryptoOperationUtils.getInvalidKeyExceptionForInit(KeyStoreCryptoOperationUtils.java:54)
at android.security.keystore.KeyStoreCryptoOperationUtils.getExceptionForCipherInit(KeyStoreCryptoOperationUtils.java:89)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.ensureKeystoreOperationInitialized(AndroidKeyStoreCipherSpiBase.java:265)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineInit(AndroidKeyStoreCipherSpiBase.java:148)
at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2973)
at javax.crypto.Cipher.tryCombinations(Cipher.java:2884)
at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2789)
at javax.crypto.Cipher.chooseProvider(Cipher.java:956)
at javax.crypto.Cipher.init(Cipher.java:1329)
at javax.crypto.Cipher.init(Cipher.java:1267)
at de.devland.masterpassword.util.FingerprintUtil.getCipher(FingerprintUtil.java:222)
... 23 more
android.security.keystore.KeyPermanentlyInvalidatedException: Key permanently invalidated
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:724)
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:748)
at android.security.keystore.KeyStoreCryptoOperationUtils.getInvalidKeyExceptionForInit(KeyStoreCryptoOperationUtils.java:54)
at android.security.keystore.KeyStoreCryptoOperationUtils.getExceptionForCipherInit(KeyStoreCryptoOperationUtils.java:89)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.ensureKeystoreOperationInitialized(AndroidKeyStoreCipherSpiBase.java:265)
at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineInit(AndroidKeyStoreCipherSpiBase.java:148)
at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2973)
at javax.crypto.Cipher.tryCombinations(Cipher.java:2884)
at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2789)
at javax.crypto.Cipher.chooseProvider(Cipher.java:956)
at javax.crypto.Cipher.init(Cipher.java:1329)
at javax.crypto.Cipher.init(Cipher.java:1267)
at de.devland.masterpassword.util.FingerprintUtil.getCipher(FingerprintUtil.java:222)
at de.devland.masterpassword.util.FingerprintUtil.initDecryptCipher(FingerprintUtil.java:121)
at de.devland.masterpassword.ui.LoginFragment.onResume(LoginFragment.java:117)
at android.support.v4.app.Fragment.performResume(Fragment.java:2238)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1346)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:2914)
at android.support.v4.app.FragmentController.dispatchResume(FragmentController.java:223)
at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:509)
at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:498)
at android.support.v7.app.AppCompatActivity.onPostResume(AppCompatActivity.java:172)
at android.app.Activity.performResume(Activity.java:6815)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3427)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3490)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2749)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1490)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6165)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
Click to expand...
Click to collapse
I'm not good with logs, but does it simply not work or force log you out? LastPass often gives me "fingerprint not recognized" and I have to re-log back in and set up my fingerprint to login once more.
AidenSurvival said:
I'm not good with logs, but does it simply not work or force log you out? LastPass often gives me "fingerprint not recognized" and I have to re-log back in and set up my fingerprint to login once more.
Click to expand...
Click to collapse
It Force logs me out and makes me log back in with a password everytime I reboot

Some crashes to reboot

Hi!
I use a google-free Omnirom on my Xperia X. There are 2 apps, both from f-droid, that crash the device to reboot. They work with Lineage on an other device. The apps are osmand, which generates an exceptionlog, and usbmountr.
Does any OR dev like to examine this? If yes, what files will I have to post? Maybe debugging it live in irc or jabber? I don't know, if this is a general OR problem, or a problem with the 64bit system.
Here is what osmand logs:
Code:
07.08.2017 8:32:35
Exception occured in thread Thread[main,5,main] :
java.lang.RuntimeException: Unable to resume activity {net.osmand.plus/net.osmand.plus.activities.MapActivity}: java.lang.RuntimeException: android.os.DeadSystemException
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3445)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3485)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2748)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1489)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6171)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781)
Caused by: java.lang.RuntimeException: android.os.DeadSystemException
at android.net.ConnectivityManager.getActiveNetworkInfo(ConnectivityManager.java:761)
at net.osmand.plus.OsmandSettings.isInternetConnected(OsmandSettings.java:265)
at net.osmand.plus.OsmandSettings.isInternetConnectionAvailable(OsmandSettings.java:252)
at net.osmand.plus.OsmandSettings.isInternetConnectionAvailable(OsmandSettings.java:246)
at net.osmand.plus.helpers.DiscountHelper.checkAndDisplay(DiscountHelper.java:54)
at net.osmand.plus.activities.MapActivity.onResume(MapActivity.java:637)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1270)
at android.app.Activity.performResume(Activity.java:6786)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3422)
... 10 more
Caused by: android.os.DeadSystemException
... 19 more

(TB-8504x) Lenovo tab 4 8: Fix facelock ("Face Unlock") crash

Lenovo Tab 4 8 - Fix facelock crash (Related gist: https://gist.github.com/KreAch3R/734b1086c928ab8ceeafaf3e4dbd8c33)
I noticed that a Lenovo tab 4 8 (tb-8504x) on the latest stock image as of today didn't have a working face unlock ("facelock"). When it was time to add a new face, it crashed with the following log:
Code:
08-16 17:39:34.379 6600 6600 D AndroidRuntime: Shutting down VM
08-16 17:39:34.380 6600 6600 E AndroidRuntime: FATAL EXCEPTION: main
08-16 17:39:34.380 6600 6600 E AndroidRuntime: Process: com.android.facelock, PID: 6600
08-16 17:39:34.380 6600 6600 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6google8protobuf5Arena15AllocateAlignedEPKSt9type_infom" referenced by "/system/lib64/libfacenet.so"...
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:989)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1530)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at com.google.android.libraries.vision.facenet.FaceNet.<clinit>(FaceNet.java:67)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at com.google.android.libraries.vision.facenet.FaceNet.createFromAssets(FaceNet.java:118)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at com.android.facelock.FaceLockUtil.initialize(FaceLockUtil.java:148)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at com.android.facelock.SetupEnrollmentScreen.onCreate(SetupEnrollmentScreen.java:517)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6720)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at android.app.ActivityThread.-wrap12(ActivityThread.java)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6119)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
08-16 17:39:34.380 6600 6600 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
08-16 17:39:34.383 1428 2305 W ActivityManager: Force finishing activity com.android.facelock/.SetupEnrollmentScreen
The FIX
1. Download libfacenet.so from Open-GApps [Direct link to the binary I used].
2. Follow the instructions from here and download @dywersant 's magisk-remount.zip module from here.
3. Boot into Android with a RW /system using the module. You can confirm with:
Code:
su
cd /system
touch testfile.txt
If the command succeeds, you have a writable /system.
4. Go into the lib64 folder (/system/lib64)
5. Make a backup of the original libfacenet.so file:
Code:
cp /system/lib64/libfacenet.so /sdcard/libfacenet.so.orig
BE CAREFUL: Don't make the backup inside the /system partition, as it can be lost after reboot!
6. Mount the specific file as RW
I don't know how or why, but Lenovo seems to have made every lib file a different ro mount point/partition. So:
Code:
mount -o rw,remount /system/lib64/libfacenet.so
is needed, otherwise you end up with "read only file system" error (even when the whole /system is RW!)
7. Push to /sdcard and replace the file
Code:
cp /sdcard/libfacenet.so /system/lib64/libfacenet.so
Now, try to add a new face again. It should work!
--------------------------------------------------------------
Debugging
If anyone is interested to know how. You always start from the log. Let's disect this line:
Code:
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6google8protobuf5Arena15AllocateAlignedEPKSt9type_infom" referenced by "/system/lib64/libfacenet.so"
This tells us that the app com.android.facelock launched and called the library libfacenet.so which referenced a method/symbol/whatever named _ZN6google8protobuf5Arena15AllocateAlignedEPKSt9type_infom but that method doesn't exist inside whatever should include it, so "dlopen" failed and we got ourselves the "java.lang.UnsatisfiedLinkError" error. Let's sum up:
1. The app that crashes is com.android.facelock
2. One related .so lib is libfacenet.so
3. There is another one, unnamed, that should contain _ZN6google8protobuf5Arena15AllocateAlignedEPKSt9type_infom but it doesn't.
Googling about "_ZN6google8protobuf5Arena15AllocateAlignedEPKSt9type_infom" brings up some libprotobuf related results. This is good enough. Grepping through /system/lib64 shows up that there are two .so there:
Code:
libprotobuf-cpp-full.so
libprotobuf-cpp-lite.so
Doing the same in a working pixel image produces the same files. But obviously Facelock works on the Pixel but not on this tablet. We need a way to differentiate them (remember, pixel is on a Oreo base while this is Nougat).
Reading this StackExchange post, we find out about the "readelf -a -W elffile" command. Give this a try and you should see that a lot comes up. Next step, grepping through this file dump.
Lenovo libprotobuf-cpp-lite.so:
Code:
$ readelf -a -W libprotobuf-cpp-lite.so | grep _ZN6google8protobuf5Arena15AllocateAlignedEPKSt9type_infom
$
Pixel libprotobuf-cpp-lite.so:
Code:
$ readelf -a -W libprotobuf-cpp-lite.so | grep _ZN6google8protobuf5Arena15AllocateAlignedEPKSt9type_infom
000000000004fb10 0000005700000402 R_AARCH64_JUMP_SLOT 0000000000022254 _ZN6google8protobuf5Arena15AllocateAlignedEPKSt9type_infom + 0
87: 0000000000022254 216 FUNC GLOBAL DEFAULT 12 _ZN6google8protobuf5Arena15AllocateAlignedEPKSt9type_infom
Bingo! So we confirm that the libfacenet.so is trying to call an upstream method (probably), one that isn't bundled inside the libprotobuf-cpp-lite.so of the Lenovo stock image.
So now we know, it's a problem of version incompatibility. There are two things to try:
1. Replace libprotobuf-cpp-lite.so with a version that contains _ZN6google8protobuf5Arena15AllocateAlignedEPKSt9type_infom
2. Replaced libfacenet.so with a version that doesn't contain _ZN6google8protobuf5Arena15AllocateAlignedEPKSt9type_infom
Method No. 1 didn't work, while it got rid of the "java.lang.UnsatisfiedLinkError" error (confirming the diagnosis), it produced more .so related crashes, so I assume there were a lot more code that was incompatible. But Method No.2 worked as a charm!

Camera FC in Android 9 PIE Roms

I have been facing Camera Fc's in almost all PIE Roms randomly after a reboot.
It happens randomly after rebooting the phone. In some ROMs it happens after two or three reboots, I am attaching the link of the log file
time: 1551073148867
msg: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
stacktrace: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.camera2/com.android.camera.CameraActivity}: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2953)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3088)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1818)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6739)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:495)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:859)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at com.android.ex.camera2.portability.AndroidCameraAgentImpl$AndroidCameraDeviceInfo.getCharacteristics(AndroidCameraAgentImpl.java:176)
at com.android.camera.app.CameraController.getCharacteristics(CameraController.java:112)
at com.android.camera.CaptureModule.getFacingFromCameraId(CaptureModule.java:1542)
at com.android.camera.CaptureModule.init(CaptureModule.java:415)
at com.android.camera.CameraActivity.onCreateTasks(CameraActivity.java:1627)
at com.android.camera.util.QuickActivity.onCreate(QuickActivity.java:114)
at android.app.Activity.performCreate(Activity.java:7145)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2933)
... 11 more
I am new and therefore could not post url here.
Kindly look into this issue
ZABCXYZ said:
I have been facing Camera Fc's in almost all PIE Roms randomly after a reboot.
It happens randomly after rebooting the phone. In some ROMs it happens after two or three reboots, I am attaching the link of the log file
time: 1551073148867
msg: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
stacktrace: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.camera2/com.android.camera.CameraActivity}: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2953)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3088)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1818)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6739)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:495)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:859)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at com.android.ex.camera2.portability.AndroidCameraAgentImpl$AndroidCameraDeviceInfo.getCharacteristics(AndroidCameraAgentImpl.java:176)
at com.android.camera.app.CameraController.getCharacteristics(CameraController.java:112)
at com.android.camera.CaptureModule.getFacingFromCameraId(CaptureModule.java:1542)
at com.android.camera.CaptureModule.init(CaptureModule.java:415)
at com.android.camera.CameraActivity.onCreateTasks(CameraActivity.java:1627)
at com.android.camera.util.QuickActivity.onCreate(QuickActivity.java:114)
at android.app.Activity.performCreate(Activity.java:7145)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2933)
... 11 more
I am new and therefore could not post url here.
Kindly look into this issue
Click to expand...
Click to collapse
U partitions are encrypted . Do format data. Then camera will work.
Format data command decrypts and erases the data and internal sd partition.
Go to twrp
Format data
Type Yes to format.
Reboot

App crash / force close java.lang.NullPointerException, help

Hello everyone, I open this thread here because I know much of the people here have more experience and may be can help with the problem.
I have a tablet Chuwi with Intel Celeron (x86-x64) with Windows and now I make dual boot with "Phoenix OS Thunder Lite v4.5 Android x86", every think work as expected but main app which I use crash. I investigate the problem and with the another port "Prime OS Thunder Lite v1.0" the issue doesn't present and work like a charm. But with Prime OS i have very short life time, in Phoenix OS is greatly improved. After a coup of port I considered the something in Phoenix OS (no matter which port or mod) have this issue. I have a log with the error, generated by the application + video of the problem.
The quote of the log:
Code:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cnnlaunch.x431.pro3S/com.cnlaunch.x431pro.activity.diagnose.CarIconActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setAlpha(int)' on a null object reference
Full log:
Spoiler: Full log
Devices Model: Thunder OS
Devices SDK Version: 25
Software Version Name: 66 AG
Software Version Code: 129
Software Type: X431PADII
Crash Time: 2021-01-18,19-47-22
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cnnlaunch.x431.pro3S/com.cnlaunch.x431pro.activity.diagnose.CarIconActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setAlpha(int)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2713)
at android.app.ActivityThread.startActivityNow(ActivityThread.java:2503)
at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:136)
at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:348)
at com.cnlaunch.x431pro.activity.MainActivity.c(Unknown Source)
at com.cnlaunch.x431pro.utils.bs.a(Unknown Source)
at com.cnlaunch.x431pro.utils.d.f.a(Unknown Source)
at com.cnlaunch.x431pro.activity.ap.d(Unknown Source)
at com.cnlaunch.x431pro.activity.ap.c(Unknown Source)
at com.cnlaunch.x431pro.activity.ah.onClick(Unknown Source)
at android.view.View.performClick(View.java:5638)
at android.view.View$PerformClick.run(View.java:22435)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6300)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:887)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:777)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setAlpha(int)' on a null object reference
at com.cnlaunch.x431pro.widget.a.db.<init>(Unknown Source)
at com.cnlaunch.x431pro.activity.diagnose.CarIconFragmentForAll.onActivityCreated(Unknown Source)
at android.app.Fragment.performActivityCreated(Fragment.java:2362)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1014)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
at android.app.BackStackRecord.run(BackStackRecord.java:816)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578)
at android.app.FragmentController.execPendingActions(FragmentController.java:371)
at android.app.Activity.performStart(Activity.java:6724)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2676)
... 18 more
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setAlpha(int)' on a null object reference
at com.cnlaunch.x431pro.widget.a.db.<init>(Unknown Source)
at com.cnlaunch.x431pro.activity.diagnose.CarIconFragmentForAll.onActivityCreated(Unknown Source)
at android.app.Fragment.performActivityCreated(Fragment.java:2362)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1014)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
at android.app.BackStackRecord.run(BackStackRecord.java:816)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578)
at android.app.FragmentController.execPendingActions(FragmentController.java:371)
at android.app.Activity.performStart(Activity.java:6724)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2676)
at android.app.ActivityThread.startActivityNow(ActivityThread.java:2503)
at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:136)
at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:348)
at com.cnlaunch.x431pro.activity.MainActivity.c(Unknown Source)
at com.cnlaunch.x431pro.utils.bs.a(Unknown Source)
at com.cnlaunch.x431pro.utils.d.f.a(Unknown Source)
at com.cnlaunch.x431pro.activity.ap.d(Unknown Source)
at com.cnlaunch.x431pro.activity.ap.c(Unknown Source)
at com.cnlaunch.x431pro.activity.ah.onClick(Unknown Source)
at android.view.View.performClick(View.java:5638)
at android.view.View$PerformClick.run(View.java:22435)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6300)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:887)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:777)
Video link with the problem -
App link - https://drive.google.com/file/d/15gLSmf2SxzSZ5XmOXVQh4D4lWKMlDl6w/view?usp=sharing
Thanks!

Categories

Resources