Thursday, May 19, 2016

[GUIDE] How To Port Any Custom Recovery To MTK




Due to lack of development on many MTK devices there aren't any recoveries and people have a hard time flashing ROMs on their MTK Device. Today I am here with a guide to show you how to port a custom recovery to your MTK device. And I have been asked multiple times on how to port a recovery, so I finally decided to make a guide.

This guide will work on MT6572, MT6582, MT6577, MT6589, MT6592. MT6571 and it will also work on other variants of the above chipsets such as MT6582M, MT6589T, MT6592M and so on

Do not replicate, duplicate and copy any of the content of this site

Things you need :
- CarlivImage Kitchen : This is needed to unpack and repack the recovery (it will unpack any type of recovery)
- Stock boot.img and recovery.img
- A little time and patience
- Carliv Touch Recovery (Download the recovery for your resolution)
Note : You can use port any recovery but make sure the resolution and chipset matches

How To :
- Rename stock recovery.img to stock_recovery.img and port recovery.img as port-recovery.img
- Just drag the recoveries in the .bat file in CarlivImage Kitchen and it will unpack them. 
- Replace from stock to port :
* meta_init.project.rc
* meta_init.rc
* meta_init.modem.rc
* ueventd.rc
* ueventd.goldfish.rc
* fstab
* /etc/recovery.fstab
* replace kernel
* kernel_header (depends on the tool you used)

Note : Repack and test the recovery, whether it boots or not. After done unpack the new recovery and make the following changes 

- Compare default.prop of stock and port and only change the following lines (colored in red)

#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=0
ro.allow.mock.location=1
persist.mtk.aee.aed=on
ro.debuggable=1
persist.service.acm.enable=0
persist.sys.usb.config=mass_storage,adb
ro.bootloader.mode=download
ro.mount.fs=EXT4
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=KTU84Q
ro.build.display.id=cm_new-eng 4.4.4 KTU84Q 347d7427a4 test-keys
ro.build.version.incremental=347d7427a4
ro.build.version.sdk=19
ro.build.version.codename=REL
ro.build.version.release=4.4.4
ro.build.date=Tue Dec  9 16:23:16 EET 2014
ro.build.date.utc=0
ro.build.type=eng
ro.build.user=carliv
ro.build.host=max
ro.build.tags=test-keys
ro.product.brand=mtk
ro.product.name=cm_new
ro.product.board=
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=mtk
ro.product.locale.language=en
ro.product.locale.region=US
ro.wifi.channels=
ro.board.platform=mt6582
# ro.build.product is obsolete; use ro.product.device
ro.build.product=new
ro.product.model=new
ro.product.device=new
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=cm_new-eng 4.4.4 KTU84Q 347d7427a4 test-keys
ro.build.fingerprint=mtk/cm_new/new:4.4.4/KTU84Q/347d7427a4:eng/test-keys
ro.build.characteristics=default
ro.cm.device=new
# end build properties
#
# from device/mtk/new/system.prop
#
#
# system.prop for new
#

#
# ADDITIONAL_BUILD_PROPERTIES
#
ro.rommanager.developerid=cyanogenmod
ro.com.google.clientidbase=android-google
keyguard.no_require_sim=true
ro.url.legal=http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html
ro.url.legal.android_privacy=http://www.google.com/intl/%s/mobile/android/basic/privacy.html
ro.com.android.wifi-watchlist=GoogleGuest
ro.setupwizard.enterprise_mode=1
ro.com.android.dateformat=MM-dd-yyyy
ro.com.android.dataroaming=false
ro.build.selinux=1
persist.sys.dalvik.multithread=false
persist.sys.dun.override=0
persist.sys.root_access=1
ro.cm.version=11-20141209-UNOFFICIAL-new
ro.cm.releasetype=UNOFFICIAL
ro.modversion=11-20141209-UNOFFICIAL-new
ro.cmlegal.url=http://www.cyanogenmod.org/docs/privacy
persist.sys.recovery_update=false
ro.cm.display.version=11-20141209-UNOFFICIAL-new
ro.config.notification_sound=Argon.ogg
ro.config.alarm_alert=Hassium.ogg
ro.config.ringtone=Orion.ogg
ro.carrier=unknown
ro.ril.hsxpa=1
ro.ril.gprsclass=10
ro.adb.qemud=1
persist.sys.dalvik.vm.lib=libdvm.so
ro.kernel.android.checkjni=1
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt

That's it you are good to go now. Hope you were able to port the recovery successfully.
Note : Please do not report minor bugs like USB storage not mount in PC from recovery. You can easily push files to sdcard if you mount it in recovery (not USB storage) and then push it via adb.
Some useful adb commands which are important and will help you to send files to sdcard while in recovery mode :http://nayeemkhanxda.blogspot.com/2016/05/guide-how-to-adb-terminal-and.html



{বিঃদ্রঃ সকল কাজ নিজের দায়িত্তে করবেন }
(বিঃদ্রঃ আমার কোন লিখা বা অন্য কিছুই কপি করার চেষ্টা করবেননা আশা করি)
এই টিউন সংক্রান্ত কোন বিষয় থাকলে নিচে টিউমেন্ট করুন
ইচ্ছে হলে আমাকে ফেসবুক এ পেতে যোগাযোগ করুন এইখানে।

এবং এন্ড্রয়েড আলোচনা পেজ, এইখানে ক্লিক করুন।

[Guide] How to 'ADB Terminal' and Installation

ADB Drivers For MTK


"ADB" is the most important tool for almost any developer out there no matter what device they use. But still many people do not know the uses of adb and how to use it for their advantage no matter what the situation is.

Stuck on bootloop ? Stuck on Animation ? Stuck on Recovery and storage does not mount ? Need to push or pull files ? and damn the list can go on and on forever. ADB has the solution for all of this.
These commands are really neat and can be life savers in many ways. I use these commands always and they save me a lot of time.

If you have some adb commands you use daily then comment them down below.

Things You Need :
1. ADB Installed
- Download 5 sec ADB Installer For Windows XP/Vista/7/8/10 : Download ADB Drivers for Windows
2. PDA Net+ (Modded) - Download Here


How To :
  1. Download 5 sec ADB Installer and Install it. Press "Y" for every choice
  2. Install the Modded PDA Net+ - Just follow the steps of the Installer
  3. After everything is done. Press "Windows button+R"
  4. Type "cmd" and press enter
  5. Connect your device with USB Debugging ON and type "adb devices" in CMD without ""
  6. If device is detected then everything is OK

Common ADB Uses and Commands :

1. So you need to send a file from PC to Device but don't want to use a file manager because that takes way to long and you know you are lazy (Me To :p)
- In terminal type "adb remount" this will mount your device as Read/Write
- Usage of the command "adb push filename path to send to"
- Example : "adb push framework-res.apk /system/framework/"
Note : The file you are trying to push must be in the directory in which cmd has opened


2. After you have pushed your file you might need to change the permissions or you might be stuck in bootloop sometimes. Many system files like build.prop require changine after pushing it like in above example.


- In terminal type "adb shell"
- Type "chmod 644 filepath"
- Example "chmod 644 /system/build.prop"
- Replace 644 with correct permissions. For build.prop and other system files it is usually 644

3. So you are in recovery mode and cannot boot for some reason and you forgot to send the stock ROM to device ? and Recovery does not mount your SD card then :


- Connect your device to PC
- In recovery go to mounts and storage and mount all the partitions
- In terminal type "adb shell"
- Type "cd path to your SD card"
- Example for most devices "cd /storage/sdcard1/
- Type "ls" now you will be able to see all the contents of SD card
- Type "exit" and exit adb shell
- Type "adb push filename.zip /storage/sdcard1/" and wait for it to complete, a message will be displayed once it is complete

Note : The file you are trying to push must be in the directory in which cmd has opened

4. Stuck at bootlogo or bootanimation ? You can take a logcat as long as the device is detected.


- In terminal type "adb devices"
- If device is detected then type "adb logcat > logcat.txt"
- After about 5-10 seconds press "Ctrl+C"
Note : You will now get the logcat.txt in the directory in which cmd is opened

5. Need to pull a file from your device to the PC ? But to lazy to mount storage and stuff (like me :p) then :


- In terminal type "adb remount"
- Type "adb pull file location"
- Example "adb pull /system/build.prop"
- Example 2 "adb pull /system/framework/framework-res.apk"

Note : You will now get the logcat.txt in the directory in which cmd is opened

6. To quickly reboot your device to different modes use the following commands :


- To reboot "adb reboot"
- To reboot into recovery "adb reboot recovery"
- To reboot into bootloader "adb reboot bootloader"

7. To run commands in the device itself using PC, whatever commad you type in the PC will be executed in the device :

- In terminal type "adb remount:
- Type "adb shell"
- Now your can execute and command from the PC to device

These are all the most important commands every developer or newbie or anyone must know if you are dealing with root or Custom ROMs

{বিঃদ্রঃ সকল কাজ নিজের দায়িত্তে করবেন }
(বিঃদ্রঃ আমার কোন লিখা বা অন্য কিছুই কপি করার চেষ্টা করবেননা আশা করি)
এই টিউন সংক্রান্ত কোন বিষয় থাকলে নিচে টিউমেন্ট করুন
ইচ্ছে হলে আমাকে ফেসবুক এ পেতে যোগাযোগ করুন এইখানে।

এবং এন্ড্রয়েড আলোচনা পেজ, এইখানে ক্লিক করুন।