Related
*****Keep in mind that I or XDA or anyone else is not responsible for what happens to your device make sure you have a nandroid backup before proceeding
This is based on my personal experience I'm not a Dev
How to enable systemless root on mediatek !!!!
Step 1:
Get the booting of your phone via readback using spflashtool or dumping the ROM IMG !!
Step 2:
Unpack the boot IMG using mkbootimg or carliv IMG kitchen or Android kitchen !!!
Step 3:
Open the ramdisk folder and open the init.rc using notepad++
Step 4
Goto the line
Code:
export PATH /sbin:/system/bin:/system/xbin:/vendor/bin
**The line may vary but it will look similar !!!
Add the path of your su file at the end
Like I was t to install it at my data partition so
Add
Code:
:/data/bin
At the end of the line and save !!
Then change the permissions of /data/bin to 644 else apps won't be able to read the path due to insuffient permission !!!
Then repack the boot.img
Flash the bootimg via sp flash tool of flashify or any other method
Step 6:
***note use the su binaries of your CPU only
Like I used arm 7 binaries for my device !!
To know your CPU type
Download terminal emulator or use adb shell and type cat /proc/cpuinfo
Now using adb push copy the su file to the /data/bin folder or make a flashable zip to do the same !!
If you can't push via adb try doing it in adb supported recovery !!!
You might need to create the bin folder manually
And don't forget to set the permission to 0755 and reboot !!
Plz let me know if it works !!!
And also let me know if it doesn't !!!!
I can't post the flashable zip because I'm still new !!!
Can you post some more info for this? What mtk chipset is it tested with? What android version? When you repack the kernel image, do you use android headers or mediatek headers?
AlexZap said:
Can you post some more info for this? What mtk chipset is it tested with? What android version? When you repack the kernel image, do you use android headers or mediatek headers?
Click to expand...
Click to collapse
Carliv Image Kitchen will repack the same way it was unpacked so you do not have to worry.
I also want more info for this because I'm not even finding the first link export .....
kirito9 said:
Carliv Image Kitchen will repack the same way it was unpacked so you do not have to worry.
I also want more info for this because I'm not even finding the first link export .....
Click to expand...
Click to collapse
the point is that the systemless installer is supposed to unpack and repack the kernel... and i dont know/dont think it can handle a mediatek header
AlexZap said:
the point is that the systemless installer is supposed to unpack and repack the kernel... and i dont know/dont think it can handle a mediatek header
Click to expand...
Click to collapse
Ohh, it could be that it doesn't support Mediatek because I tried a systemless SuperSU and it didn't boot the MT6580 device. I had to flash the boot.img to fix.
kirito9 said:
Ohh, it could be that it doesn't support Mediatek because I tried a systemless SuperSU and it didn't boot the MT6580 device. I had to flash the boot.img to fix.
Click to expand...
Click to collapse
There is no reason systemless root shouldn't work on mediatek phones other then the different kernel headers. The OP says he got it working, which is why I posted my questions to him... but he has failed to respond.
AlexZap said:
There is no reason systemless root shouldn't work on mediatek phones other then the different kernel headers. The OP says he got it working, which is why I posted my questions to him... but he has failed to respond.
Click to expand...
Click to collapse
There isn't? Strange, then why when I flashed the SuperSU systemless zip from here it didn't boot but when flashed the SuperSU from here it did but said in SuperSU app, couldn't find the su binary.
Maybe I should push "su" to xbin folder or bin? What are your thoughts?
kirito9 said:
There isn't? Strange, then why when I flashed the SuperSU systemless zip from here it didn't boot but when flashed the SuperSU from here it did but said in SuperSU app, couldn't find the su binary.
Maybe I should push "su" to xbin folder or bin? What are your thoughts?
Click to expand...
Click to collapse
I think you need to read some more on how and why systemless root works and what it is for.
Regular root, the summer you installed, puts a bunch of binaries in the /system partition on your android phone, and while giving you root, it breaks a lot of things because it modifies the stock image, something that android doesn't expect to ever change except for system upgrades.
Systemless root fixes this. It does nothing to the system partition. It creates a mountable image and stores it in the /data partition that contains the su binary and whatever else is needed for root. It then modifies the boot image (the ramdisk that is packed with the kernel) so that on boot, it mounts this su image inside the already mounted system partition. This keeps the system partition stock, but at the same time, gives you root. Things like safetynet are unbroken and you can run things like android pay that check for a modified system image.
In order to do its magic, the systemless root installer has to be able to unpack and repack the boot partition. If you have a mediatek phone, you have about an 80% chance that your boot image is different then the rest of the android world. Mediatek phones have their own header in their images like boot and recovery (except for some very new devices). I am 95% certain that the systemless root installer does not know anything about mediatek headers. So it may unpack something, but clobber the boot image on repack. The author of this thread purports to have it working. I ask how. Is he one of the 20 or so percent without a mediatek header? Or did he do something else
AlexZap said:
.................
Click to expand...
Click to collapse
Yeah lol, first time working with android 6.0 and this systemless root. I know that's what the systemless root does, that's why after flashing the MT6580 device that I have, it didn't boot. Don't think the systemless supports this MT6580 as it uses it's own MTK header and not the standard AOSP.
Seems like OP as disappeared from this thread.
Sorry I took so long to respond
AlexZap said:
There is no reason systemless root shouldn't work on mediatek phones other then the different kernel headers. The OP says he got it working, which is why I posted my questions to him... but he has failed to respond.
Click to expand...
Click to collapse
And yes I got the systemless root working on my Panasonic T41 running CM 12
The SuperSU installer doesn't work on mediatek 'coz in cannot unpack the boot.img with mtk headers so i did it manually but SuperSU tried to fix the placement of the binaries !!
So i used another superuser !!
uttarayan21 said:
And yes I got the systemless root working on my Panasonic T41 running CM 12
The SuperSU installer doesn't work on mediatek 'coz in cannot unpack the boot.img with mtk headers so i did it manually but SuperSU tried to fix the placement of the binaries !!
So i used another superuser !!
Click to expand...
Click to collapse
I have found that magisk works flawlessly on my Jiayu s3... it uses hybrid headers in the images... but magical does the unpack/repack just fine.
Sent from my KFTHWI using XDA Premium 4 mobile app
AlexZap said:
I have found that magisk works flawlessly on my Jiayu s3... it uses hybrid headers in the images... but magical does the unpack/repack just fine.
Click to expand...
Click to collapse
Well but in my case when i tried it on CM 12.1 mtk6582
The phone got bricked !!
The SuperSU installer couldn't even get the boot image from my phone !! :crying: so i tried to modify the installer script with other tools but it was waaaay too complex for me so tried to do this instead with another superuser and it worked !!
I also had to modify the init.rc to start the daemonsu service !!! :good:
uttarayan21 said:
Well but in my case when i tried it on CM 12.1 mtk6582
The phone got bricked !!
The SuperSU installer couldn't even get the boot image from my phone !! :crying: so i tried to modify the installer script with other tools but it was waaaay too complex for me so tried to do this instead with another superuser and it worked !!
I also had to modify the init.rc to start the daemonsu service !!! :good:
Click to expand...
Click to collapse
I think magisk is better at handling boot image formats.
AlexZap said:
I think magisk is better at handling boot image formats.
Click to expand...
Click to collapse
I agree with @AlexZap and i am using it and it is working perfectly
Sent from my Z14 using Tapatalk
Does this work for the newer chipsets? I tried on Android 6.0 / MT6750, but I dont see the path export anywhere in the boot image (grep -nrw 'boot.img-ramdisk' -e "PATH")
MalikDrako said:
Does this work for the newer chipsets? I tried on Android 6.0 / MT6750, but I dont see the path export anywhere in the boot image (grep -nrw 'boot.img-ramdisk' -e "PATH")
Click to expand...
Click to collapse
magisk works flawlessly. no need to muck around, just flash it from twrp
Sent from my KFGIWI using XDA Premium 4 mobile app
AlexZap said:
magisk works flawlessly. no need to muck around, just flash it from twrp
Click to expand...
Click to collapse
I've been having trouble getting TWRP to run on this phone (black screen for a few seconds then it reboots into android), although I just discovered an unmodified repacked boot image wont boot, so either the phone is doing some verification that is failing or the tool I used cant repack it right
MalikDrako said:
I've been having trouble getting TWRP to run on this phone (black screen for a few seconds then it reboots into android), although I just discovered an unmodified repacked boot image wont boot, so either the phone is doing some verification that is failing or the tool I used cant repack it right
Click to expand...
Click to collapse
any chance the boot loader is locked? usually flashing a bad image will brick your phone if the boot loader is locked, but you never know.
have you tried unpacking the boot image with carliv's image kitchen? it throws out a bunch of info on how the image is made. as long as it is repacked the same way (Carliv's tool does this automatically), it should work fine. unless whoever your phone manufacturer is somehow included another signature check... which is really really out of the ordinary.
AlexZap said:
any chance the boot loader is locked? usually flashing a bad image will brick your phone if the boot loader is locked, but you never know.
have you tried unpacking the boot image with carliv's image kitchen? it throws out a bunch of info on how the image is made. as long as it is repacked the same way (Carliv's tool does this automatically), it should work fine. unless whoever your phone manufacturer is somehow included another signature check... which is really really out of the ordinary.
Click to expand...
Click to collapse
I just tried Carliv's image kitchen, and both boot and twrp port worked first try
How to change Permissions?
i could not understand it
can u help me Please?
*UPDATED TO WORK WITH S244
*I can confirm this is working with the latest version of Magisk (v16.0)
you may not need to execute the script so install the SafetyNetFix first and test.
Hope all goes well, instructions below:
Install TWRP
Follow instructions on this Forum, easy to find.
Convert System from f2fs to ext4
System-less SU does not work on f2fs so you will need to reformat System to ext4,
In TWRP go to:
Wipe > Advanced Wipe.
Check System and Click 'Repair or Change File System' > Change File System > Select EXT4
You'll need to reinstall your firmware after you have formatted. (P2a42_S233/S244 Supports System in ext4 by default)
I would go for a clean install but you could try without wiping.
Run UnSU
Download UnSu here
Run UnSU in Recovery, this may mean you can miss the next step, try with or without (flashing boot image)
Flash original boot.img
This is only if you have tried rooting before (and System is already set to ext4) but failed safety checks, skip if not
Can be found on this forum in the Deodexed_P2a42_S233_170404_ROW.zip or Deodexed_P2a42_S244_170725_ROW.zip
(as long as you are on this firmware of course.)
Download Magisk v16.0
Click here to download latest Magisk
Install using TWRP, this will also install MagiskSU
Reboot, download and install MagiskManager.apk
Turn on Magisk Hide, Systemless Hosts
Hide Google Services Framework and Google Play Store
(I don't think this is necessary but no harm in doing so)
Download Kernel Adiutor from PlayStore
Could also run this in Terminal Emulator but with Kernel Adiutor the script is saved to run again if necessary
Click top left Menu, scroll down to: init.d (don't swipe to activate) Click + for new script and paste:
Code:
#!/system/bin/sh
echo "deleting magisk properties"
resetprop --delete init.svc.magisk_pfs
resetprop --delete init.svc.magisk_pfsd
resetprop --delete init.svc.magisk_service
resetprop --delete persist.magisk.hide
resetprop --delete ro.magisk.disable
resetprop --delete magisk.version
resetprop --delete persist.magisk.busybox
resetprop --delete persist.magisk.hide
Save then click and execute the script.
Install Safety net fix
(This may not be necessary, so reboot and check if you pass before installing this, if you do then no worries, you're good to go!)
Download and install the stable version from here
Install using Magisk Manager
Reboot phone and Open MagiskManager
Check that Safety Net Passes
Some apps may have detected your rooted phone prior to this and blacklisted your device ID
I recommend trying the app Device ID Changer
find here
Thanks to:
Magisk, TWRP, This thread for script and every contributor and developer for the Lenovo P2
Videophile said:
So this is how I was successful, I started with installing v13.1 and updating to v13.3
but you may have success directly installing v13.3.
Hope all goes well, instructions below:
Install TWRP
Follow instructions on this Forum, easy to find.
Convert System from f2fs to ext4
System-less SU does not work on f2fs so you will need to reformat System to ext4,
In TWRP go to:
Wipe > Advanced Wipe.
Check System and Click 'Repair or Change File System' > Change File System > Select EXT4
You'll need to reinstall your firmware after you have formatted. (P2a42_S233 Supports System in ext4 by default)
I would go for a clean install but you could try without wiping.
Flash original boot.img
This is only if you have tried rooting before (and System is already set to ext4) but failed safety checks, skip if not
Can be found on this forum in the Deodexed_P2a42_S233_170404_ROW.zip
(as long as you are on this firmware of course.)
Download Magisk v13.1
Install using TWRP, this will also install MagiskSU
Reboot, download and install MagiskManager.apk
Turn on Magisk Hide, Systemless Hosts
Hide Google Services Framework and Google Play Store
(I don't think this is necessary but no harm in doing so)
Download Kernel Adiutor from PlayStore
Click top left Menu, scroll down to: init.d (don't swipe to activate) Click + for new script and paste:
Code:
#!/system/bin/sh
echo "deleting magisk properties"
resetprop --delete init.svc.magisk_pfs
resetprop --delete init.svc.magisk_pfsd
resetprop --delete init.svc.magisk_service
resetprop --delete persist.magisk.hide
resetprop --delete ro.magisk.disable
resetprop --delete magisk.version
resetprop --delete persist.magisk.busybox
resetprop --delete persist.magisk.hide
Save then click and execute the script.
Reboot phone and Open MagiskManager
Check that Safety Net Passes
Update Magisk to v13.3
Update inside the Magisk Manager and reboot phone
Thanks to:
Magisk, TWRP, This thread for script and every contributor and developer for the Lenovo P2
Click to expand...
Click to collapse
I actually did not understand thid line -
You'll need to reinstall your firmware after you have formatted.
Why do i need to reinstall it after formation. After changing to ext4 cant i just boot the mobile. . And then root it with magisk. ? ??
If you format the system they'll be nothing there, hence why you'll have to reinstall firmware, or at the very least reinstall system. It will be blank after formatting.
Videophile said:
If you format the system they'll be nothing there, hence why you'll have to reinstall firmware, or at the very least reinstall system. It will be blank after formatting.
Click to expand...
Click to collapse
What if i dont format the system. Then??? Just wipe cache. Internal sd n data.
Well, as Systemless Su relies on your system being formatted as ext4 you would need to format, unless your System is already ext4 then as I stated in instructions you can skip that step. If your system is f2fs then you will need to format it to ext4 thus clearing it which will mean you will have to reinstall system to the newly formatted ext4 partition. I believe you could flash the system.img just as you would have done with the boot.img
Finally got this to work. Completely passes safetynet. Note: Do not install update from the app, it will cause bootloop. Download version 13.3 separately and then flash it using twrp. I also used lenovo p2 sefetynet fix magisk module along with the script above.
Uibon said:
Finally got this to work. Completely passes safetynet. Note: Do not install update from the app, it will cause bootloop. Download version 13.3 separately and then flash it using twrp. I also used lenovo p2 sefetynet fix magisk module along with the script above.
Click to expand...
Click to collapse
I know someone on this forum made changes that allowed them to update directly through the Magisk Manager.
Anyway, I have given up on Magisk. Modules that fails to install causing the Manager to crash, incompatibility with previous modules, difficulties upgrading to newer versions, official versions becoming as unreliable as betas, Google being a pain in the ass with frequent SN updates etc.
Can the files needed for this to work be added to the first post? Just to be sure it's been done right
Download Kernel Adiutor from PlayStore: is this really needed ?
robuser007 said:
Download Kernel Adiutor from PlayStore: is this really needed ?
Click to expand...
Click to collapse
It makes it easier to run the script but feel free to use an alternate script executor if you wish.
test passed on RR 5.8.2 but with "universal safetynet fix" MODULE................
I tried to install Magisk again (stock rom) just for the fun of it. Turned out I didn't need the safetynet fix...
eried1 said:
I tried to install Magisk again (stock rom) just for the fun of it. Turned out I didn't need the safetynet fix...
Click to expand...
Click to collapse
An easier guide: boot from twrp: backup all and safe it on your computer, convert only data partition to ext4(not the system partition!), reboot recovery and install magisk frop twrp: done!
Use magiskhide to hide root/bootloader.
If I rethink: is it really needed to convert data partition to ext4?
robuser007 said:
If I rethink: is it really needed to convert data partition to ext4?
Click to expand...
Click to collapse
I know you had to do it in the past. It's possible it isn't required any longer.
For magisk you still need to convert /data to ext
Will formatting from f2fs to ext4 result in lower performance of the internal partition?
will i be able to pass safetynet after installing xposed????
mdvamik said:
will i be able to pass safetynet after installing xposed????
Click to expand...
Click to collapse
No
---------- Post added at 03:52 PM ---------- Previous post was at 03:52 PM ----------
robuser007 said:
For magisk you still need to convert /data to ext
Click to expand...
Click to collapse
Yes
s251 ??
I'm on S251 now, can I still install magisk v.13.3 + root? Thanks in advance
nerofox said:
I'm on S251 now, can I still install magisk v.13.3 + root? Thanks in advance
Click to expand...
Click to collapse
You can, just flash the s244 boot image.
I have a Google Pixel 3a (Google Store), bootloader unlocked, been on Magisk Canary since I got it. When I updated to Android 10, one of the modules I had installed (Miracast enabler) was/is not compatible and caused a bootloop (I know, I'm stupid). Flashing the stock boot.img of course solves the problem because root is gone. This is an A/B boot device an 10 so:
- TWRP cannot decrypt /data which means I cannot access /data/cache
- No access to /data/cache means I cannot add the 'disable_magisk' file to boot Core Only mode
- No data/cache access also means I cannot simply delete the module/s
- Magisk through TWRP command prompt or adb are useless because, again, I cannot access /data/cache
The only possible solution I can think of is to modify my boot.img to boot Magisk in Core Only mode so I can remove the module, then flash a proper modified boot.img to regain full Magisk capability. I have poured over online documentation and cannot seem to find the answer on how, if possible, I can do this. Magisk's own documentation seems to suggest the only solution is to wipe /data.
Is there any way I can modify a boot.img to boot Magisk in Core Only mode always? Thank you!
MichRT said:
I have a Google Pixel 3a (Google Store), bootloader unlocked, been on Magisk Canary since I got it. When I updated to Android 10, one of the modules I had installed (Miracast enabler) was/is not compatible and caused a bootloop (I know, I'm stupid). Flashing the stock boot.img of course solves the problem because root is gone. This is an A/B boot device an 10 so:
- TWRP cannot decrypt /data which means I cannot access /data/cache
- No access to /data/cache means I cannot add the 'disable_magisk' file to boot Core Only mode
- No data/cache access also means I cannot simply delete the module/s
- Magisk through TWRP command prompt or adb are useless because, again, I cannot access /data/cache
The only possible solution I can think of is to modify my boot.img to boot Magisk in Core Only mode so I can remove the module, then flash a proper modified boot.img to regain full Magisk capability. I have poured over online documentation and cannot seem to find the answer on how, if possible, I can do this. Magisk's own documentation seems to suggest the only solution is to wipe /data.
Is there any way I can modify a boot.img to boot Magisk in Core Only mode always? Thank you!
Click to expand...
Click to collapse
Here you go :
https://forum.xda-developers.com/showpost.php?p=80190577&postcount=554
Since then there was also a patch to magisk to resolve this kind of issue.
While you can't boot you can still use "magisk --remove-modules" through adb shell (or twrp I guess), which will automatically remove all your modules next time you boot.
reyqn said:
Since then there was also a patch to magisk to resolve this kind of issue.
While you can't boot you can still use "magisk --remove-modules" through adb shell (or twrp I guess), which will automatically remove all your modules next time you boot.
Click to expand...
Click to collapse
You have to use last magisk (above 19.4 if my memories are right).
HpNoTiQ said:
Here you go :
https://forum.xda-developers.com/showpost.php?p=80190577&postcount=554
Click to expand...
Click to collapse
This looks like it might work, so thank you! I found a similar, though different solution (below)
reyqn said:
Since then there was also a patch to magisk to resolve this kind of issue.
While you can't boot you can still use "magisk --remove-modules" through adb shell (or twrp I guess), which will automatically remove all your modules next time you boot.
Click to expand...
Click to collapse
I ran into the issue that while boot-looping with a magisk patched boot img, I wasn't able to run the command, adb wasn't finding the phone. I tried again after booting TWRP and it basically threw an 'error - command not found'.
HpNoTiQ said:
You have to use last magisk (above 19.4 if my memories are right).
Click to expand...
Click to collapse
I think you are right, in beta/canary channel
@Tulsadiver gave me a hand with this, see here: https://forum.xda-developers.com/showpost.php?p=80398385&postcount=35997
Thank you guys!
Tools needed: boot.img extractor. I recommend the one created by osm0sis from this thread:
https://forum.xda-developers.com/showthread.php?t=2073775
The first method was developed by osm0sis and removes magisk and all modules.
1. Unpack magisk_patched.img
2. Unzip overlay.dremove1.zip and place overlay.d folder in ramdisk folder.
3. Repack IMG
4. fastboot boot image-new.img created by repacking 8mg
This method is an offshoot of osm0sis version but boots core-only mode. Afterwards, remove the .disable-magisk file from the /cache folder for modules to work. Dot files are hidden files so if your root explorer can't see hidden files, run the "Remove disable_magisk" bat file in ADB.
1. Same as above but use the overlay.dcoreonly1.zip
For both methods you must be rooted for it to work. These are not cure all's for all bootloops.
Remove .disable_magisk bat file
https://www.androidfilehost.com/?fid=4349826312261684994
****************************************
Here is a fastboot bootable image to boot you into Magisk core-only mode, in case you bootloop due to flashing a bad module, in fastboot:
You will boot with root but modules disabled. After you remove the offending module you will need to go to /cache folder and delete the .disable_magisk file before your modules will work.
Once in fastboot:
fastboot boot image-newpixel3axl.img
You will boot with root but modules disabled. After you remove the offending module you will need to go to /cache folder and delete the .disable_magisk file before your modules will work.
fastboot boot image-newpixel3axlRemove.img
This one should remove magisk and all modules, then reboot and magisk should reinstall itself (ask to install necessary binaries). This is what osm0sis uses to recover from failed flashes. See this post:
https://forum.xda-developers.com/pi...odules-disabler-booting-magisk-t3976625/page2
Images are in this common folder. Pick the appropriate image for your phone.
6-4-20
https://www.androidfilehost.com/?w=files&flid=313291
Ohboy this is helpful. Just out of curiosity, how does one create a magisk patched boot image with core-only mode enabled? I would like to be able to make my own every time a new security patch is out.
Sent from my Google Pixel 3a XL using XDA Labs
Skittles9823 said:
Ohboy this is helpful. Just out of curiosity, how does one create a magisk patched boot image with core-only mode enabled? I would like to be able to make my own every time a new security patch is out.
Sent from my Google Pixel 3a XL using XDA Labs
Click to expand...
Click to collapse
I had planned on keeping these updated but here are the instructions.
You have to build your own copy of magisk from GitHub.
Clone magisk
Go to native/jni/core folder and edit the boot stages.cpp file in notepad++ like this:
Approx line 667
If (access(DISABLEFILE, F_ok) ==0)
Change == to !=
Now build magisk as per instructions on GitHub
One you have built it and there were no errors go to native/out/armeb-v7a folder and get a copy of the magiskini64 file.
Unpack your magisk_patched.img
In the ramdisk folder replace the init file with the .magiskini64 file (rename to init)
Repack your magisk_patched.img
The results are a patched IMG that will boot core only mode.
Tulsadiver said:
I had planned on keeping these updated but here are the instructions.
You have to build your own copy of magisk from GitHub.
Clone magisk
Go to native/jni/core folder and edit the boot stages.cpp file in notepad++ like this:
Approx line 667
If (access(DISABLEFILE, F_ok) ==0)
Change == to !=
Now build magisk as per instructions on GitHub
One you have built it and there were no errors go to native/out/armeb-v7a folder and get a copy of the magiskini64 file.
Unpack your magisk_patched.img
In the ramdisk folder replace the init file with the .magiskini64 file (rename to init)
Repack your magisk_patched.img
The results are a patched IMG that will boot core only mode.
Click to expand...
Click to collapse
Nice. Seems easy enough, if you ever disappear and stop updating images for some reason I'll give it a go ?
Sent from my Google Pixel 3a XL using XDA Labs
Hello
I have regular 3a with Android 10 installed, no twrp. I was in bootloop due to some module and was looking for solution to disable modules with only fastboot.
Before I found this thread, I went and reflash to stock.
Now I know.
Thanks for sharing this.
Tulsadiver said:
I had planned on keeping these updated but here are the instructions.
You have to build your own copy of magisk from GitHub.
Clone magisk
Go to native/jni/core folder and edit the boot stages.cpp file in notepad++ like this:
Approx line 667
If (access(DISABLEFILE, F_ok) ==0)
Change == to !=
Now build magisk as per instructions on GitHub
One you have built it and there were no errors go to native/out/armeb-v7a folder and get a copy of the magiskini64 file.
Unpack your magisk_patched.img
In the ramdisk folder replace the init file with the .magiskini64 file (rename to init)
Repack your magisk_patched.img
The results are a patched IMG that will boot core only mode.
Click to expand...
Click to collapse
I tried to do this for a Pixel 4 XL but the resulting boot image errors with "error boot prepare"
gudenau said:
I tried to do this for a Pixel 4 XL but the resulting boot image errors with "error boot prepare"
Click to expand...
Click to collapse
I have these already made for the pixel 4 xl on the pixel 4 xl forum.
Should just make an AK3 zip that pushes the init from this boot.img into any boot partition, so will work universally.
osm0sis said:
Should just make an AK3 zip that pushes the init from this boot.img into any boot partition, so will work universally.
Click to expand...
Click to collapse
Ooft.
Wait, can you flash that through adb though?
Sent from my Google Pixel 3a XL using XDA Labs
Skittles9823 said:
Ooft.
Wait, can you flash that through adb though?
Click to expand...
Click to collapse
Hmm.. true, non-working recovery is a definite problem. I'm in that boat right now on my OnePlus 7T, which is how I came across this thread.
Okay, better idea. Instead of mucking around with recompiling magiskinit for the above, just do it via boot script in overlay.d
osm0sis said:
Hmm.. true, non-working recovery is a definite problem. I'm in that boat right now on my OnePlus 7T, which is how I came across this thread.
Okay, better idea. Instead of mucking around with recompiling magiskinit for the above, just do it via boot script in overlay.d
Click to expand...
Click to collapse
Tbh, a custom boot.img is the only way to recover in some situations. Like if you can't boot into an adb environment or if you've never granted adb she'll root access.
Sent from my Google Pixel 3a XL using XDA Labs
Skittles9823 said:
Tbh, a custom boot.img is the only way to recover in some situations. Like if you can't boot into an adb environment or if you've never granted adb she'll root access.
Click to expand...
Click to collapse
Exactly, so a custom boot.img using overlay.d is the easiest way to accomplish that currently.
osm0sis said:
Exactly, so a custom boot.img using overlay.d is the easiest way to accomplish that currently.
Click to expand...
Click to collapse
How would one do that exactly without being able to use adb shell?
Sent from my Google Pixel 3a XL using XDA Labs
Skittles9823 said:
How would one do that exactly without being able to use adb shell?
Click to expand...
Click to collapse
overlay.d is built into the boot.img, so you take your latest magisk_patched.img, patch it with the overlay.d scripts to have the desired effect, then repack and flash via fastboot.
Same as the OP likely did, but no need to build Magisk to get a modified magiskinit, since you can do it all via boot script, like I said.
If anyone wants to experiment with this idea, here's the basic setup I used for my boot.img to fully reset the /data/adb directory for the soft brick issue (related to a magisk.db failure) I was seeing in the last canary.
Unpack the current magisk_patched.img for your device using my Android Image Kitchen (AIK) project, then create:
ramdisk/overlay.d/init.resetmagisk.rc:
Code:
on post-fs-data
exec u:r:magisk:s0 root root -- /sbin/init.resetmagisk.sh
ramdisk/overlay.d/sbin/init.resetmagisk.sh:
Code:
#!/system/bin/sh
rm -rf /data/adb/* && reboot
So, pretty simple stuff, and I'm sure it could be applied to some sort of Core Only workaround until @topjohnwu decides what he wants to do with all those Core Only boot.img Pull Requests.
osm0sis said:
overlay.d is built into the boot.img, so you take your latest magisk_patched.img, patch it with the overlay.d scripts to have the desired effect, then repack and flash via fastboot.
Same as the OP likely did, but no need to build Magisk to get a modified magiskinit, since you can do it all via boot script, like I said.
Click to expand...
Click to collapse
Cool. What I did was modify the magisk native/jini/core/bootstages.cpp
Edit: yes sir, your method works great to remove magisk and all modules. The method I had gives you the option to just remove the offending module, though sometimes you have to remove everything anyway. Thank you for your awsome input. If it is okay with you, I'd like to offer both methods in my posts on the pixel forums.
Tulsadiver said:
Cool. What I did was modify the magisk native/jini/core/bootstages.cpp
Edit: yes sir, your method works great to remove magisk and all modules. The method I had gives you the option to just remove the offending module, though sometimes you have to remove everything anyway. Thank you for your awsome input. If it is okay with you, I'd like to offer both methods in my posts on the pixel forums.
Click to expand...
Click to collapse
Sure! You could modify my method to remove all modules by running `magisk --remove-modules` instead of my `rm -rf` command (or just changing the `rm -rf` target), or even try to force Core Only mode by changing the setting directly in magisk.db then rebooting. It's a root shell so pretty much sky's the limit.
osm0sis said:
Sure! You could modify my method to remove all modules by running `magisk --remove-modules` instead of my `rm -rf` command (or just changing the `rm -rf` target), or even try to force Core Only mode by changing the setting directly in magisk.db then rebooting. It's a root shell so pretty much sky's the limit.
Click to expand...
Click to collapse
I have tried multiple methods from this thread but with no success.. Could you maybe help me by altering this boot.img to disable/remove all Magisk modules? Or maybe make it boot core only? It's for my OP 7T. Thanks!
https://mega.nz/#F!rxYDyQia!ziPLPvRsu3kxNBGt694OEQ
paplo said:
I have tried multiple methods from this thread but with no success.. Could you maybe help me by altering this boot.img to disable/remove all Magisk modules? Or maybe make it boot core only? It's for my OP 7T. Thanks!
https://mega.nz/#F!rxYDyQia!ziPLPvRsu3kxNBGt694OEQ
Click to expand...
Click to collapse
If `adb shell magisk --remove-modules` didn't fix the issue for you then you might be in the same boat I was and need to nuke all of Magisk's files in /data/adb.
Getting off topic for a Pixel thread, but here's the OnePlus 7T (hotdogb) image I made following my own instructions.
It's with an older Canary of Magisk so once you get it booting you should update to the latest Canary immediately.
osm0sis said:
If `adb shell magisk --remove-modules` didn't fix the issue for you then you might be in the same boat I was and need to nuke all of Magisk's files in /data/adb.
Getting off topic for a Pixel thread, but here's the OnePlus 7T (hotdogb) image I made following my own instructions.
It's with an older Canary of Magisk so once you get it booting you should update to the latest Canary immediately.
Click to expand...
Click to collapse
Yeah off topic I know.. Just spotted you had been in the same pickle with the same phone as me. I worked like a charm! Thanks!
I am preparing to use this phone as a dedicated display on a custom embedded system. Changing the boot logo is a must. I have been playing around with it and reading threads for hours and no luck.
Rooted with the latest Magisk, TWRP, unlocked bootloader, the whole 9 yards. A10 Stock ROM. I don't care I break SafetyNet, just need this to work.
I can't put the new bootloader on the system partition because it's mounted as read only. Since it's A10, I haven't found a working way to modify it with TWRP or within the ROM. Has anyone been successful yet?
There are existing Magisk modules for boot animations, but I need a custom one, and I don't know how to make it into a flashable ZIP. How do they do this?
I also tried a Magisk module that is supposed to let you put the boot animation on /sdcard, and it gets overridden on boot by the module, but that did nothing. But it was on a OnePlus forum, so maybe incompatible.
Thanks!
i think you can mount system within twrp then use the twrp file manager to move it. if not, get a terminal emulator, su, mount system, mv file.xxx /system or whatever folder youre looking for