[GUIDE]How To Port Different ROMS to Your Device (Simplest and Fastest)

    xiaoxiao2021-03-25  66

    原文地址: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.. Quote:

    What is base Rom:

    Quote:

    The ROM which is Developed For your Mobile..

    Quote:

    What is Port Rom:

    Quote:

    The Rom Which you want to port to your Device.

    Quote:

    STEP1;

    Quote:

    Take any clean CM9, AOSP, CM7, CM10, CM11 ROM which is running on your device as Base ROM.

    Quote:

    STEP2:

    Quote:

    Extract it Using Winrar.

    Quote:

    STEP3:

    Quote:

    Take the ROM you want to port. This Port ROM. Extract it also using Winrar.

    Quote:

    STEP4:

    Quote:

    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)

    Quote:

    STEP5:

    Quote:

    Now copy app, Framework, Fonts and Media folder in System Folder from Port rom to base rom system folder.

    Quote:

    STEP6:

    Quote:

    Now open etc folder in both the ROMs folder.

    Quote:

    STEP7:

    Quote:

    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.d Folder 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.

    Quote:

    STEP8:

    Quote:

    Now open buid.prop file using Notepad++ and make changes to these of Base Rom as you wish.

    Quote:

    ro.build.id= ro.build.display.id= ro.build.date= ro.modversion=

    Quote:

    STEP9:

    Quote:

    In build.prop file change these to same as Port Rom build.prop values.

    Quote:

    ro.config.ringtone= ro.config.notification_sound= ro.config.alarm_alert=

    Also Copy anything you Find Extra in ADDITIONAL BUILD PROPERTIES related to theme.. Quote:

    STEP10:

    Quote:

    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.

    Quote:

    STEP11:

    Quote:

    If You find any extra file or folder in system folder of PORT rom than copy them to your base rom system folder.

    Quote:

    STEP12:

    Quote:

    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..

    FOR MIUI: Quote: Quote:

    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

    Quote:

    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

    Quote:

    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

    FOR ParanoidAndroid And PAC: Quote: Quote:

    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:

    Code: set_perm(1000, 1000, 0644, "/system/etc/paranoid/properties.conf"); Quote:

    Specially For PA:

    Quote:

    Now Open Build.prop in /system with Notepad++ Copy these lines in Additional Properties of Build.prop:

    Code: #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 Quote:

    Specially For PAC Rom:

    Quote:

    Now Open Build.prop in /system with Notepad++ Copy these lines in Additional Properties of Build.prop:

    Code: #Replace the x.x.x with your PAC Rom version ro.pac.version=x.x.x #Customize these lines according to your wish. ro.pacrom.version=mesona_PAC_jb-alpha-v19.0.0 ro.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 version ro.aokp.version=mesona_jb-Milestone-1 #Modify it according to your base ROM's build.prop ro.cm.version=xxxxxxxxxxxx Replace any line in Your build.prop which appear twice mainly ro.cm.version and ro.modversion Quote:

    For HTC Devices:

    Quote:

    To fix network auto select-

    Quote: Decompile framework-res.apkGo to \framework-res\res\values\bools.xml and change change <bool name="skip_restoring_network_selection">true</bool> to false Quote:

    To Fix Graphichal issues:

    Quote: Decompile framework.jarChange these files with your base smali\smali\android\osEnvironmentSystemPropertiessmali\smali\android\viewHardwareCanvasHardwareRenderer$Gl20RendererHardwareRenderer$GlRendererHardwareRenderer IF YOU ARE HAVING BOOTLOOP THEN COPY THESE LIB FILES TO BASE ROM FROM PORT ROM: Quote: libandroid_runtime.solibandroid_servers.solibmedia_jni.so IF YOUR BASE ROM HAS ISSUES LIKE CAMERA ISSUE THAN YOUR PORTED ROM TOO WILL HAVE ISSUES. 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... Quick Reply Reply The Following 1,353 Users Say Thank You to rishabh.raj37 For This Useful Post: [ View ] Gift rishabh.raj37 Ad-Free   rishabh.raj37 27th September 2012, 12:30 PM | #2   OP Senior Member Ranchi Thanks Meter: 4,246   Donate to Me More How to logcat? I know that many of you are having problems while porting and I know that those problems cannot be solved simply by guesswork.. 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.. Quote:

    LOGCAT ARE OF TWO TYPES:

    Quote: In your Phone(if the ROM is booting)Through adb(if you are stuck in bootloop) Quote:

    In your Phone:

    Quote:

    There are two ways to take LOGCAT in mobile:

    Quote:

    FIRST WAY--THROUGH APPS WHICH ARE MADE TO TAKE LOGCAT:

    Quote:

    There are two apps which you can use to take a LOGCAT.. They are aLogcat or Catlog. Taking logcat through apps is very easy.

    Quote:

    SECOND WAY--THROUGH TERMINAL EMULATOR

    Quote:

    SEE THE INSTRUCTIONS BELOW TO TAKE A LOGCAT THROUGH adb

    Quote:

    HOW TO MAKE PC READY FOR LOGCAT?

    Quote:

    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 computerBe sure to have USB debugging enabledNow Navigate to C:/Android/android-sdk/platform-tools/Now Open a Command Prompt there By holding Shift+Right Click Button Quote:

    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:

    Code: sudo apt-get install ia32-libs Make sure that you have Android-SDK and JDK downloaded on your PC If you have not installed them, Android SDK from here and Java JDK in this way: Code: sudo add-apt-repository ppa:ferramroberto/java sudo apt-get update sudo apt-get install sun-java6-jdk sun-java6-jre sun-java6-plugin OR $ 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 OR You Can Simply Do This: (Credits to @Androguide.fr) This process saves a lot of storage. It uses the Ubuntu Touch ppa: Code: sudo add-apt-repository ppa:phablet-team/tools sudo apt-get install android-tools-adb You can also install fastboot in the same fashion: Code: sudo apt-get install android-tools-fastboot Then follow the Below Instructions Carefully: Make a new directory by this command in terminal: Code: mkdir android Then extract the downloaded SDK by Code: tar -zxvf ~/Downloads/android-sdk_r21.0.1-linux.tgz Then move it to the directory we just made Code: mv android-sdk-linux ~/android/sdk Then open android sdk manager by Code: android/sdk/tools/android This will open Android sdk manager. Just select android sdk tools and android sdk platform tools for adb and then select install packages 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: Code: export PATH=$PATH:~/android/sdk export PATH=$PATH:~/android/sdk/platform-tools export PATH=$PATH:~/android/sdk/tools You will need to add something for any devices to be recognized: Open terminal(Ctrl+alt+T) and enter: Code: sudo gedit /etc/udev/rules.d/51-android.rules Enter the following in the file: Code: 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" Now save and close the file, and in terminal enter: Code: sudo chmod +x /etc/udev/rules.d/51-android.rules Now Type: Code: sudo gedit /etc/rc.local This will open a file now add the line mentioned below just above where it is written exit 0 Code: /home/user/android/sdk/platform-tools/adb start-server "Enter your username in place of user" 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: Code: android OR, if that doesn't work Code: cd ~/android/sdk/tools ./android Quote:

    HOW TO TAKE LOGCAT?

    Quote:

    To verify that the device is connected Type:

    Code: adb devices Now type: Code: adb logcat > logcat.txt The LOGCAT will be Saved in the logcat.txt File You can also type: Code: adb logcat -f logcat.txt Or Code: adb logcat -v long > logcat.txt With the -v flag & the long argument, it changes output to long style, which means every line of logcat will be on its own line (makes it a little neater, imo) 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. Quote:

    Meanings of symbols in a logcat !

    Quote:

    You usually see this at the start of a sentence in logcat . I/> ===> Information S/> ===> Silent D/> ===> Debug W/> ===> Warning E/> ===> Error F/> ===> Fatal

    Quote:

    CREDITS:

    Quote:

    blahbl4hblah paxChristos

    Quick Reply Reply The Following 188 Users Say Thank You to rishabh.raj37 For This Useful Post: [ View ] Gift rishabh.raj37 Ad-Free rishabh.raj37 27th September 2012, 12:30 PM | #3   OP Senior Member Ranchi Thanks Meter: 4,246   Donate to Me More Build.prop and Updater-Script Terminology and Guide to Edit it Quote:

    Standard build.prop properties Please read the hashed out lines : It is selfexplanatory. So the normal build properties start with:

    Code: # begin build properties # autogenerated by buildinfo.sh Quote:

    This mentions that the build prop is built by build info shell script during the compilation of the ROM.

    Code: #First up the build id (Here JZO54K) is the build id for the version number for Jellybean 4.1.2 ro.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.161006 ro.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=sakindia123 ro.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 Quote:

    This part of the build prop shows the information about our phone and not the build of the ROM of our phone.

    Code: #Model of our device ro.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=pico ro.product.device=pico ro.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-v7a ro.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=US ro.wifi.channels= #Name of board on which software has been built. ro.board.platform=msm7x27a # ro.build.product is obsolete; use ro.product.device ro.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-keys ro.build.fingerprint=htc_europe/htc_pico/pico:2.3.5/GRJ90/207463.1:user/release-keys ro.build.characteristics=default ro.cm.device=pico # end build properties # System properties:: Quote:

    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:

    Code: #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.so rild.libargs=-d /dev/smd0 rilswitch.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,997 ro.ril.ecc.HTC-WWE=999 ro.ril.ecc.HTC-Dutch=112 ro.ril.ecc.HTC-SPA=112, 911,112, 911 ro.ril.ecc.HTC-FRA=112,911 ro.ril.ecc.HTC-ITA=112,911 ro.ril.ecc.HTC-EastEurope=112 #Something to do with GPRS, AFAIK. ro.ril.enable.a52.HTC-ITA=1 ro.ril.enable.a53.HTC-ITA=1 ro.ril.enable.a52=0 ro.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 list ro.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 Quote:

    Wi-Fi Related:

    Code: # 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=180 wifi.interface=eth0 wifi.softap.interface=eth0 Density(DPI) Related: Code: # 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 Display and OpenGLrelated Code: # View configuration for QVGA view.fading_edge_length = 8 view.touch_slop = 15 view.minimum_fling_velocity = 25 view.scroll_friction = 0.008 Code: # The OpenGL ES API level that is natively supported by this device. # This is a 16.16 fixed point number ro.opengles.version = 131072 Code: # For no auto focus devices ro.workaround.noautofocus = 1 # Increase SKIA decode memory capability for progressive jpg file ro.media.dec.jpeg.memcap = 20000000 # For QC perf binary hooks # src:vendor/qcom/proprietary/android-perf/release/lib/<CPU arch>/libqc-opt.so ro.vendor.extension_library=/system/lib/libqc-opt.so Quote:

    Additional Build Properties:

    Code: # Misc. #There is a provision.apk in system/app requires this line. DEVICE_PROVISIONED=1 #Enabling certain audio libs. htc.audio.alc.enable = 1 htc.audio.swalt.enable = 1 #Least amount of RAM that can be given to any application to run. dalvik.vm.heapsize=48m #OpenGL 2.x.x ro.opengles.version = 131072 #this is actually the software composition method. CAF suggests mdp for msm7x27a boards debug.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=true media.stagefright.enable-scan=true media.stagefright.enable-http=true media.stagefright.enable-fma2dp=true media.stagefright.enable-aac=true media.stagefright.enable-qcp=true ro.use_data_netmgrd=true persist.data.ds_fmc_app.mode=0 #It is the pixel format of RGB 565 with a constant value of 4 ro.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=700000 com.qc.hardware=true #Something to do with the processes of above names. com.qc.hdmi_out=false #-- debug.camcorder.disablemeta=0 debug.qctwa.statusbar=1 debug.qctwa.preservebuf=1 debug.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 ) enabling ro.setupwizard.mode=OPTIONAL #Related to Hardware acceleration settings hwui.print_config=choice hwui.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=1 ro.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 #Hwui hwui.use.blacklist=true Quote:

    Original thread-

    Quote:

    [REF] Build prop terminology [INFO]

    Quote:

    CREDITS: akshat.shenoy for his hard work

    转载请注明原文地址: https://ju.6miu.com/read-23728.html

    最新回复(0)