[Resolved][Q][Help]My own ROM can not bootup - Android Q&A, Help & Troubleshooting

[Resolved!]
1. there is no fonts directory in the system folder, resolve it by copying from other rom.
2. updater-script make a symlink from bash to sh, while there is no bash binary in my rom, so that adb shell doesn't work.
Hi, all,
My own rom can not bootup and hang at first screeen which only show 'HTC' boot logo. I don't know why and how to resolve this issue.
Target Model: HTC A310E with locked s-on
Origianl ROM: RUU_Pico_HTCCN_CHS_1.20.1400.7_Radio_10.34.80.09H_1.10.84.02_CHS_release_224342_signed.zip
I take the following steps:
1. unlock the target. (official unlock method)
2. flash CWM based recovery image (version: 5.x) via fastboot command.
3. copy boot_signed.img and system.img in the official ROM to ROM kitchen. (I changed the name of boot_signed.img to boot.img)
4. [Kitchen] unpack system.img
5. delete some third party apk under system/app
6. copy a updater-script from other ROM which works fine in my A310E and make slight changes.
7. [Kitchen] Build rom with default options.
8. double wipe and update my rom under recovery.
and then i encounter the bootup issue.
Please help give me some advice.
Thanks a lot!

Related

Custom ROM for new device

Hi, I have new Prestigio tablet PMT5777_3G and I want to modify it's default ROM. I followed this tutorial: http://forum.xda-developers.com/showthread.php?t=1801690. I successfully extracted system folder, but I have no idea how to create updater-script for this specific ROM. If I understand correctly I need to get updater-script from original ROM.
I've got something that resembles original ROM, but it's folder structure is completely different from what I would expect.
I would expect:
META-INF
system
boot.img
I've got:
APDB_MT6582_S01_MAIN2.1_W10.24
boot-sign.img
BPLGUInfoCustomAppSrcP_MT6582_S00_MOLY_WR8_W1315_MD_WG_MP_V12_P4_1_wg_n
cache-sign.img
Checksum.ini
EBR1-sign
lk-sign.bin
logo-sign.bin
MBR-sign
MT6582_Android_scatter.txt
preloader_htt82_tb_jb5.bin
recovery-sign.img
secro-sign.img
system-sign.img
sro-lock-sign.img
sro-unlock-sign.img
userdata-sign.img
I'm an android developer, but have no experience with custom ROM's and now am in a situation, where I want to get that custom ROM up and running, but am unable, because I can't figure out how to create updater-script or extract it from files that I currently have. It would be great if someone could point me to the right direction of what to do next.
Thanks
P. S. It seems it's against the rules to ask questions here, but I can't seem to find where else to ask this on xda
Dantenas said:
Hi, I have new Prestigio tablet PMT5777_3G and I want to modify it's default ROM. I followed this tutorial: http://forum.xda-developers.com/showthread.php?t=1801690. I successfully extracted system folder, but I have no idea how to create updater-script for this specific ROM. If I understand correctly I need to get updater-script from original ROM.
I've got something that resembles original ROM, but it's folder structure is completely different from what I would expect.
I would expect:
META-INF
system
boot.img
I've got:
APDB_MT6582_S01_MAIN2.1_W10.24
boot-sign.img
BPLGUInfoCustomAppSrcP_MT6582_S00_MOLY_WR8_W1315_MD_WG_MP_V12_P4_1_wg_n
cache-sign.img
Checksum.ini
EBR1-sign
lk-sign.bin
logo-sign.bin
MBR-sign
MT6582_Android_scatter.txt
preloader_htt82_tb_jb5.bin
recovery-sign.img
secro-sign.img
system-sign.img
sro-lock-sign.img
sro-unlock-sign.img
userdata-sign.img
I'm an android developer, but have no experience with custom ROM's and now am in a situation, where I want to get that custom ROM up and running, but am unable, because I can't figure out how to create updater-script or extract it from files that I currently have. It would be great if someone could point me to the right direction of what to do next.
Thanks
P. S. It seems it's against the rules to ask questions here, but I can't seem to find where else to ask this on xda
Click to expand...
Click to collapse
Since you are a beginner to ROM development, I would recommend the use of dsixda's Android kitchen, which you probably have downloaded already. If not use this link
http://forum.xda-developers.com/showthread.php?t=633246
Follow these steps to obtain the file structure and Meta-Inf folder for your custom rom.
1. Open the folder where you have placed the kitchen.
2. You will find a folder called original_update.
3. Open that folder and copy your boot.img and system.img files into it. ( In your case it is boot-sign.img and system-sign.img. Rename those files into boot.img and system.img and place them in the folder )
4. Now open the kitchen. ( Refer the above link to know how to do it )
5. You will find " 1. Set up working folder from ROM " option under Main Menu.
6. Type 1 and you will be directed to another menu. Click Enter.
7. Select your boot.img and system.img from the menu.
8. Now follow the instructions that appear on the screen.
9. When you successfully complete the steps, you will have the required Working folder, with boot.img, system folder and Meta-Inf folder, which will contain the updater-script (It will be automatically generated)
All the best. :good:
Hit Thanks if this helped you... PM me if you need further help or search the forum for detailed instructions.
Thanks, this helped me, but I still can't create ROM.
I encountered a problem with kitchen:
Code:
Available ROMs:
(1) system.img and boot.img
Enter selection number (default=1, cancel=0, r=refresh):
Found original_update/system.img
Found original_update/boot.img
The new working folder will be named WORKING_061614_070841
Change the name (y/n)? (default: n):
Creating working folder WORKING_061614_070841 ...
Copying boot.img ...
Copying system.img ...
Adding an update-script ...
NON-YAFFS/NON-TAR FILE FORMAT DETECTED IN ROM
Mounting system.img to loopback device and then extracting files ...
Error: Unable to mount system.img
Error: No /system/framework folder found!
Press Enter to continue
This creates my missing update-script and boot.img, but system folder is empty.
Would it be a good idea to extract all system files from device and attempt to create ROM with them, and this update-script, or is there something I could do with system.img to make it extract?
Try this
Don't worry. There's always an alternative. Try this simple method.
1. Boot into CWM (Clockwork Mod) Recovery. (I'm pretty sure you know how to do it, if not, you can feel free to search the forum)
2. Choose Backup and Restore.
3. Make a backup in your external sdcard.
4. Now boot normally, open your external sdcard. You will find a folder called clockworkmod. Copy that folder to your PC.
5. Inside that folder, you will find the backup.
6. Now, copy boot.img and system.ext4.tar.a to your original_update folder of the kitchen.
7. Warning! Do not copy system.ext4.tar, only copy system.ext4.tar.a
8. Once you have copied these two files, rename system.ext4.tar.a into system.ext4.tar
9. Now, open android kitchen and follow the exact same steps as you did before.
10. When you choose the available rom, you will find the screen as below.
Code:
Available Roms:
(1) system.ext4.tar and boot.img
11. Choose it and follow the instructions. You will have your required working folder.
Try this and let me know if you still face any issues. :good:
I was unable to load CWM recovery, because it is not supported by my device. I tried TWRP too, which also doesn't support my device. Is it possible to do without CWM?
Dantenas said:
I was unable to load CWM recovery, because it is not supported by my device. I tried TWRP too, which also doesn't support my device. Is it possible to do without CWM?
Click to expand...
Click to collapse
I'm sorry my friend, even if you create your own ROM, you require either one of them to flash the ROM to your device. Seeing you so keen on developing the rom, try to use any yaffs tool to create your system.img from extracted system folder. You may refer this thread.
http://forum.xda-developers.com/showthread.php?t=1645412

[Q] pulling boot.img for TWRP 2.7.0.0 touch recovery

Hello Friends,
I just registered to this forum.
It's awesome to read all of the thread inside this forum...
but my brain is limited to learn everything in no time.
Well, I found this thread.
The title is: [RECOVERY][XSOLA] TWRP 2.7.0.0 touch recovery [2014-04-27]
.....................................................
.....................................................
.....................................................
.....................................................
"Installation:
since our device developers are constantly trying to fix bugs, they are always changing something in init.*.rc files for testing. For this reason I can't post a regular boot.img file because it won't work. For now, I've created a script that will take all init.*.rc files from current rom's boot.img and then compile new boot.img with TWRP inside it.
Note : For Rooted & Unlocked Bootloader Only
Note : For 4.4 ROM (should work on older version of android upto 4.1). I don't own Xperia Sola so didn't test it. So please provide feedback
1) Download the latest zip file.
2) Extract it in a folder and place your current rom's boot.img inside that folder. (it must be named boot.img)
3) Connect your phone with PC. (adb must be working)
4) Open your command line and cd to that folder
5) For linux users, type ..........................."
Do you all know what must I do on "placing my current rom's boot.img"? I just can't find the file on my Xperia Sola device.
Please Help.
Thank You.
Boot.img is not a file on the XP. It is the image of the boot partition.
You can extract it from the zip of your ROM or from the ftf from Sony or from the CWM backup.
Sheers
adi10pn said:
place your current rom's boot.img
Click to expand...
Click to collapse
have u kept the .zip file of the ROM you are currently using? if so extract the files from it and you will find a file named "boot.img"
Press Thanks if I helped you

Please login here and help||Only one point I did not understand it

These steps to return the phone to stock rom with out os ???
Android 4.2.2, Sense 5, WWE. Completely stock - not rooted or deodexed.
TWRP backup: https://mega.co.nz/#!fIgjWLZR!bykF8X...yqdKsT7eytCJkE
The .ext3/4.win files are actually .tar.gz files so can be extracted with "tar xvzf <file>". data.ext3.win includes some preloaded APKs including Flashlight.
firmware.zip: https://mega.co.nz/#!PdgEQR7A!fSgCaC...O1ZhpfgmIp09_g
Installation instructions this will completely wipe your phone including the media (sdcard) partition! (thanks nsnobel):
1. Unlock bootloader
2. Install TWRP 2.6.3.0 (this backup can't be restored with 2.7.0.1)
3. Use TWRP to restore "2.18.401.2_stock_twrp"
4. Relock bootloader
5. Connect phone to computer via USB and open a command prompt/terminal in the directory which contains "firmware.zip" file
6. Reboot phone into bootloader
7. Issue following commands 2 times while on bootloader:
Code:
fastboot oem rebootRUU
fastboot flash zip firmware.zip
*************************************************
**The first step is something I did not understand them***
(((( The .ext3/4.win files are actually .tar.gz files so can be extracted with "tar xvzf <file>". data.ext3.win includes some preloaded APKs including Flashlight. ))
Is there an explanation of the points mentioned above. ???
and link for TWRP 2.6.3.0 <<< and how to install I don't have it
Please clarify possible. Or provide us with steps explained?
*****************************************************************
my device htc one x plus International
2.18.401.2
cid htc_j15
hboot 1.72.0000
s-on

[Q] ADB sideload how to install/update a specific file in a specific directory

Hello guys,
so i have messed up my ZenFone 5's booting configuration. good thing is, i know where i have messed up, unlike other noobs like myself. i have been modifying the adbon.sh file, where i added a conditional to check if a file(/dev/keycheck) exists and if it exists(will always return 'true'), to extract the contents of a recovery.tar(custom recovery). problem is, now i cannot boot normally into my device. if anyone can help me with three things, i'd be grateful.
1. How to modify the adbon.sh file using:
(a) preferred choice: using adb sideload <filename> ( i need to update THAT SPECIFIC FILE ONLY) ->(the file is in /system/bin/)
(b) secondary choice: using fastboot flash command. is it possible to update a single file using fastboot flash? (probably not, i think) should i have to flash the entire system partition with a stock/custom ROM? (i already know most about this, but a clear good guide can help me)(i know it will overwrite the total /system partition)
2. Give me a link to the original(stock) adbon.sh file if method 1(a) is possible.
3. Give me a compatible link to a CWM recovery for my device, ASUS_T00J (the recovery in my recovery.tar is a stock recovery, i got f**** fooled into downloading a stock one where i thought it was a custom CWM recovery)

[TOOL][riva] Appender for Redmi 5A

Bypass bootloader guide https://forum.xda-developers.com/xiaomi-redmi-5a/how-to/bypass-bootloader-lock-redmi-5ariva-t3772381 by dev @xaacnz.
A little bit of disclaimer......
Appender is for those who are currently using bypass bootloader hack above, so there is no need of manually appending blocks to boot image/recoevry image after every flash. Appender automatically appends the 4k bytes to boot image and recovery image.
NOTE: DO NOT QUOTE WHOLE POST OR I WILL IGNORE
Appender-v4 Download below
Changelog:
Appender-v4
*Fixed Appender on system-as-root boot images (Appender breaks GSI with system-as-root, don't use GSI)
*Improved overall code
Appender-v3
*Initial test version
Recommended twrp: Pitch black recovery
Link
Appender-v4.zip is for boot image
Appender-v4-rec.zip is for recovery image
Appender Usage
1. Flash rom
2. Flash magisk for root (skip if you don't need root)
3. Flash custom kernel (skip if you don't need custom kernel)
4. After that flash Appender-v4.zip
5. Reboot
Appender Recovery Version Usage
1. Flash recovery image
2. Flash Appender-v4-rec.zip
3. Reboot Recovery
CAUTION: Appender must be flashed EVERY time you modify boot image or recovery image.
And don't forget to press thanks if this tool has helped you
Reporting errors.
After flashing appender, send the file /cache/recovery/last_log if Appender didn't worked, and also metion the issue you are facing.
Credits and thanks
@osm0sis for Anykernel3
@xaacnz for bypass bl guide
steeldriver (stackexchange) for helping me with commands
busybox team
Old method
Note1: Even though no data is erased in this process it is recommended to take backup.
What this guide covers.
1. Rooting your device
2. Flashing custom kernel
All without need to unlock bootloader​
Well there are two ways with which you can do this
Requirements
For PC based method
1. Working twrp recovery (if you dont have twrp installed follow this guide)
2. Pc must have linux installed, if you have windows don't worry install WSL using this link
3. Android image kitchen for your respective OS.
4. Latest magisk zip from here
For Android only
1. Working twrp
2. Any hex editor(Note2) for android/windows (optional)
3. Latest Magisk manager app only (for root only)
4. Android Image kitchen- android, windows/linux (for custom kernel only)
Steps for PC based​1. Flash magisk zip or any kernel. Don't reboot system.
2. Go to backup senction in twrp and backup boot.
3. Connect your device to PC and look where you backed up boot and copy boot.emmc.win to Android image kitchen folder and rename to boot.img
4. Run unpackimg.sh or double click on unpackimg.bat. Then run repackimg.sh or double click on repackimg.bat. You will see image-new.img in the same folder
5. On windows hold Shift and right click in file manager with mouse, you will see open linux shell here, click it. OR if you have linux (specifically ubuntu) then right click and select open terminal here in Nautilus.
6. Run (to append 4k block, note that you can append block to any file specified by "of" parameter like of=twrp.img, of=boot.img etc)
Code:
printf 'x30x83x19x89x64' | dd of=image-new.img ibs=4096 conv=sync,notrunc oflag=append
7. Copy the image-new.img to your phone anywhere you prefer.
8. Flash image-new.img using twrp to boot partition.
9. Reboot
Steps for non-PC based (*outdated and some kernels won't work fully)​[/CENTER]
1. Extract boot.img from your currently installed rom and put it in internal storage of your phone (if you do not want to flash custom kernel skip to step 4)
*2. Download custom kernel you want to flash, extract zImage from the flashable kernel zip
*3. Unpack boot image using android image kitchen, in the split_img folder delete "boot.img-zImage" and put zImage you extracted in split_img folder and rename it to "boot.img-zImage"
*For custom kernel only
4. Install magisk manager apk on your phone
5. open magisk manager, you will see magisk is not installed select install (first one), a popup will appear telling to install magisk, select install, then select Patch a file, select the boot.img file that you extracted, then let magisk manager do the rest, after finishing the magisk-patched.img file will be stored in Downloads folder of your internal storage
6. Open the patched_boot.img in hex editor
7. To make the patched_boot.img to boot append(Note2) a 4k block which begins with 0x30, 0x83, 0x19, 0x89, 0x64 to patched_boot.img, and save the file
8. Boot into twrp and flash patched_boot.img
9. Done, reboot
Note2: On Linux you can use dd command to append
Code:
printf 'x30x83x19x89x64' | dd of=testfile ibs=4096 conv=sync,notrunc oflag=append
Note3: If you get error cannot mount twrp while flashing, use recommend twrp above
If you get error related to ramdisk compression, use Appender-v4 or above
XDA:DevDB Information
Appender for Redmi 5A (bypass bootloader), Tool/Utility for the Xiaomi Redmi 5A
Contributors
saurabh6377
Version Information
Status: Beta
Current Beta Version: 4
Beta Release Date: 2019-09-29
Created 2019-09-28
Last Updated 2019-09-29
Reserved
_saurabh__._ said:
As a followup to this guide https://forum.xda-developers.com/xiaomi-redmi-5a/how-to/bypass-bootloader-lock-redmi-5ariva-t3772381 by dev @xaacnz without him this guide might not be here, I am making this guide so you can root your device or flash any custom kernel without unlocking your device.
Code:
Your warranty will be void now
I am not responsible for anything wrong happens to your device
Note1: Even though no data is erased in this process it is recommended to take backup.
What this guide covers.
1. Rooting your device
2. Flashing custom kernel
All without need to unlock bootloader
Requirements
1. Working twrp recovery (if you dont have twrp installed follow this guide)
2. Any hex editor for android/linux/windows (yes you absolutely dont need a pc)
3. Latest Magisk manager app only (for root only)
4. Android Image kitchen- android, windows/linux (for custom kernel only)
Steps​1. Extract boot.img from your currently installed rom and put it in internal storage of your phone (if you do not want to flash custom kernel skip to step 4)
*2. Download custom kernel you want to flash, extract zImage from the flashable kernel zip
*3. Unpack boot image using android image kitchen, in the split_img folder delete "boot.img-zImage" and put zImage you extracted in split_img folder and rename it to "boot.img-zImage"
*For custom kernel only
4. Install magisk manager apk on your phone
5. open magisk manager, you will see magisk is not installed select install (first one), a popup will appear telling to install magisk, select install, then select Patch Boot Image File, select the boot.img file that you extracted, then let magisk manager do the rest, after finishing the patched_boot.img file will be stored in Downloads folder of your internal storage
6. Open the patched_boot.img in hex editor
7. To make the patched_boot.img to boot append a 4k block which begins with 0x30, 0x83, 0x19, 0x89, 0x64 to patched_boot.img, and save the file
8. Boot into twrp and flash patched_boot.img
9. Done, reboot
Note2: If you get error cannot mount twrp while flashing the image, use vendor twrp
Note3: If I get time I will later make a script that automates the process.
Click to expand...
Click to collapse
Thanks it worked but i didn't appended 4k block to patched_boot.img it worked without appending 4k block.
Sonu1123 said:
Thanks it worked but i didn't appended 4k block to patched_boot.img it worked without appending 4k block.
Click to expand...
Click to collapse
Let me verify this, I will update the guide once this is verified.
Sonu1123 said:
Thanks it worked but i didn't appended 4k block to patched_boot.img it worked without appending 4k block.
Click to expand...
Click to collapse
If you didn't append 4k block to patched_boot.img and you have locked bootloader then flashing magisk directly from twrp must work also because both processes are same. And likewise you can also flash custom kernel directly using twrp without extracting boot.img. In my case I have to append 4k block to patched_boot.img for system to boot.
_saurabh__._ said:
If you didn't append 4k block to patched_boot.img and you have locked bootloader then flashing magisk directly from twrp must work also because both processes are same. And likewise you can also flash custom kernel directly using twrp without extracting boot.img. In my case I have to append 4k block to patched_boot.img for system to boot.
Click to expand...
Click to collapse
I don't know how it worked but when i tried it again system crashed then i appended 4k block to patched_boot.img to get magisk intalled.
I have one more question what about xposed for pixel experience rom for riva and can i flash it directly without modifying it.
Edit:I am on pixel experience latest android pie version.
Sonu1123 said:
I don't know how it worked but when i tried it again system crashed then i appended 4k block to patched_boot.img to get magisk intalled.
I have one more question what about xposed for pixel experience rom for riva and can i flash it directly without modifying it.
Edit:I am on pixel experience latest android pie version.
Click to expand...
Click to collapse
Yes you can install xposed. Simple rule of thumb is that you can flash anything that does not touch boot image and xposed doesn't it only writes to /system partition so no issues.
Xposed is not available for pie yet, but the unofficial EdXposed magisk module was tested by me and it works good on pixel experience.
Kindly ask you to upload some zip file to your OP, containing following files:
- tmp\hack_splash.xml
- tmp\prog_emmc_firehose_8917_ddr.mbn
- tmp\recovery.img
- tmp\splash.img
- tmp\twrp.xml
- fh_loader.exe
- QSaharaServer.exe
- a text file containing steps 9-11 and link to xaacnz thread (for credits)
_saurabh__._ said:
As a followup to this guide https://forum.xda-developers.com/xiaomi-redmi-5a/how-to/bypass-bootloader-lock-redmi-5ariva-t3772381 by dev @xaacnz without him this guide might not be here, I am making this guide so you can root your device or flash any custom kernel without unlocking your device.
Code:
Your warranty will be void now
I am not responsible for anything wrong happens to your device
Note1: Even though no data is erased in this process it is recommended to take backup.
What this guide covers.
1. Rooting your device
2. Flashing custom kernel
All without need to unlock bootloader
Requirements
1. Working twrp recovery (if you dont have twrp installed follow this guide)
2. Any hex editor(Note2) for android/windows (yes you absolutely dont need a pc)
3. Latest Magisk manager app only (for root only)
4. Android Image kitchen- android, windows/linux (for custom kernel only)
Steps​1. Extract boot.img from your currently installed rom and put it in internal storage of your phone (if you do not want to flash custom kernel skip to step 4)
*2. Download custom kernel you want to flash, extract zImage from the flashable kernel zip
*3. Unpack boot image using android image kitchen, in the split_img folder delete "boot.img-zImage" and put zImage you extracted in split_img folder and rename it to "boot.img-zImage"
*For custom kernel only
4. Install magisk manager apk on your phone
5. open magisk manager, you will see magisk is not installed select install (first one), a popup will appear telling to install magisk, select install, then select Patch Boot Image File, select the boot.img file that you extracted, then let magisk manager do the rest, after finishing the patched_boot.img file will be stored in Downloads folder of your internal storage
6. Open the patched_boot.img in hex editor
7. To make the patched_boot.img to boot append(Note2) a 4k block which begins with 0x30, 0x83, 0x19, 0x89, 0x64 to patched_boot.img, and save the file
8. Boot into twrp and flash patched_boot.img
9. Done, reboot
Note2: On Linux you can use dd command to append
Code:
printf '\x30\x83\x19\x89\x64' | dd of=testfile ibs=4096 conv=sync,notrunc oflag=append
Note3: If you get error cannot mount twrp while flashing the image, use vendor twrp
Note4: If I get time I will later make a script that automates the process.
Click to expand...
Click to collapse
Please upload the patched files.
- hack_splash.xml
- recovery.img
- twrp.img
- splash.img
- twrp.xml
It really helps me to know how to append blocks.
Please upload these files for us.
Thanks and regards.
Anshu lakra said:
aIecxs said:
Dude, youre waiting for 2 months, wish i could help you... Maybe here more better luck?
https://forum.xda-developers.com/showthread.php?t=3911660
Click to expand...
Click to collapse
Have you flashed custom ROM ?
---------- Post added at 03:54 AM ---------- Previous post was at 03:52 AM ----------
Nobody is uploading or posting link.
Click to expand...
Click to collapse
Nope. I don't have this phone anymore. Just be patient, _saurabh__._ will upload patched files as soon as he has time, he's busy at moment
aIecxs said:
Nope. I don't have this phone anymore. Just be patient, _saurabh__._ will upload patched files as soon as he has time, he's busy at moment
Click to expand...
Click to collapse
Thanks sir i am waiting .
saurabh6377 said:
As a followup to this guide https://forum.xda-developers.com/xiaomi-redmi-5a/how-to/bypass-bootloader-lock-redmi-5ariva-t3772381 by dev @xaacnz without him this guide might not be here, I am making this guide so you can root your device or flash any custom kernel without unlocking your device.
NOTE: YOU NEED TO FOLLOW THE ABOVE GUIDE IF YOU HAVEN'T, THEN COME BACK HERE
Code:
Your warranty will be void now
I am not responsible for anything wrong happens to your device
Note1: Even though no data is erased in this process it is recommended to take backup.
What this guide covers.
1. Rooting your device
2. Flashing custom kernel
All without need to unlock bootloader​
Well there are two ways with which you can do this
Requirements
For PC based method
1. Working twrp recovery (if you dont have twrp installed follow this guide)
2. Pc must have linux installed, if you have windows don't worry install WSL using this link
3. Android image kitchen for your respective OS.
4. Latest magisk zip from here
For Android only
1. Working twrp
2. Any hex editor(Note2) for android/windows (optional)
3. Latest Magisk manager app only (for root only)
4. Android Image kitchen- android, windows/linux (for custom kernel only)
Steps for PC based​1. Flash magisk zip or any kernel. Don't reboot system.
2. Go to backup senction in twrp and backup boot.
3. Connect your device to PC and look where you backed up boot and copy boot.emmc.win to Android image kitchen folder and rename to boot.img
4. Run unpackimg.sh or double click on unpackimg.bat. Then run repackimg.sh or double click on repackimg.bat. You will see image-new.img in the same folder
5. On windows hold Shift and right click in file manager with mouse, you will see open linux shell here, click it. OR if you have linux (specifically ubuntu) then right click and select open terminal here in Nautilus.
6. Run (to append 4k block, note that you can append block to any file specified by "of" parameter like of=twrp.img, of=boot.img etc)
Code:
printf '\x30\x83\x19\x89\x64' | dd of=image-new.img ibs=4096 conv=sync,notrunc oflag=append
7. Copy the image-new.img to your phone anywhere you prefer.
8. Flash image-new.img using twrp to boot partition.
9. Reboot
Steps for non-PC based (*outdated and some kernels won't work fully)​[/CENTER]
1. Extract boot.img from your currently installed rom and put it in internal storage of your phone (if you do not want to flash custom kernel skip to step 4)
*2. Download custom kernel you want to flash, extract zImage from the flashable kernel zip
*3. Unpack boot image using android image kitchen, in the split_img folder delete "boot.img-zImage" and put zImage you extracted in split_img folder and rename it to "boot.img-zImage"
*For custom kernel only
4. Install magisk manager apk on your phone
5. open magisk manager, you will see magisk is not installed select install (first one), a popup will appear telling to install magisk, select install, then select Patch a file, select the boot.img file that you extracted, then let magisk manager do the rest, after finishing the magisk-patched.img file will be stored in Downloads folder of your internal storage
6. Open the patched_boot.img in hex editor
7. To make the patched_boot.img to boot append(Note2) a 4k block which begins with 0x30, 0x83, 0x19, 0x89, 0x64 to patched_boot.img, and save the file
8. Boot into twrp and flash patched_boot.img
9. Done, reboot
Note2: On Linux you can use dd command to append
Code:
printf '\x30\x83\x19\x89\x64' | dd of=testfile ibs=4096 conv=sync,notrunc oflag=append
Note3: If you get error cannot mount twrp while flashing the image, use vendor twrp
Note4: If I get time I will later make a script that automates the process.
Click to expand...
Click to collapse
script .you promised script. are looking forward to !!! You are welcome
If this is like an LG Bump situation you should just make a Pull Request to Magisk to add detection of the magic and to re-add it after automatically. I'll see about adding support for it to my Android Image Kitchen as well.
Edit: Also @saurabh6377 isn't using AK3 correctly.. he left in all the stuff from the example and edited the Backend to add the printf (which it clearly says not to do) instead of putting it in anykernel.sh.
not necessary there is official unlock tool from xiaomi
aIecxs said:
not necessary there is official unlock tool from xiaomi
Click to expand...
Click to collapse
This is for those who weren't successful unlocking via official method.
osm0sis said:
Edit: Also @saurabh6377 isn't using AK3 correctly.. he left in all the stuff from the example and edited the Backend to add the printf (which it clearly says not to do) instead of putting it in anykernel.sh.
Click to expand...
Click to collapse
Yeah, that is why I said experimental, I have my exams coming and I am just starting to learn all the stuff. It takes a lot of time figuring out everything (for beginner).
That is why I modified anykernel methods of flashing boot image.
EDIT: After my exams will be over, I will try to make another version of appender using anykernel correctly.
@osm0sis Also, the bytes must be appended to final boot.img before flashing, but ak3 builds and flashes boot image in same method (write_boot), so I have to modify that method. Correct me if I am wrong.
osm0sis said:
If this is like an LG Bump situation you should just make a Pull Request to Magisk to add detection of the magic and to re-add it after automatically. I'll see about adding support for it to my Android Image Kitchen as well.
Click to expand...
Click to collapse
Not really needed, people can just unlock, it is for those who are using bypass bootloader exploit because they cannot unlock (most likely in case if someone have bought from untrusted source). And append doesn't work always.
Sent from my Redmi Note 7 using XDA Labs
saurabh6377 said:
Yeah, that is why I said experimental, I have my exams coming and I am just starting to learn all the stuff. It takes a lot of time figuring out everything (for beginner).
That is why I modified anykernel methods of flashing boot image.
EDIT: After my exams will be over, I will try to make another version of appender using anykernel correctly.
@osm0sis Also, the bytes must be appended to final boot.img before flashing, but ak3 builds and flashes boot image in same method (write_boot), so I have to modify that method. Correct me if I am wrong.
Not really needed, people can just unlock, it is for those who are using bypass bootloader exploit because they cannot unlock (most likely in case if someone have bought from untrusted source). And append doesn't work always.
Click to expand...
Click to collapse
Cool. I just worry what that stuff intended for tuna (Galaxy Nexus) could do. If you don't need to touch the ramdisk you could just use split_boot; so it doesn't unpack the ramdisk unnecessarily.
You can use repack_ramdisk; (if unpacked) and flash_boot; instead of write_boot; to get more granular control and be able to act on the final image before flash. :good:
Good luck with your exams! :fingers-crossed:
@osm0sis thanks, I will make another version of appender soon.
I have one question though
I want to edit /vendor/etc/fstab.qcom to enable forceencrypt using anykernel
In fstab.qcom I have this
/dev/block/bootdevice/by-name/userdata /data ext4 rw,nosuid,nodev,noatime,noauto_da_alloc wait,formattable,check,encryptable=footer,quota
I want to change "encryptable" to "forceencrypt" using anykernel.
What is proper way?
Sent from my Redmi Note 7 using XDA Labs
saurabh6377 said:
@osm0sis thanks, I will make another version of appender soon.
I have one question though
I want to edit /vendor/etc/fstab.qcom to enable forceencrypt using anykernel
In fstab.qcom I have this
/dev/block/bootdevice/by-name/userdata /data ext4 rw,nosuid,nodev,noatime,noauto_da_alloc wait,formattable,check,encryptable=footer,quota
I want to change "encryptable" to "forceencrypt" using anykernel.
What is proper way?
Click to expand...
Click to collapse
Well that's not necessarily an AnyKernel "thing" because it's a vendor partition modification, but yeah you could do that somewhere in anykernel.sh as part of a flash if you want, just remember to mount vendor rw first and back to ro after. The AK3 patch_fstab function might work for you.
Hey ges any video for this step?
7. To make the patched_boot.img to boot append a 4k block which begins with 0x30, 0x83, 0x19, 0x89, 0x64 to patched_boot.img, and save the file

Categories

Resources