Magisk: Latest Canary build crashes when patching boot image.

Created on 1 Mar 2020  路  24Comments  路  Source: topjohnwu/Magisk

Most helpful comment

Fixed

All 24 comments

Getting the same thing on my 3a

Same issue on my Pixel 4. No log entries though. I rebooted, copied the log, then crashed magisk, copied the log again and they're the same.

My pixel 3 has the same problem.

Same, pixel 3 also.

Same here, Pixel 3 XL.

huawei m3 8 inch
BTV-DL09 (BEETHOVEN)
emui 5.0.4
product id 46326519
country eu

#

killed it

update:
working -- 20.3(20300)

#

huawei m3 8 inch
BTV-DL09 (BEETHOVEN)
emui 5.0.4
product id 46326519
country eu

I'm also getting the crash on the Pixel 4. I had tried the previous Canary release and that caused a black screen when patching the March update P4 boot image. The new Magisk Manager will just FC right after clicking "Let's go"

I installed the latest Canary (Debug) release and here is the relevant messages from the logcat

FATAL EXCEPTION: main
Process: com.topjohnwu.magisk, PID: 14568
java.lang.IllegalArgumentException
    at com.topjohnwu.magisk.model.entity.internal.DownloadSubject$Magisk$Companion.invoke(DownloadSubject.kt:101)
    at com.topjohnwu.magisk.ui.install.InstallViewModel.install(InstallViewModel.kt:64)
    at com.topjohnwu.magisk.databinding.FragmentInstallMd2BindingImpl._internalCallbackOnClick(FragmentInstallMd2BindingImpl.java:649)
    at com.topjohnwu.magisk.generated.callback.OnClickListener.onClick(OnClickListener.java:11)
    at android.view.View.performClick(View.java:7259)
    at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:967)
    at android.view.View.performClickInternal(View.java:7236)
    at android.view.View.access$3600(View.java:801)
    at android.view.View$PerformClick.run(View.java:27892)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7356)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

Version of the Manager is 642788ab (277). All you have to do is to try to patch the boot.img, and it FC's right after clicking the "Let's Go ->" button

Good find, I can confirm I saw the same in debug logs.

This will fix it once merged: https://github.com/topjohnwu/Magisk/pull/2504

For anyone that is in need of using Magisk now and can't wait until this patch is merged, the "work around" is to build Magisk Manager yourself using @shakalaca's fork.

Here is a quick and dirty way to do it.

IMPORTANT: If you have Magisk Manager installed on your phone already, you should uninstall it. Clear all its files (clear cache and disk usage) and then uninstall it.

You need to have the Android SDK and NDK installed. Use the Android Studio to have them installed easily. Instructions to install the NDK can be seen here.

mkdir ~/tmp/
cd ~/tmp/
git clone --recurse-submodules https://github.com/shakalaca/Magisk/
cd Magisk
git checkout fix_error_patching_bootimg

# Replace the path to the JVM8 here with the correct one on your machine
export PATH=/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/:$PATH
export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64"

# Replace the path to your SDK here
export ANDROID_HOME=$HOME/Android/Sdk/

# Replace the path to the NDK here
ANDROID_NDK_HOME=$HOME/Android/Sdk/ndk/21.0.6113669/

Edit the config.prop file to look like this:

# The version name and version code of Magisk
versionCode=20306
version=ce7cb1ee

# The version name and version code of Magisk Manager
appVersionCode=277
appVersion=642788ab

outdir=out

# Whether use pretty names for zips, e.g. Magisk-v${version}.zip, Magisk-uninstaller-${date}.zip
# The default output names are magisk-${release/debug/uninstaller}.zip
prettyName=false

# Only used when building with release flag
# These passwords are used along with keyStore to sign APKs and zips
# keyPass is the pwd for the specified keyAlias
keyStore=release-key.jks
keyStorePass=
keyAlias=
keyPass=

And now run:

./build.py app

After it is done building, you just need to install the package that is saved in the out/ directory:

adb install out/app-debug.apk

Now just open the Magisk Manager application on your phone and you will be able to patch your boot.img file!

I am facing the same issue on my Pixel 3XL

@osm0sis,
Same on my old Mediatek MT8312 tablet. When patching boot.img, the app crashes.

The app also crashes when I click the settings button!!
On my Pocophone F1 when I click the settings button, the app doesn't crash.

I don't have any of these problems with the latest stable (version 20.3)

The app version is 642788ab.

Fixed

Thanks, you're the best.

Thank you!!

Thanks!

out of curiosity... while this was merged into the build, I don't see a later Canary release when I load Magisk Manager. Did I configure something incorrectly?

@sylikc you are doing things correctly, don't worry. The maintainer hasn't cut a new release of the canary build so until he does this, it won't show up as a new release you can upgrade to in the Magisk Manager. Unfortunately you'd have to build a version of this on your own to get the latest and greatest if you want it right now otherwise we'll wait on the release to get cut.

@sylikc topjohn just cut a new release (278) you can update from the manager now! everything works woooooo

Cool. I tried the new Magisk Manager, and it certainly doesn't crash there. But I'm having another problem. I'm not sure what mode it gets into... but with the March 2020 update, when I boot in with the patched image, I get a black screen. When I hold down the power button, I get a white menu with Shutdown/Reboot/Lockdown.

I can flash it with the original boot.img and boot up, but I've also tried booting to disable modules with the image-newpixel4.img and it gives me some Error verifying the received boot.img ...

What state have I put the Pixel 4 in, in that it gets to that weird black screen and menu?

Unsure, at this point your best bet is asking on the XDA forum thread.... https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

Thanks. I just checked, and there's an active discussion going on in the Canary thread now.

Thanks for all your quick replies to help out the busy maintainer @TheCorp

No problem, he's doing all the hard work, I'm just trying to help 馃槉

Was this page helpful?
0 / 5 - 0 ratings