mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +00:00
Update install guides
This commit is contained in:
parent
a94268329c
commit
567b905ef1
Binary file not shown.
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 86 KiB |
@ -7,46 +7,56 @@ If you already have Magisk installed, it is **strongly recommended** to upgrade
|
|||||||
Before you start:
|
Before you start:
|
||||||
|
|
||||||
- This tutorial assumes you understand how to use `adb` and `fastboot`
|
- This tutorial assumes you understand how to use `adb` and `fastboot`
|
||||||
- Your device's bootloader has to be unlocked
|
|
||||||
- If you plan to also install custom kernels, install it after Magisk
|
- If you plan to also install custom kernels, install it after Magisk
|
||||||
|
- Your device's bootloader has to be unlocked
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Download and install the latest Magisk app. We use the app to gather some information about your device. In the home screen, you should see this:
|
Download and install the latest [Magisk app](https://github.com/topjohnwu/Magisk/releases/latest). In the home screen, you should see:
|
||||||
|
|
||||||
<p align="center"><img src="images/device_info.png" width="500"/></p>
|
<p align="center"><img src="images/device_info.png" width="500"/></p>
|
||||||
|
|
||||||
Pay special attention to the **Ramdisk** info. The result of this info determines whether your device has ramdisk in the boot partition.
|
The result of **Ramdisk** determines whether your device has ramdisk in the boot partition. If your device does not have boot ramdisk, read the [Magisk in Recovery](#magisk-in-recovery) section before continuing.
|
||||||
|
|
||||||
> *(Unfortunately, there are exceptions as some devices' bootloader accepts ramdisk even if it shouldn't. In this case, you will have to follow the instructions as if your device's boot partition does include ramdisk. There is no way to detect this, so the only way to know for sure is to actually try. Fortunately, as far as we know, only some Xiaomi devices are known to have this property, so most people can simply ignore this piece of information.)*
|
> _(Unfortunately, there are exceptions as some devices' bootloader accepts ramdisk even if it shouldn't. In this case, you will have to follow the instructions as if your device's boot partition **does** include ramdisk. There is no way to detect this, so the only way to know for sure is to actually try. Fortunately, as far as we know, only some Xiaomi devices are known to have this property, so most people can simply ignore this piece of information.)_
|
||||||
|
|
||||||
**If your device does not have boot ramdisk, read the [Magisk in Recovery](#magisk-in-recovery) section before installing. The information in that section is VERY important!**
|
If you are using a Samsung device that is launched with Android 9.0 or higher, you can now jump to [its own section](#samsung-system-as-root).
|
||||||
|
|
||||||
If you are using a Samsung device and the **SAR** result is **Yes**, please check [its own section](#samsung-system-as-root).
|
If your device has boot ramdisk, get a copy of the `boot.img`.<br>
|
||||||
|
If your device does **NOT** have boot ramdisk, get a copy of the `recovery.img`.<br>
|
||||||
|
You should be able to extract the file you need from official firmware packages or your custom ROM zip.
|
||||||
|
|
||||||
Otherwise, continue to [Patching Images](#patching-images).
|
Next, we need to know whether your device has a separate `vbmeta` partition.
|
||||||
|
|
||||||
(P.S.1: If your device has boot ramdisk, you can also install Magisk with a [custom recovery](#custom-recovery), **but it is not recommended**)<br>
|
- If your official firmware package contains `vbmeta.img`, then yes, your device **has** a separate `vbmeta` partition
|
||||||
(P.S.2: Huawei devices are not supported, and the instructions are removed from this page.)
|
- You can also check by connecting your device to a PC and run the command:<br>
|
||||||
|
`adb shell ls -l /dev/block/by-name`
|
||||||
|
- If you find `vbmeta`, `vbmeta_a`, or `vbmeta_b`, then yes, your device **has** a separate `vbmeta` partition
|
||||||
|
- Otherwise, your device **does not** have a separate `vbmeta` partition.
|
||||||
|
|
||||||
|
Quick recap, at this point, you should know and prepare:
|
||||||
|
|
||||||
|
1. Whether your device has boot ramdisk
|
||||||
|
2. Whether your device has a separate `vbmeta` partition
|
||||||
|
3. A `boot.img` or `recovery.img` based on the result of (1)
|
||||||
|
|
||||||
|
Let's continue to [Patching Images](#patching-images).
|
||||||
|
|
||||||
## Patching Images
|
## Patching Images
|
||||||
|
|
||||||
If your device has boot ramdisk, you need a copy of the `boot.img`<br>
|
|
||||||
If your device does **NOT** have boot ramdisk, you need a copy of the `recovery.img`.
|
|
||||||
|
|
||||||
You should be able to extract the file you need from official firmware packages or your custom ROM zip (if using one). If you are still having trouble, go to [XDA-Developers](https://forum.xda-developers.com/) and look for resources, guides, discussions, or ask for help in your device's forum.
|
|
||||||
|
|
||||||
- Copy the boot/recovery image to your device
|
- Copy the boot/recovery image to your device
|
||||||
- Press the **Install** button in the Magisk card
|
- Press the **Install** button in the Magisk card
|
||||||
- If you are patching a recovery image, make sure **"Recovery Mode"** is checked in options.<br>In most cases it should already be automatically checked.
|
- If you are patching a recovery image, check the **"Recovery Mode"** option
|
||||||
- Choose **"Select and Patch a File"** in method, and select the stock boot/recovery image
|
- If your device does **NOT** have a separate `vbmeta` partition, check the **"Patch vbmeta in boot image"** option
|
||||||
- The Magisk app will patch the image to `[Internal Storage]/Download/magisk_patched_[random_strings].img`.
|
- Choose **"Select and Patch a File"** in method, and select the boot/recovery image
|
||||||
- Copy the patched image to your PC with ADB:<br>
|
- Start the installation, and copy the patched image to your PC using ADB:<br>
|
||||||
`adb pull /sdcard/Download/magisk_patched_[random_strings].img`
|
`adb pull /sdcard/Download/magisk_patched_[random_strings].img`
|
||||||
- Flash the patched boot/recovery image to your device.<br>
|
- Flash the patched boot/recovery image to your device.<br>
|
||||||
For most devices, reboot into fastboot mode and flash with command:<br>
|
For most devices, reboot into fastboot mode and flash with command:<br>
|
||||||
`fastboot flash boot /path/to/magisk_patched.img` or <br>
|
`fastboot flash boot /path/to/magisk_patched.img` or <br>
|
||||||
`fastboot flash recovery /path/to/magisk_patched.img` if flashing a recovery image
|
`fastboot flash recovery /path/to/magisk_patched.img`
|
||||||
|
- (Optional) If your device has a separate `vbmeta` partition, you can patch the `vbmeta` partition with command:<br>
|
||||||
|
`fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img`
|
||||||
- Reboot and voila!
|
- Reboot and voila!
|
||||||
|
|
||||||
## Uninstallation
|
## Uninstallation
|
||||||
@ -55,9 +65,9 @@ The easiest way to uninstall Magisk is directly through the Magisk app. If you i
|
|||||||
|
|
||||||
## Magisk in Recovery
|
## Magisk in Recovery
|
||||||
|
|
||||||
If your device does not have ramdisk in boot images, Magisk has no choice but to hijack the recovery partition. For these devices, you will have to **reboot to recovery** every time you want Magisk enabled.
|
In the case when your device does not have ramdisk in boot images, Magisk has no choice but to hijack the recovery partition. For these devices, you will have to **reboot to recovery** every time you want Magisk enabled.
|
||||||
|
|
||||||
Since Magisk now hijacks the recovery, there is a special mechanism for you to *actually* boot into recovery mode. Each device model has its own key combo to boot into recovery, as an example for Galaxy S10 it is (Power + Bixby + Volume Up). A quick search online should easily get you this info. As soon as you press the combo and the device vibrates with a splash screen, release all buttons to boot into Magisk. If you decide to boot into the actual recovery mode, **long press volume up until you see the recovery screen**.
|
When Magisk hijacks the recovery, there is a special mechanism to allow you to _actually_ boot into recovery mode. Each device model has its own key combo to boot into recovery, as an example for Galaxy S10 it is (Power + Bixby + Volume Up). A quick search online should easily get you this info. As soon as you press the key combo and the device vibrates with a splash screen, release all buttons to boot into Magisk. If you decide to boot into the actual recovery mode, **long press volume up until you see the recovery screen**.
|
||||||
|
|
||||||
As a summary, after installing Magisk in recovery **(starting from power off)**:
|
As a summary, after installing Magisk in recovery **(starting from power off)**:
|
||||||
|
|
||||||
@ -75,7 +85,7 @@ As a summary, after installing Magisk in recovery **(starting from power off)**:
|
|||||||
|
|
||||||
- Installing Magisk **WILL** trip KNOX
|
- Installing Magisk **WILL** trip KNOX
|
||||||
- Installing Magisk for the first time **REQUIRES** a full data wipe (this is **NOT** counting the data wipe when unlocking bootloader). Backup your data before continue.
|
- Installing Magisk for the first time **REQUIRES** a full data wipe (this is **NOT** counting the data wipe when unlocking bootloader). Backup your data before continue.
|
||||||
- Download Odin (only runs on Windows) that supports your device. You can find it easily with a quick search online.
|
- Download Odin (only runs on Windows) that supports your device.
|
||||||
|
|
||||||
### Unlocking Bootloader
|
### Unlocking Bootloader
|
||||||
|
|
||||||
@ -93,25 +103,25 @@ Unlocking the bootloader on modern Samsung devices have some caveats. The newly
|
|||||||
- Use either [samfirm.js](https://github.com/jesec/samfirm.js), [Frija](https://forum.xda-developers.com/s10-plus/how-to/tool-frija-samsung-firmware-downloader-t3910594), or [Samloader](https://forum.xda-developers.com/s10-plus/how-to/tool-samloader-samfirm-frija-replacement-t4105929) to download the latest firmware zip of your device directly from Samsung servers.
|
- Use either [samfirm.js](https://github.com/jesec/samfirm.js), [Frija](https://forum.xda-developers.com/s10-plus/how-to/tool-frija-samsung-firmware-downloader-t3910594), or [Samloader](https://forum.xda-developers.com/s10-plus/how-to/tool-samloader-samfirm-frija-replacement-t4105929) to download the latest firmware zip of your device directly from Samsung servers.
|
||||||
- Unzip the firmware and copy the `AP` tar file to your device. It is normally named as `AP_[device_model_sw_ver].tar.md5`
|
- Unzip the firmware and copy the `AP` tar file to your device. It is normally named as `AP_[device_model_sw_ver].tar.md5`
|
||||||
- Press the **Install** button in the Magisk card
|
- Press the **Install** button in the Magisk card
|
||||||
- If your device does **NOT** have boot ramdisk, make sure **"Recovery Mode"** is checked in options.<br>In most cases it should already be automatically checked.
|
- If you are patching a recovery image, check the **"Recovery Mode"** option
|
||||||
- Choose **"Select and Patch a File"** in method, and select the `AP` tar file
|
- Choose **"Select and Patch a File"** in method, and select the `AP` tar file
|
||||||
- The Magisk app will patch the whole firmware file to `[Internal Storage]/Download/magisk_patched_[random_strings].tar`
|
- The Magisk app will patch the whole firmware file to `[Internal Storage]/Download/magisk_patched_[random_strings].tar`
|
||||||
- Copy the patched tar file to your PC with ADB:<br>
|
- Start the installation, and copy the patched tar file to your PC using ADB:<br>
|
||||||
`adb pull /sdcard/Download/magisk_patched_[random_strings].tar`<br>
|
`adb pull /sdcard/Download/magisk_patched_[random_strings].tar`<br>
|
||||||
**DO NOT USE MTP** as it is known to corrupt large files.
|
**DO NOT USE MTP** as it is known to corrupt large files.
|
||||||
- Reboot to download mode. Open Odin on your PC, and flash `magisk_patched.tar` as `AP`, together with `BL`, `CP`, and `CSC` (**NOT** `HOME_CSC` because we want to **wipe data**) from the original firmware. This could take a while (>10 mins).
|
- Reboot to download mode. Open Odin on your PC, and flash `magisk_patched.tar` as `AP`, together with `BL`, `CP`, and `CSC` (**NOT** `HOME_CSC` because we want to **wipe data**) from the original firmware.
|
||||||
- Your device should reboot automatically once Odin finished flashing. Agree to do a factory reset if asked.
|
- Your device should reboot automatically once Odin finished flashing. Agree to do a factory reset if asked.
|
||||||
- If your device does **NOT** have boot ramdisk, reboot to recovery now to enable Magisk (reason stated in [Magisk in Recovery](#magisk-in-recovery)).
|
- If your device does **NOT** have boot ramdisk, reboot to recovery now to enable Magisk (reason stated in [Magisk in Recovery](#magisk-in-recovery)).
|
||||||
- Install the latest Magisk app and launch the app. It should show a dialog asking for additional setup. Let it do its job and the app will automatically reboot your device.
|
- Install the Magisk app you've downloaded and launch the app. It should show a dialog asking for additional setup.
|
||||||
- Voila! Enjoy Magisk 😃
|
- Let the app do its job and automatically reboot the device. Voila!
|
||||||
|
|
||||||
### Upgrading the OS
|
### Upgrading the OS
|
||||||
|
|
||||||
Once you have rooted your Samsung device, you can no longer upgrade your Android OS through OTA. To upgrade your device's OS, you have to manually download the new firmware zip file and go through the same `AP` patching process written in the previous section. **The only difference here is in the Odin flashing step: we do NOT use the `CSC` tar, but the `HOME_CSC` tar instead as we are performing an upgrade, not the initial install**.
|
Once you have rooted your Samsung device, you can no longer upgrade your Android OS through OTA. To upgrade your device's OS, you have to manually download the new firmware zip file and go through the same `AP` patching process written in the previous section. **The only difference here is in the Odin flashing step: do NOT use the `CSC` tar, but the `HOME_CSC` tar instead as we are performing an upgrade, not the initial install**.
|
||||||
|
|
||||||
### Important Notes
|
### Important Notes
|
||||||
|
|
||||||
- **Never, ever** try to restore either `boot` or `recovery` partitions back to stock! You can brick your device by doing so, and the only way to recover from this is to do a full Odin restore with data wipe.
|
- **Never, ever** try to restore either `boot`, `recovery`, or `vbmeta` partitions back to stock! You can brick your device by doing so, and the only way to recover from this is to do a full Odin restore with data wipe.
|
||||||
- To upgrade your device with a new firmware, **NEVER** directly use the stock `AP` tar file with reasons mentioned above. **Always** patch `AP` in the Magisk app and use that instead.
|
- To upgrade your device with a new firmware, **NEVER** directly use the stock `AP` tar file with reasons mentioned above. **Always** patch `AP` in the Magisk app and use that instead.
|
||||||
- Never just flash only `AP`, or else Odin may shrink your `/data` filesystem size. Flash `AP` + `BL` + `CP` + `HOME_CSC` when upgrading.
|
- Never just flash only `AP`, or else Odin may shrink your `/data` filesystem size. Flash `AP` + `BL` + `CP` + `HOME_CSC` when upgrading.
|
||||||
|
|
||||||
@ -119,11 +129,11 @@ Once you have rooted your Samsung device, you can no longer upgrade your Android
|
|||||||
|
|
||||||
> **This installation method is deprecated and is maintained with minimum effort. YOU HAVE BEEN WARNED!**
|
> **This installation method is deprecated and is maintained with minimum effort. YOU HAVE BEEN WARNED!**
|
||||||
|
|
||||||
It is very difficult to accurately detect the device's information in custom recovery environments. Due to this reason, installing Magisk through custom recoveries on modern devices is no longer recommended. If you face any issues, please use the [Patch Image](#patching-images) method as it is guaranteed to work 100% of the time.
|
Installing using custom recoveries is only possible if your device has boot ramdisk. Installing Magisk through custom recoveries on modern devices is no longer recommended. If you face any issues, please use the proper [Patch Image](#patching-images) method.
|
||||||
|
|
||||||
- Download the Magisk APK
|
- Download the Magisk APK
|
||||||
- Rename the `.apk` file extension to `.zip`, for example: `Magisk-v22.0.apk` → `Magisk-v22.0.zip`. If you have trouble renaming the file extension (like on Windows), use a file manager on Android or the one included in TWRP to rename the file.
|
- Rename the `.apk` file extension to `.zip`, for example: `Magisk-v24.0.apk` → `Magisk-v24.0.zip`. If you have trouble renaming the file extension (like on Windows), use a file manager on Android or the one included in TWRP to rename the file.
|
||||||
- Flash the zip just like any other ordinary flashable zip.
|
- Flash the zip just like any other ordinary flashable zip.
|
||||||
- Reboot and check whether the Magisk app is installed. If it isn't installed automatically, manually install the APK.
|
- Reboot and check whether the Magisk app is installed. If it isn't installed automatically, manually install the APK.
|
||||||
|
|
||||||
> Warning: the `sepolicy.rule` file of modules may be stored in the `cache` partition. DO NOT MANUALLY WIPE THE `CACHE` PARTITION.
|
> Warning: the `sepolicy.rule` file of modules may be stored in the `cache` partition. DO NOT WIPE THE `CACHE` PARTITION.
|
||||||
|
Loading…
Reference in New Issue
Block a user