Xposed icon indicating copy to clipboard operation
Xposed copied to clipboard

Bootloop Xiaomi MI8lite on Miui 10 (10.0.8.0) Oreo 8.1 (SDK27)

Open red55der opened this issue 6 years ago • 8 comments

Device (vendor and model) Xiaomi Mi8lite global

ROM Xiaomi.eu multi MI8LITE V10.0.8.0.ODTCNFH_v10-8.1 (deodexed)

Xposed version Xposed-v90-sdk27-arm64-beta1 (flashed with TWRP)

Detailed description of the issue (including exact error messages if applicable) Device results in a bootloop Logcat shows: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to create service com.android.systemui.SystemUIService: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.systemui.SystemUIApplication.startServicesIfNeeded()' on a null object reference followed by FATAL EXCEPTION IN SYSTEM PROCESS: android.ui java.lang.VerifyError: Rejecting class com.miui.internal.variable.v21.Android_View_View_class that attempts to sub-type erroneous class com.miui.internal.variable.v19.Android_View_View_class (declaration of 'com.miui.internal.variable.v21.Android_View_View_class' appears in /system/app/miui/miui.apk)

Things you have already tried to resolve it Wipe (dalvik) cache Tryed xposed-v90-sdk27-arm64-beta3 (TWRP) Tryed magisk module code inspection (lack of knowledge of the framework to resolve)

Steps to reproduce Clean rom (TWRP), Installed Magisk v18 (TWRP), Installed Xposed v90 sdk27 arm64 beta1 (TWRP)

Logs https://www.dropbox.com/s/1kkgnvtr9e0drkd/logcat.txt?dl=0

red55der avatar Dec 29 '18 18:12 red55der

Extracted the com.android.systemuit.SystemUIService class from MiuiSystemUI.apk.

onCreate() function calls Super and ((Application) getApplication()).getSystemUIApplication().startServicesIfNeeded();

So ((Application) getApplication()) = null or getSystemUIApplication() returns null

Don't know why its returns null after Xposed is installed? Globals?

red55der avatar Dec 30 '18 15:12 red55der

Did some research on the MiuiSystemUI package to understand how it works and to find out what is going wrong.

In com.android.systemui.SystemUIService (MIUI modified version) the onCreate is be called. Which execute (resulting nullpointer exception): ((Application) getApplication()).getSystemUIApplication().startServicesIfNeeded();

The getApplication() function is in base android.app.Service (extended by SystemUIService) it returns the attached application instance.

(Application) is a cast to com.android.systemui.Application (MIUI modified version) (extends miui.external.Application which extends android.app.Application).

The getSystemUIApplication() function is in com.android.systemui.Application (MIUI modified version) it must returns a SystemUIApplication instance (MIUI modified version). Therefore it calls getApplicationDelegate() a base function in miui.external.Application and returns a miui.external.ApplicationDelegate instance (extends ContextWrapper) which is casted to a SystemUIApplication (MIUI modified version).

The com.android.systemui.SystemUIApplication (extends ApplicationDelegate) (MIUI modified version) has the function startServicesIfNeeded() which can't be called because SystemUIApplication instance = null. This results in the nullpointerexception.

Likely the cause of the problem is because there are serveral default android classes modified by MIUI in de MiuiSystemUI. Maybe cast from wrong namespace or wrong context? Puzzeling further.

red55der avatar Dec 30 '18 19:12 red55der

It also bootloops on my Huawei P10, but I don't know how to get the log. Maybe this is the same problem? Is the log even created if you install the zip before the apk?

strubelz avatar Dec 30 '18 19:12 strubelz

the devs said it's bcoz the xiaomi devs always messed up the critical part of the system for no apparent reason...

Crescendo-BLYAT avatar Jan 02 '19 15:01 Crescendo-BLYAT

It is a pity that it has been adjusted. But if someone can give some hints in the direction of a solution, I like to help.

red55der avatar Jan 02 '19 21:01 red55der

Detailed explanation on #317

Crescendo-BLYAT avatar Jan 03 '19 04:01 Crescendo-BLYAT

@CrescendoFang i looked the log's but the fatal exception is different.

red55der avatar Jan 04 '19 22:01 red55der

then I dunno... hehehehe... I'm no expert at this but it surely will make your phone crawl, tried it before... It's due to the xposed called something nonexistent (changed by miui devs)...

Crescendo-BLYAT avatar Jan 18 '19 02:01 Crescendo-BLYAT