[GUIDE]How To Port Different ROMS to Your Device (Simplest and Fastest)
来源:互联网 发布:js闭包写法和释放 编辑:程序博客网 时间:2024/04/29 09:58
原文地址:https://forum.xda-developers.com/showthread.php?t=1908008
Many people have requested me to share the method which I am using to port roms..
THIS IS THE SIMPLEST AND FASTEST WAY TO PORT ROMS!!!
This is the method which I use in porting Roms-
Things Needed- Winrar, Notepad++
You can use this Method to port roms From armv6 to armv7 devices but I dont know about the method used to port roms from armv7 to armv6 devices..
What is base Rom:
The ROM which is Developed For your Mobile..
What is Port Rom:
The Rom Which you want to port to your Device.
STEP1;
Take any clean CM9, AOSP, CM7, CM10, CM11 ROM which is running on your device as Base ROM.
STEP2:
Extract it Using Winrar.
STEP3:
Take the ROM you want to port. This Port ROM. Extract it also using Winrar.
STEP4:
Delete app, Framework, Fonts and Media folder in System Folder ofBase ROM.
Note: To Port Kitkat base ROM, you also have to copy the priv-app folder from port to base. Thats It.. (Credits to @thelegend10 for informing me that this guide works with KK)
STEP5:
Now copy app, Framework, Fonts and Media folder in System Folder from Port rom to base rom system folder.
STEP6:
Now open etc folder in both the ROMs folder.
STEP7:
In etc folder of base ROM open permissions folder and copy all the permissions files in Port rom to your base ROM folder except platform and handheld_hardware .And Then openinit.dFolder in Base ROM and Delete Every thing except banner and then copy all the files inside init.d folder of port ROM to Base ROM.
STEP8:
Now open buid.prop file using Notepad++ and make changes to these of Base Rom as you wish.
ro.build.id=
ro.build.display.id=
ro.build.date=
ro.modversion=
STEP9:
In build.prop file change these to same as Port Rom build.prop values.
ro.config.ringtone=
ro.config.notification_sound=
ro.config.alarm_alert=
Also Copy anything you Find Extra in ADDITIONAL BUILD PROPERTIES related to theme..
STEP10:
COPY THE set_perm Lines in META-INF/com/google/android/updater-script From Port to Base ROM After Deleting set_perm lines in BaseROM's Updater-Script.
STEP11:
If You find any extra file or folder in system folder of PORT rom than copy them to your base rom system folder.
STEP12:
Last Step to ZIP THE FOLDERS IN ONE..
SELECT META-INF, system, boot.img(if it is having), data(if it is having).
Right Click and Select Add to Archive..
Select Zip..
Type the Name.
Click OK..
Copy telocation.db and yellowpage.db From /system/etcfolder to yours..
Copy content-types.properties file From /system/lib to yours..
Copy invoke-as from miui4 rom to /system/xbin and give it permissions on updater-script
set_perm(0, 0, 06755, "/system/xbin/invoke-as");
Note:It is needed for backup & themes app to work
Copy liblbesec.so from miui 4 to /system/lib and give permission on updater-script
set_perm(0, 0, 0755, "/system/lib/liblbesec.so");
It is needed for superuser app from miui to work
Change values Some of the Values in build.prop of your ROM:
ro.build.id=MIUI
ro.build.display.id=MIUI
ro.build.version.incremental=2.x.x (version number)
ro.config.ringtone=MI.ogg
ro.config.notification_sound=FadeIn.ogg
ro.config.alarm_alert=GoodMorning.ogg
ro.config.sms_received_sound=FadeIn.ogg
ro.config.sms_delivered_sound=MessageComplete.ogg
Copy paranoid folder inside system/etc to yours..
Go to META-INF/com/google/android/Updater-Script of your base ROM and open it with Notepad++
Copy this line:
set_perm(1000, 1000, 0644, "/system/etc/paranoid/properties.conf");
Specially For PA:
Now Open Build.prop in /system with Notepad++
Copy these lines in Additional Properties of Build.prop:
#Depends on Resolution Of your device can be pa_hdpi/pa_mdpi/pa_xhdpi. Change it according to your device.ro.pa.family=pa_mdpi#Depend on pa version. Replace x.xx with the version of PA you are porting.ro.pa.version=x.xx
Specially For PAC Rom:
Now Open Build.prop in /system with Notepad++
Copy these lines in Additional Properties of Build.prop:
#Replace the x.x.x with your PAC Rom versionro.pac.version=x.x.x#Customize these lines according to your wish.ro.pacrom.version=mesona_PAC_jb-alpha-v19.0.0ro.modversion=mesona_PAC_jb-alpha-v19.0.0#Depends on Resolution Of your device can be pa_hdpi/pa_mdpi/pa_xhdpi. Change it according to your device.ro.pa.family=pa_mdpi#Depend on pa version. Replace x.xx with the version of PA you are porting.ro.pa.version=x.xx#Modify this line according to your AOKP versionro.aokp.version=mesona_jb-Milestone-1#Modify it according to your base ROM's build.propro.cm.version=xxxxxxxxxxxx
For HTC Devices:
To fix network auto select-
- Decompile framework-res.apk
- Go to \framework-res\res\values\bools.xml and change change <bool name="skip_restoring_network_selection">true</bool> to false
To Fix Graphichal issues:
- Decompile framework.jar
- Change these files with your base
- smali\smali\android\os
- Environment
- SystemProperties
- smali\smali\android\view
- HardwareCanvas
- HardwareRenderer$Gl20Renderer
- HardwareRenderer$GlRenderer
- HardwareRenderer
- libandroid_runtime.so
- libandroid_servers.so
- libmedia_jni.so
NOW ZIP YOUR ROM AND POST IT BUT DON'T FORGET TO GIVE CREDITS TO THE DEVELOPER OF PORT ROM..
IF YOU WANT TO PORT ROM WITH ONE OR TWO CLICKS, THEN GO TO THIS THREAD--[TOOL] Rom Porter or[Tool] ROM Porter
IF IT HELPED YOU THAN PRESS THANKS AND RATE THIS POST 5 STARS...
There is a solution to find the problems which are causing BOOTLOOPS OR OTHER PROBLEMS IN YOUR PORT ROM..
The SOLUTION IS TO TAKE A LOGCAT..
LOGCAT ARE OF TWO TYPES:
- In your Phone(if the ROM is booting)
- Through adb(if you are stuck in bootloop)
In your Phone:
There are two ways to take LOGCAT in mobile:
FIRST WAY--THROUGH APPS WHICH ARE MADE TO TAKE LOGCAT:
There are two apps which you can use to take a LOGCAT..
They are aLogcat or Catlog.
Taking logcat through apps is very easy.
SECOND WAY--THROUGH TERMINAL EMULATOR
SEE THE INSTRUCTIONS BELOW TO TAKE A LOGCAT THROUGH adb
HOW TO MAKE PC READY FOR LOGCAT?
IN WINDOWS:
Download Android SDK From Here
Install or Extract it to your desired Directory..
You also need to install Java JDK.
Download it here
In the Guide, we are taking C: as the Root Directory and android as the main Folder
- Navigate to Android SDK folder and open 'SDK Manager.exe'
- Only check 'Android SDK Tools' and 'Android SDK Platform-tools'
- First connect the device via USB to your computer
- Be sure to have USB debugging enabled
- Now Navigate to C:/Android/android-sdk/platform-tools/
- Now Open a Command Prompt there By holding Shift+Right Click Button
IN LINUX:
IMPORTANT: If someone has a 64bit linux then they need to download 32-bit libs
for this, before all these steps run this:
sudo apt-get install ia32-libs
If you have not installed them, Android SDK from here and Java JDK in this way:
sudo add-apt-repository ppa:ferramroberto/javasudo apt-get updatesudo apt-get install sun-java6-jdk sun-java6-jre sun-java6-pluginOR$ sudo add-apt-repository ppa:sun-java-community-team/sun-java6$ sudo apt-get update$ sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk
This process saves a lot of storage. It uses the Ubuntu Touch ppa:
sudo add-apt-repository ppa:phablet-team/toolssudo apt-get install android-tools-adb
sudo apt-get install android-tools-fastboot
Make a new directory by this command in terminal:
mkdir android
tar -zxvf ~/Downloads/android-sdk_r21.0.1-linux.tgz
mv android-sdk-linux ~/android/sdk
android/sdk/tools/android
Go into your Home folder and Press CTRL+H (This is done to show hidden folders and files)
Look for the file '.bashrc'
Open it and put the following or similar:
export PATH=$PATH:~/android/sdkexport PATH=$PATH:~/android/sdk/platform-toolsexport PATH=$PATH:~/android/sdk/tools
Open terminal(Ctrl+alt+T) and enter:
sudo gedit /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"
sudo chmod +x /etc/udev/rules.d/51-android.rules
sudo gedit /etc/rc.local
now add the line mentioned below just above where it is written exit 0
/home/user/android/sdk/platform-tools/adb start-server
After this we don't need to cd to adb directory..We just have to type adb devices and the phone will surely show up.
Now that everything is installed
Open terminal and type:
android
cd ~/android/sdk/tools./android
HOW TO TAKE LOGCAT?
To verify that the device is connected Type:
adb devices
adb logcat > logcat.txt
You can also type:
adb logcat -f logcat.txt
adb logcat -v long > logcat.txt
Note: When outputting to a file, you will see a newline, but nothing printed, this is normal. To stop logcat from writting to a file, you need to press ctrl+c.
Meanings of symbols in a logcat !
You usually see this at the start of a sentence in logcat .
I/> ===> Information
S/> ===> Silent
D/> ===> Debug
W/> ===> Warning
E/> ===> Error
F/> ===> Fatal
CREDITS:
blahbl4hblah
paxChristos
Standard build.prop properties
Please read the hashed out lines : It is selfexplanatory.
So the normal build properties start with:
# begin build properties# autogenerated by buildinfo.sh
This mentions that the build prop is built by build info shell script during the compilation of the ROM.
#First up the build id (Here JZO54K) is the build id for the version number for Jellybean 4.1.2ro.build.id=JZO54K#It is the version of the ROM which appears in the about phone. This is a cm10 build by sakindia123.ro.build.display.id=cm_pico-userdebug 4.1.2 JZO54K eng.sakindia123.20121117.161006 test-keys#This is the software development kit version which is needed and used for building the ROM.ro.build.version.incremental=eng.sakindia123.20121117.161006ro.build.version.sdk=16#3's codename.ro.build.version.codename=REL#This is the android version of the ROM.ro.build.version.release=4.1.2#This is the time and date of when the ROM and Kernel were built together. (ROM only).ro.build.date=Sat Nov 17 16:10:21 GMT 2012#More details in the kernel.ro.build.date.utc=1353168621#Userdebug ROMs has usb debugging set to 0 and eng are for general release.ro.build.type=userdebug#Name of the person building the ROM & kernel.ro.build.user=sakindia123ro.build.host=build1#Test keys suggests that the ROM is not an official version of the ROM. Release keys are for official releases.ro.build.tags=test-keys
This part of the build prop shows the information about our phone and not the build of the ROM of our phone.
#Model of our devicero.product.model=HTC Explorer A310e#Brand of device. ( In some case carrier ) for which the android version has been made for.ro.product.brand=htc_europe#Name is an alternative ( codename ) of the device during its development. For Explorer its pico, for Nexus 7 : grouper for Nexus 4 : mako for SG Ace its cooper etc.ro.product.name=picoro.product.device=picoro.product.board=pico#It is the first instruction set (CPU + ABI convention type) of the code. Ours is an arm type arch cpu and abi version 7a )ro.product.cpu.abi=armeabi-v7aro.product.cpu.abi2=armeabi#Name of manufacturer.ro.product.manufacturer=HTC#Language of the software ( read ROM)ro.product.locale.language=en#Region of operation of software.ro.product.locale.region=USro.wifi.channels=#Name of board on which software has been built.ro.board.platform=msm7x27a# ro.build.product is obsolete; use ro.product.devicero.build.product=pico# Do not try to parse ro.build.description or .fingerprint Never attempt to modify this value ! This can lead to bootloop (possibly hard brick) of your phone. This is the unique fingerprint of the software of your phone.ro.build.description=cm_pico-userdebug 4.1.2 JZO54K eng.sakindia123.20121117.161006 test-keysro.build.fingerprint=htc_europe/htc_pico/pico:2.3.5/GRJ90/207463.1:user/release-keysro.build.characteristics=defaultro.cm.device=pico# end build properties#
What is RIL?
A Radio Interface Layer (RIL) is a layer in an operating system which provides an interface to the hardware's radio and modem on e.g. a mobile phone.
RIL Properties:
#These are basically the links between your phones hardware and software , i.e. it tells your phone where to find the libs for RIL and also detects whether you have any arguments in place of the operation of your libs to provide to the vendor.rild.libpath=/system/lib/libhtc_ril.sorild.libargs=-d /dev/smd0rilswitch.vendorlibpath=/system/lib/libhtc_ril.so#ril.subscription.types=NV,RUIM#Architecture of baseband radio.ro.baseband.arch = msm#ro.ril.ecc.HTC-xxx=nnn,nnn,nnn#These are basically the emergency call numbers(codes) for your phone. Its different according to your region. ( here xxx ) . The numbers can be 911 , 101,100 etc etc ( here nnn)ro.ril.ecc.HTC-GCC=999,112,997ro.ril.ecc.HTC-WWE=999ro.ril.ecc.HTC-Dutch=112ro.ril.ecc.HTC-SPA=112, 911,112, 911ro.ril.ecc.HTC-FRA=112,911ro.ril.ecc.HTC-ITA=112,911ro.ril.ecc.HTC-EastEurope=112#Something to do with GPRS, AFAIK.ro.ril.enable.a52.HTC-ITA=1ro.ril.enable.a53.HTC-ITA=1ro.ril.enable.a52=0ro.ril.enable.a53=1#HSDPA category : High speed downlink packet access category. ( 8 == 7.2 mbit/s )ro.ril.hsdpa.category=8#HSXPA : High speed ( type ) packet . ( values 1- HSDPA 2-HSDPA/HSUPA ( High speed uplink packet access )ro.ril.hsxpa=1#Something to do with 3G.ro.ril.fast.dormancy.rule=1#ro.ril.disable.fd.plmn.prefix=23402,23410,23411,23420,27202#Ability of enabling data roaming.ro.ril.enable.managed.roaming=1#Class of GPRS network that needs to be routed to phone.ro.ril.gprsclass=10#No sim emergency call codes listro.ril.oem.nosim.ecclist=911,112,999,000,08,118,120,122,110,119,995#ro.ril.emc.mode=2#This is somehow related to mobile data and its stablility. ( adding skipbrokendatacall adds stability ).ro.telephony.ril.v3=signalstrength,singlepdp,skipbrokendatacall#ro.ril.htcmaskw1.bitmask = 4294967295#ro.ril.htcmaskw1 = 14449#Related to ril audio.ro.ril.update.acoustic.table = 1#ro.ril.avoid.pdp.overlap = 1#Default type of data connection.ro.telephony.default_network = 0
Wi-Fi Related:
# Time between scans in seconds. Keep it high to minimize battery drain.# This only affects the case in which there are remembered access points,# but none are in range.wifi.supplicant_scan_interval=180wifi.interface=eth0wifi.softap.interface=eth0
# density in DPI of the LCD of this board. This is used to scale the UI# appropriately. If this property is not defined, the default value is 160 dpi.ro.sf.lcd_density = 160
# View configuration for QVGAview.fading_edge_length = 8view.touch_slop = 15view.minimum_fling_velocity = 25view.scroll_friction = 0.008
# The OpenGL ES API level that is natively supported by this device.# This is a 16.16 fixed point numberro.opengles.version = 131072
# For no auto focus devicesro.workaround.noautofocus = 1# Increase SKIA decode memory capability for progressive jpg filero.media.dec.jpeg.memcap = 20000000# For QC perf binary hooks# src:vendor/qcom/proprietary/android-perf/release/lib/<CPU arch>/libqc-opt.soro.vendor.extension_library=/system/lib/libqc-opt.so
Additional Build Properties:
# Misc.#There is a provision.apk in system/app requires this line.DEVICE_PROVISIONED=1#Enabling certain audio libs.htc.audio.alc.enable = 1htc.audio.swalt.enable = 1#Least amount of RAM that can be given to any application to run.dalvik.vm.heapsize=48m#OpenGL 2.x.xro.opengles.version = 131072#this is actually the software composition method. CAF suggests mdp for msm7x27a boardsdebug.composition.7x27A.type=mdp#media.stagefright is nothing but the type of media framework that is being supported and its various properties are in the build.prop. ( type of media playback : local media as well as online streaming like 3gp mpeg mp4 etc etc ).media.stagefright.enable-player=truemedia.stagefright.enable-scan=truemedia.stagefright.enable-http=truemedia.stagefright.enable-fma2dp=truemedia.stagefright.enable-aac=truemedia.stagefright.enable-qcp=truero.use_data_netmgrd=truepersist.data.ds_fmc_app.mode=0#It is the pixel format of RGB 565 with a constant value of 4ro.staticwallpaper.pixelformat=RGB_565#Something to do with app + data cache.ro.max.fling_velocity=4000#HTML Related.httplive.enable.discontinuity=true#Some thing with surface flinger hardware, aka our gpu.( probably framerate)dev.pm.dyn_samplingrate=1#Probably sampling rate of all media. ( Sound , picture quality etc etc . )dev.pm.dyn_sample_period=700000com.qc.hardware=true#Something to do with the processes of above names.com.qc.hdmi_out=false#--debug.camcorder.disablemeta=0debug.qctwa.statusbar=1debug.qctwa.preservebuf=1debug.enabletr=false#debug surface flinger hardware. One of the best known tweaks , i.e. GPU Hardware acceleration.debug.sf.hw=1#Encoding media quality (jpeg)ro.media.enc.jpeg.quality=100#Setupwizard ( google or otherwise ) enablingro.setupwizard.mode=OPTIONAL#Related to Hardware acceleration settingshwui.print_config=choicehwui.disable_vsync=true#By pass setup wizard.ro.setupwizard.enable_bypass=1#Media decoding of audio and video of wma and wmv formats respectively.ro.media.dec.aud.wma.enabled=1ro.media.dec.vid.wmv.enabled=1#Sync enabled at bootup.ro.config.sync=yes#something to do with phone storage. ( probably install location .. not sure)ro.phone_storage=0#hardware platform. msm7x27a.ro.hw_plat=7x27a#Hwuihwui.use.blacklist=true
Original thread-
[REF] Build prop terminology [INFO]
CREDITS:
akshat.shenoy for his hard work
- [GUIDE]How To Port Different ROMS to Your Device (Simplest and Fastest)
- [GUIDE]How To Port Different ROMS to Your Device (Simplest and Fastest)
- How to Dual Boot Multiple ROMs on Your Android Phone
- How to Dual boot Multiple ROMs on Your Android SmartPhone (Upto Five Roms)?
- [Guide] How to install Google Apps (GApps) on your Android Device / Phone
- HOW TO RUN YOUR WEB SERVER AND MQTT WEBSOCKETS BROKER ON THE SAME PORT
- HOW TO RUN YOUR WEB SERVER AND MQTT WEBSOCKETS BROKER ON THE SAME PORT
- How to change your USB Serial Port COM number?
- How to package and distribute your apps
- Your visual how-to guide for SELinux policy enforcement
- port firefox to ios4 device
- How to get control of your time and your life
- HOW to get control your time and your life
- How to get control of your time and your life
- 《How to Get Control of Your Time and Your Life》
- How to use SCAN and node listeners with different ports?
- How to consume your time in your developing and how to use a efficient way?
- Use intent and Uri to interact with your anroid device,.
- SVM 支持向量机(2) 软间隔最大化与核方法
- 论中英文写作思维与算法的关系
- Android中关于AudioFocus你所该知道的知识
- 本地环境和远程环境的maven自动部署到tomcat配置说明
- SPOJ-SERGRID Grid(BFS)
- [GUIDE]How To Port Different ROMS to Your Device (Simplest and Fastest)
- 整数划
- 手把手教你用Mysql-Cluster-7.5搭建数据库集群
- 图片转化成base64-API上传
- ES6——Day3(解构赋值的用途)
- CentOS7.2部署ELK5.2.2(yum安装)
- 1的个数
- java.util.concurrent 源码分析-包结构
- Python核心编程第十章客后练习答案