FORUMS
Remove All Ads from XDA

[GUIDE]Porting TWRP without source

456 posts
Thanks Meter: 137
 
By Augustoandro, Senior Member on 16th September 2018, 07:32 PM
Post Reply Email Thread
Yes, I know XDA is filled with such guides.
But you can only port a TWRP if you implement parts of all the guides.
This guide is a summation of all those guides.

NOTE:
I would be using AIK-Linux in this tutorial, since I don't recommend Windows for all this, who knows what problems you will get into.

REQUIREMENTS:
1.Download these TWRP recoveries in accordance with your screen resolution.
A. If your screen resolution is 480x850, 480x854; download
https://twrp.me/devices/lgnexus4.html
B. If your screen resolution is 720x1280, 800x1280 or 720xsomething; download
https://twrp.me/devices/asusnexus720123g.html
C. If your screen resolution is 1080x1920, download
https://twrp.me/devices/motorolanexus6.html
2. Download Android Image Kitchen-Linux from this thread:
https://forum.xda-developers.com/sho....php?t=2073775

LET'S BEGIN:
1. Unzip Android Image Kitchen zip file.
3. Now, navigate to the unzipped folder of AIK (Android Image Kitchen).
4. Just Right Click and select "Open Terminal here".
5. Copy and paste your stock recovery.img and paste it in AIK folder.
6. In the terminal, type the command
Code:
su
Enter your root password, then type
Code:
./unpackimg.sh
7. This will unpack your stock recovery.img. Do not close the terminal.
8. Cut the new folders, ramdisk and split_img, and paste them somewhere outside of AIK folder.
9. Remove the stock recovery.img in AIK folder.
10. Now, copy and paste the twrp_recovery.img according to your screen resolution in the AIK folder.
11. Now, revert back to the terminal and type
Code:
./unpackimg.sh
12. This will unpack your twrp_recovery.img
13. Delete all the files in the new split_img folder we got by unpackimg twrp_recovery.img
14. Copy and paste all the files in stock split_img folder to the new split_img folder.
15. Delete following files from new ramdisk folder.
A. default.prop
B. fstab.devicename_or_chipsetname
C. ueventd.rc
D. Any other file like ueventd.devicename.rc
16. Copy and paste these files from stock ramdisk folder to new ramdisk folder.
A. default.prop
B. fstab.devicename
C. ueventd.rc
17. Now go into stock ramdisk/etc folder and copy recovery.fstab
18. Paste the recovery.fstab file in new ramdisk/etc folder.
19. Edit the twrp.fstab file according to the newly pasted recovery.fstab
20. You will have to replace"/sdcard" with "/external_sd" and "/usb" with "/usb-otg".
21. If the partitions stated above are not available in your fstab files then add these lines. Order may change on the format in which the files are written.
Code:
/external_sd          vfat         /dev/block/mmcblk1p1  flags=removable;storage;display="SDCARD"
/usb-otg                auto         /dev/block/sda1    flags=removable;storage;display="USB-OTG"
22. Edit the following lines as shown in default.prop
Code:
ro.secure=0
ro.adb.secure=0
security.perf_harden=0
ro.debuggable=1
persist.sys.usb.config=adb,mtp
23. Now, come out of the ramdisk folder and open the terminal.
24. Type
Code:
./repackimg.sh
25. Your new TWRP img would be generated and named as image-new.img by default. You may change the name later.

When you have successfully built the TWRP, or if you want to request one instead of creating yourself, contact me on this thread:
https://forum.xda-developers.com/and...-code-t3833338


SPECIAL INSTRUCTIONS FOR MEDIATEK DEVICES:
1. The recovery.fstab you will get after unpacking your stock recovery.img would be flawed in most cases. I believe OEMs do this deliberately.
2. In order to know which partition is mounted at which location and at which device, you'll need DiskInfo (Install it from Play Store) and a root explorer.
3. Change the Diskinfo settings like this
https://mega.nz/#!fbIR0AoD!ykRMTAity...ZDZSgIKcVTxEHg
https://mega.nz/#!yXQzwKJK!rWO_LiKZw...xAkSkKNRYXVuIY
4. Use the root explorer to find the path of your partitions. They would be located under /dev (mtk devices have bootimg and recovery here generally) and some other partitions like /system, /cache would be deeper inside.
5. You can trace their exact locations by navigating within the /dev directory for partition names like mmcblk0p5.


SPECIAL INSTRUCTIONS FOR DEVICES THAT DON'T HAVE RECOVERY.FSTAB WITHIN STOCK RECOVERY.IMG
1. In the ramdisk/etc folder, there might be a dummy recovery.fstab file with the symbol of link on it.
2. Right click on the file and select "Show Target". You'll get to know the path of original recovery.fstab file. It might be within the unpacked recovery or inside some other partition on your phone.
For example: Honor 7C devices have their recovery.fstab in /vendor/etc folder.



If it works perfectly, I will make it available to others through my thread.
If there are some bugs or you need some assistance in porting TWRP, contact me all the same, we'll work on it to make it bug-free.

CREDITS:
HostZero for his porting guide.
Osm0sis for his awesome Android Image Kitchen
The Following 15 Users Say Thank You to Augustoandro For This Useful Post: [ View ] Gift Augustoandro Ad-Free
 
 
17th September 2018, 02:38 AM |#2  
SachinBorkar's Avatar
Senior Member
Flag India
Thanks Meter: 12
 
More
Quote:
Originally Posted by Augustoandro

Yes, I know XDA is filled with such guides.
But you can only port a TWRP if you implement parts of all the guides.
This guide is a summation of all those guides.

NOTE:
I would be using AIK-Linux in this tutorial, since I don't recommend Windows for all this, who knows what problems you will get into.

REQUIREMENTS:
1.Download these TWRP recoveries in accordance with your screen resolution.
A. If your screen resolution is 480x850, 480x854; download
https://twrp.me/devices/lgnexus4.html
B. If your screen resolution is 720x1280, 800x1280 or 720xsomething; download
https://twrp.me/devices/asusnexus720123g.html
C. If your screen resolution is 1080x1920, download
https://twrp.me/devices/motorolanexus6.html
2. Download Android Image Kitchen-Linux from this thread:
https://forum.xda-developers.com/sho....php?t=2073775

LET'S BEGIN:
1. Unzip Android Image Kitchen zip file.
3. Now, navigate to the unzipped folder of AIK (Android Image Kitchen).
4. Just Right Click and select "Open Terminal here".
5. Copy and paste your stock recovery.img and paste it in AIK folder.
6. In the terminal, type

Code:
./unpackimg.sh
7. This will unpack your stock recovery.img. Do not close the terminal.
8. Cut the new folders, ramdisk and split_img, and paste them somewhere outside of AIK folder.
9. Remove the stock recovery.img in AIK folder.
10. Now, copy and paste the twrp_recovery.img according to your screen resolution in the AIK folder.
11. Now, revert back to the terminal and type
Code:
./unpackimg.sh
12. This will unpack your twrp_recovery.img
13. Delete all the files in the new split_img folder we got by unpackimg twrp_recovery.img
14. Copy and paste all the files in stock split_img folder to the new split_img folder.
15. Delete following files from new ramdisk folder.
A. default.prop
B. fstab.devicename_or_chipsetname
C. ueventd.rc
D. Any other file like ueventd.devicename.rc
16. Copy and paste these files from stock ramdisk folder to new ramdisk folder.
A. default.prop
B. fstab.devicename
C. ueventd.rc
17. Now go into stock ramdisk/etc folder and copy recovery.fstab
18. Paste the recovery.fstab file in new ramdisk/etc folder.
19. Edit the twrp.fstab file according to the newly pasted recovery.fstab
20. You will have to replace"/sdcard" with "/external_sd" and "/usb" with "/usb-otg".
21. If the partitions stated above are not available in your fstab files then add these lines. Order may change on the format in which the files are written.
Code:
/external_sd          vfat         /dev/block/mmcblk1p1  flags=removable;storage;display="SDCARD"
/usb-otg                auto         /dev/block/sda1    flags=removable;storage;display="USB-OTG"
22. Edit the following lines as shown in default.prop
Code:
ro.secure=0
ro.adb.secure=0
security.perf_harden=0
ro.debuggable=1
persist.sys.usb.config=adb,mtp
23. Now, come out of the ramdisk folder and open the terminal.
24. Type
Code:
./repackimg.sh
25. Your new TWRP img would be generated and named as image-new.img by default. You may change the name later.

When you have successfully built the TWRP, contact me on this thread:
https://forum.xda-developers.com/and...-code-t3833338


SPECIAL INSTRUCTIONS FOR MEDIATEK DEVICES:
1. The recovery.fstab you will get after unpacking your stock recovery.img would be flawed in most cases. I believe OEMs do this deliberately.
2. In order to know which partition is mounted at which location and at which device, you'll need DiskInfo (Install it from Play Store) and a root explorer.
3. Change the Diskinfo settings like this
https://mega.nz/#!fbIR0AoD!ykRMTAity...ZDZSgIKcVTxEHg
https://mega.nz/#!yXQzwKJK!rWO_LiKZw...xAkSkKNRYXVuIY
4. Use the root explorer to find the path of your partitions. They would be located under /dev (mtk devices have bootimg and recovery here generally) and some other partitions like /system, /cache would be deeper inside.
5. You can trace their exact locations by navigating within the /dev directory for partition names like mmcblk0p5.


SPECIAL INSTRUCTIONS FOR DEVICES THAT DON'T HAVE RECOVERY.FSTAB WITHIN STOCK RECOVERY.IMG
1. In the ramdisk/etc folder, there might be a dummy recovery.fstab file with the symbol of link on it.
2. Right click on the file and select "Show Target". You'll get to know the path of original recovery.fstab file. It might be within the unpacked recovery or inside some other partition on your phone.
For example: Honor 7C devices have their recovery.fstab in /vendor/etc folder.



If it works perfectly, I will make it available to others through my thread.
If there are some bugs or you need some assistance in porting TWRP, contact me all the same, we'll work on it to make it bug-free.

CREDITS:
HostZero for his porting guide.
Osm0sis for his awesome Android Image Kitchen

I tried all these type op method but didnt work on my android.
Please help.
It alway on bootloop and restart normaly

Sent from my Titanium Vista 4G using Tapatalk
17th September 2018, 08:33 AM |#3  
Augustoandro's Avatar
OP Senior Member
Flag Pune
Thanks Meter: 137
 
More
Quote:
Originally Posted by SachinBorkar

Yes, I know XDA is filled with such guides.
But you can only port a TWRP if you implement parts of all the guides.
This guide is a summation of all those guides.

NOTE:
I would be using AIK-Linux in this tutorial, since I don't recommend Windows for all this, who knows what problems you will get into.

REQUIREMENTS:
1.Download these TWRP recoveries in accordance with your screen resolution.
A. If your screen resolution is 480x850, 480x854; download
https://twrp.me/devices/lgnexus4.html
B. If your screen resolution is 720x1280, 800x1280 or 720xsomething; download
https://twrp.me/devices/asusnexus720123g.html
C. If your screen resolution is 1080x1920, download
https://twrp.me/devices/motorolanexus6.html
2. Download Android Image Kitchen-Linux from this thread:
https://forum.xda-developers.com/sho....php?t=2073775

LET'S BEGIN:
1. Unzip Android Image Kitchen zip file.
3. Now, navigate to the unzipped folder of AIK (Android Image Kitchen).
4. Just Right Click and select "Open Terminal here".
5. Copy and paste your stock recovery.img and paste it in AIK folder.
6. In the terminal, type

7. This will unpack your stock recovery.img. Do not close the terminal.
8. Cut the new folders, ramdisk and split_img, and paste them somewhere outside of AIK folder.
9. Remove the stock recovery.img in AIK folder.
10. Now, copy and paste the twrp_recovery.img according to your screen resolution in the AIK folder.
11. Now, revert back to the terminal and type

12. This will unpack your twrp_recovery.img
13. Delete all the files in the new split_img folder we got by unpackimg twrp_recovery.img
14. Copy and paste all the files in stock split_img folder to the new split_img folder.
15. Delete following files from new ramdisk folder.
A. default.prop
B. fstab.devicename_or_chipsetname
C. ueventd.rc
D. Any other file like ueventd.devicename.rc
16. Copy and paste these files from stock ramdisk folder to new ramdisk folder.
A. default.prop
B. fstab.devicename
C. ueventd.rc
17. Now go into stock ramdisk/etc folder and copy recovery.fstab
18. Paste the recovery.fstab file in new ramdisk/etc folder.
19. Edit the twrp.fstab file according to the newly pasted recovery.fstab
20. You will have to replace"/sdcard" with "/external_sd" and "/usb" with "/usb-otg".
21. If the partitions stated above are not available in your fstab files then add these lines. Order may change on the format in which the files are written.

22. Edit the following lines as shown in default.prop

23. Now, come out of the ramdisk folder and open the terminal.
24. Type
I tried all these type op method but didnt work on my android.
Please help.
It alway on bootloop and restart normaly

Tell me what happened in detail.
Which files you transferred?
Did terminal show you any errors upon running the commands?
It would be better if you did everything using root account.
Btw, you should give executing permissions to all files inside AIK-Linux/bin
17th September 2018, 10:29 AM |#4  
SachinBorkar's Avatar
Senior Member
Flag India
Thanks Meter: 12
 
More
No error occurs during packing and unpacking but.
After flash recovery.img phones stuck on bootloop.

Sent from my Titanium Vista 4G using Tapatalk

---------- Post added at 02:59 PM ---------- Previous post was at 02:44 PM ----------

Quote:
Originally Posted by Augustoandro

Tell me what happened in detail.
Which files you transferred?
Did terminal show you any errors upon running the commands?
It would be better if you did everything using root account.
Btw, you should give executing permissions to all files inside AIK-Linux/bin

No error occurs but after flash recovery.img
Phone stuck on boot.

Here is my stock recovery and important files please port
My recovery




https://drive.google.com/file/d/1SkL...w?usp=drivesdk

Sent from my Titanium Vista 4G using Tapatalk
17th September 2018, 10:36 AM |#5  
Augustoandro's Avatar
OP Senior Member
Flag Pune
Thanks Meter: 137
 
More
Quote:
Originally Posted by SachinBorkar

No error occurs during packing and unpacking but.
After flash recovery.img phones stuck on bootloop.

Sent from my Titanium Vista 4G using Tapatalk

---------- Post added at 02:59 PM ---------- Previous post was at 02:44 PM ----------

No error occurs but after flash recovery.img
Phone stuck on boot.

Here is my stock recovery and important files please port
My recovery




https://drive.google.com/file/d/1SkL...w?usp=drivesdk

You already requested on my another thread.
17th September 2018, 12:59 PM |#6  
SachinBorkar's Avatar
Senior Member
Flag India
Thanks Meter: 12
 
More
Quote:
Originally Posted by Augustoandro

You already requested on my another thread.

Thanks for replay I am working to create it.
But i also request that you have experience so you may help.
I am not going to request again sorry.
I will wait.
And also i try my best.

Thanks.

Sent from my Titanium Vista 4G using Tapatalk
20th September 2018, 06:41 AM |#7  
HemanthJabalpuri's Avatar
Senior Member
Flag Repalle
Thanks Meter: 225
 
More
Another great thread from op...
The Following User Says Thank You to HemanthJabalpuri For This Useful Post: [ View ] Gift HemanthJabalpuri Ad-Free
23rd September 2018, 10:41 AM |#8  
Member
Thanks Meter: 20
 
More
Thanks a lot @Augustoandro! IMHO this is by far the easiest guide for porting TWRP to unsupported devices. Keep it up!
27th October 2018, 03:08 AM |#9  
Member
Thanks Meter: 8
 
More
Quote:
Originally Posted by Augustoandro

Yes, I know XDA is filled with such guides.
But you can only port a TWRP if you implement parts of all the guides.
This guide is a summation of all those guides.

NOTE:
I would be using AIK-Linux in this tutorial, since I don't recommend Windows for all this, who knows what problems you will get into.

REQUIREMENTS:
1.Download these TWRP recoveries in accordance with your screen resolution.
A. If your screen resolution is 480x850, 480x854; download
https://twrp.me/devices/lgnexus4.html
B. If your screen resolution is 720x1280, 800x1280 or 720xsomething; download
https://twrp.me/devices/asusnexus720123g.html
C. If your screen resolution is 1080x1920, download
https://twrp.me/devices/motorolanexus6.html
2. Download Android Image Kitchen-Linux from this thread:
https://forum.xda-developers.com/sho....php?t=2073775

LET'S BEGIN:
1. Unzip Android Image Kitchen zip file.
3. Now, navigate to the unzipped folder of AIK (Android Image Kitchen).
4. Just Right Click and select "Open Terminal here".
5. Copy and paste your stock recovery.img and paste it in AIK folder.
6. In the terminal, type the command

Code:
su
Enter your root password, then type
Code:
./unpackimg.sh
7. This will unpack your stock recovery.img. Do not close the terminal.
8. Cut the new folders, ramdisk and split_img, and paste them somewhere outside of AIK folder.
9. Remove the stock recovery.img in AIK folder.
10. Now, copy and paste the twrp_recovery.img according to your screen resolution in the AIK folder.
11. Now, revert back to the terminal and type
Code:
./unpackimg.sh
12. This will unpack your twrp_recovery.img
13. Delete all the files in the new split_img folder we got by unpackimg twrp_recovery.img
14. Copy and paste all the files in stock split_img folder to the new split_img folder.
15. Delete following files from new ramdisk folder.
A. default.prop
B. fstab.devicename_or_chipsetname
C. ueventd.rc
D. Any other file like ueventd.devicename.rc
16. Copy and paste these files from stock ramdisk folder to new ramdisk folder.
A. default.prop
B. fstab.devicename
C. ueventd.rc
17. Now go into stock ramdisk/etc folder and copy recovery.fstab
18. Paste the recovery.fstab file in new ramdisk/etc folder.
19. Edit the twrp.fstab file according to the newly pasted recovery.fstab
20. You will have to replace"/sdcard" with "/external_sd" and "/usb" with "/usb-otg".
21. If the partitions stated above are not available in your fstab files then add these lines. Order may change on the format in which the files are written.
Code:
/external_sd          vfat         /dev/block/mmcblk1p1  flags=removable;storage;display="SDCARD"
/usb-otg                auto         /dev/block/sda1    flags=removable;storage;display="USB-OTG"
22. Edit the following lines as shown in default.prop
Code:
ro.secure=0
ro.adb.secure=0
security.perf_harden=0
ro.debuggable=1
persist.sys.usb.config=adb,mtp
23. Now, come out of the ramdisk folder and open the terminal.
24. Type
Code:
./repackimg.sh
25. Your new TWRP img would be generated and named as image-new.img by default. You may change the name later.

When you have successfully built the TWRP, or if you want to request one instead of creating yourself, contact me on this thread:
https://forum.xda-developers.com/and...-code-t3833338


SPECIAL INSTRUCTIONS FOR MEDIATEK DEVICES:
1. The recovery.fstab you will get after unpacking your stock recovery.img would be flawed in most cases. I believe OEMs do this deliberately.
2. In order to know which partition is mounted at which location and at which device, you'll need DiskInfo (Install it from Play Store) and a root explorer.
3. Change the Diskinfo settings like this
https://mega.nz/#!fbIR0AoD!ykRMTAity...ZDZSgIKcVTxEHg
https://mega.nz/#!yXQzwKJK!rWO_LiKZw...xAkSkKNRYXVuIY
4. Use the root explorer to find the path of your partitions. They would be located under /dev (mtk devices have bootimg and recovery here generally) and some other partitions like /system, /cache would be deeper inside.
5. You can trace their exact locations by navigating within the /dev directory for partition names like mmcblk0p5.


SPECIAL INSTRUCTIONS FOR DEVICES THAT DON'T HAVE RECOVERY.FSTAB WITHIN STOCK RECOVERY.IMG
1. In the ramdisk/etc folder, there might be a dummy recovery.fstab file with the symbol of link on it.
2. Right click on the file and select "Show Target". You'll get to know the path of original recovery.fstab file. It might be within the unpacked recovery or inside some other partition on your phone.
For example: Honor 7C devices have their recovery.fstab in /vendor/etc folder.



If it works perfectly, I will make it available to others through my thread.
If there are some bugs or you need some assistance in porting TWRP, contact me all the same, we'll work on it to make it bug-free.

CREDITS:
HostZero for his porting guide.
Osm0sis for his awesome Android Image Kitchen


Pls brother help me port twrp for my device. Here is my stock recovery image link : https://drive.google.com/file/d/1dqB...w?usp=drivesdk.
My phone's resolution : 720 x 1280 pixel.
The Following User Says Thank You to Deeni131 For This Useful Post: [ View ] Gift Deeni131 Ad-Free
28th October 2018, 11:56 AM |#10  
Augustoandro's Avatar
OP Senior Member
Flag Pune
Thanks Meter: 137
 
More
Quote:
Originally Posted by Deeni131

Yes, I know XDA is filled with such guides.
But you can only port a TWRP if you implement parts of all the guides.
This guide is a summation of all those guides.

NOTE:
I would be using AIK-Linux in this tutorial, since I don't recommend Windows for all this, who knows what problems you will get into.

REQUIREMENTS:
1.Download these TWRP recoveries in accordance with your screen resolution.
A. If your screen resolution is 480x850, 480x854; download
https://twrp.me/devices/lgnexus4.html
B. If your screen resolution is 720x1280, 800x1280 or 720xsomething; download
https://twrp.me/devices/asusnexus720123g.html
C. If your screen resolution is 1080x1920, download
https://twrp.me/devices/motorolanexus6.html
2. Download Android Image Kitchen-Linux from this thread:
https://forum.xda-developers.com/sho....php?t=2073775

LET'S BEGIN:
1. Unzip Android Image Kitchen zip file.
3. Now, navigate to the unzipped folder of AIK (Android Image Kitchen).
4. Just Right Click and select "Open Terminal here".
5. Copy and paste your stock recovery.img and paste it in AIK folder.
6. In the terminal, type the command

Enter your root password, then type

7. This will unpack your stock recovery.img. Do not close the terminal.
8. Cut the new folders, ramdisk and split_img, and paste them somewhere outside of AIK folder.
9. Remove the stock recovery.img in AIK folder.
10. Now, copy and paste the twrp_recovery.img according to your screen resolution in the AIK folder.
11. Now, revert back to the terminal and type

12. This will unpack your twrp_recovery.img
13. Delete all the files in the new split_img folder we got by unpackimg twrp_recovery.img
14. Copy and paste all the files in stock split_img folder to the new split_img folder.
15. Delete following files from new ramdisk folder.
A. default.prop
B. fstab.devicename_or_chipsetname
C. ueventd.rc
D. Any other file like ueventd.devicename.rc
16. Copy and paste these files from stock ramdisk folder to new ramdisk folder.
A. default.prop
B. fstab.devicename
C. ueventd.rc
17. Now go into stock ramdisk/etc folder and copy recovery.fstab
18. Paste the recovery.fstab file in new ramdisk/etc folder.
19. Edit the twrp.fstab file according to the newly pasted recovery.fstab
20. You will have to replace"/sdcard" with "/external_sd" and "/usb" with "/usb-otg".
21. If the partitions stated above are not available in your fstab files then add these lines. Order may change on the format in which the files are written.

22. Edit the following lines as shown in default.prop

23. Now, come out of the ramdisk folder and open the terminal.
24. Type



Pls brother help me port twrp for my device. Here is my stock recovery image link : https://drive.google.com/file/d/1dqB...?usp=drivesdk.
My phone's resolution : 720 x 1280 pixel.

This is not a TWRP request thread. I have included a link in the guide which takes you to a TWRP request thread. Post your request over there.

HIT THANKS IF FOUND USEFUL
18th November 2018, 09:26 PM |#11  
Junior Member
Thanks Meter: 0
 
More
Hi I tried to Port a Recovery for my H96 Max RK3399 TV Box .
I used TWRP From My RK3328 TVBox.
I can Boot in Recovery, but its not Mounting any Partition (everywhere 0MB)
I Think the problem is in .Fstab File but I am Not sure.
I would appreciate help

Sorry for my poor English
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes