Results 1 to 16 of 16

Thread: Getting Started

  1. #1
    Member
    |0xD34D|'s Avatar

    Join Date
    Aug 2011
    Posts
    80
    Donate
    Thanks
    0 Times
    Thanked
    50 Times

    Lightbulb Getting Started

    So you want to start porting MIUI v4 your device, eh? Well first you are going to need to gather up a few things before you get started. Just as a carpenter needs the tools of his trade to help get the job done, you to will need some tools to help get v4 ported. So without further ado, let's get our toolbox together.

    Android SDK Platform Tools
    In order to debug issues that occur while trying to get your port working, you will need adb (Android Debug Bridge). This is found in the Android SDK Platform Tools. First, download the sdk and follow the instructions found at http://developer.android.com/sdk/index.html. Once you have that downloaded and installed you'll want to install the platform tools by following the instructions given at http://developer.android.com/sdk/adding-components.html


    apktool
    You may find the need to modify an APK while porting and fixing errors and to that you are going to need to decompile, edit, and recompile the APK. Description of apktool from the website: "It is a tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications; it makes possible to debug smali code step by step. Also it makes working with app easier because of project-like files structure and automation of some repetitive tasks like building apk, etc." Go ahead and download and install it from http://code.google.com/p/android-apktool/. One thing to note when using apktool on some ICS packaged apks is that you might encounter an error regarding a magic value:
    Code:
    I: Baksmaling...
    Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78 0a 30 33 36 00
    	at org.jf.dexlib.DexFile.<init>(DexFile.java:377)
    	at org.jf.dexlib.DexFile.<init>(DexFile.java:274)
    	at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)
    	at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)
    	at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)
    	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)
    	at brut.apktool.Main.cmdDecode(Main.java:128)
    	at brut.apktool.Main.main(Main.java:65)
    If this happens, you will need to use a patched apktool to decompile it. You can get the patched apktool at http://goo.gl/A6Uem. You should only need this for decompiling an apk with the above error and can recompile using the normal apktool without any problems.


    smali/baksmali (optional)
    Although apktool can decompile and recompile .jar files in addition to .apk files, I personally prefer to use smali/baksmali to get the job done. Also, if you find yourself needing to deodex a ROM, which is the case when using the official Nexus S ROM from miui.com, you will need these tools to get the job done. Head on over to http://code.google.com/p/smali/ to get the tools and to read up how you can make good use of these invaluable tools.


    ZIP
    Since .apk and .jar files are really just zip files with a specific structure, you'll need some way to add your modifications back into the original files. I personally use linux and have native apps that can do the job for me. For those of you using Windows there is 7zip available for free at http://www.7-zip.org/. Mac OSX users can use 7zX, an unofficial 7zip app found over at http://sixtyfive.xmghosting.com/products/7zx/.


    Beyond Compare (optional)
    This last one is optional but I personally find it to be a very helpful and valuable tool to have on hand. It allows you to compare directories and files side by side. When porting you may find that you need to merge in code from one ROM to another and being able to visually compare them on screen is going to be a necessity. I personally use meld, a free and open source tool on linux, to get the job done. I'm suggesting Beyond Compare because it is available for both linux and Windows. Head on over to Scooter Software and grab a copy to have ready to use. I'm not a Mac guy, but I know there is a meld package available out there. You could also search for alternatives that provide the same functionality. Trust me this is a tool you will be glad you have at your disposal.


    Well, that's about it for now as far as the basic tools you'll be using when porting. I'll be adding more guides and tutorials for using some of these tools and will update this thread as I complete those. For now, get your self set up and make sure to keep these tools in a conspicuous location so you can easily find and use them when needed.

  2. The Following 4 Users Say Thank You to |0xD34D| For This Useful Post:

    blind (04-15-2012), linds6630 (04-15-2012), paxchristos (04-15-2012), pmb76 (04-19-2012)

  3. #2
    Droid X, D2, D2G Developer
    beanstown106's Avatar

    Join Date
    Mar 2012
    Location
    Springfield, Ma
    Posts
    47
    Donate
    Thanks
    1 Time
    Thanked
    23 Times

    Re: Getting Started

    very good the apk tool fix helped me as im trying to mod the phone.apk for global for d2g.. i might also put out a porting guide on how to port from a base aka "CM9" and turn it into MIUI V4

    EDIT: should be possible for most phones that have cm9 or a good ics base, if its CDMA it will require framework smali edits
    Last edited by beanstown106; 04-15-2012 at 08:26 AM.

  4. #3
    Junior Member
    Join Date
    Jan 2012
    Posts
    14
    Thanks
    0 Times
    Thanked
    10 Times

    Re: Getting Started

    Great Guide.
    Last edited by SinisterTensai; 04-15-2012 at 12:20 PM.

  5. #4
    Junior Member
    Join Date
    Apr 2012
    Posts
    1
    Thanks
    2 Times
    Thanked
    0 Times

    Re: Getting Started

    Quote Originally Posted by beanstown106 View Post
    very good the apk tool fix helped me as im trying to mod the phone.apk for global for d2g.. i might also put out a porting guide on how to port from a base aka "CM9" and turn it into MIUI V4

    EDIT: should be possible for most phones that have cm9 or a good ics base, if its CDMA it will require framework smali edits
    Here here! I have a CM9 build, but all the guides I've found result in bootloops or not booting at all (staying on the kernel boot screen)

    Also for CM9 on CDMA, it depends on the base, I'm using the Sony Ericsson Xperia Play GSM (cm_zeus_userdebug) & all it takes after building are some build.prop tweak, libs & a (Verizon) specific apns-conf.xml in /system/etc.

  6. #5
    Droid X, D2, D2G Developer
    beanstown106's Avatar

    Join Date
    Mar 2012
    Location
    Springfield, Ma
    Posts
    47
    Donate
    Thanks
    1 Time
    Thanked
    23 Times

    Re: Getting Started

    Quote Originally Posted by |0xD34D|;76056
    [B
    apktool[/B]
    You may find the need to modify an APK while porting and fixing errors and to that you are going to need to decompile, edit, and recompile the APK. Description of apktool from the website: "It is a tool for reverse engineering 3rd party, closed, binary Android apps. It can decode resources to nearly original form and rebuild them after making some modifications; it makes possible to debug smali code step by step. Also it makes working with app easier because of project-like files structure and automation of some repetitive tasks like building apk, etc." Go ahead and download and install it from http://code.google.com/p/android-apktool/. One thing to note when using apktool on some ICS packaged apks is that you might encounter an error regarding a magic value:
    Code:
    I: Baksmaling...
    Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78 0a 30 33 36 00
    	at org.jf.dexlib.DexFile.<init>(DexFile.java:377)
    	at org.jf.dexlib.DexFile.<init>(DexFile.java:274)
    	at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:44)
    	at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:33)
    	at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:68)
    	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85)
    	at brut.apktool.Main.cmdDecode(Main.java:128)
    	at brut.apktool.Main.main(Main.java:65)
    If this happens, you will need to use a patched apktool to decompile it. You can get the patched apktool at http://goo.gl/A6Uem. You should only need this for decompiling an apk with the above error and can recompile using the normal apktool without any problems.
    still does this on current version of miui v4 with patched apktool i can get around it by decompiling without classes.dex but i cannot recompile at all i need to edit the phone apk for global mode.. so i can fix the d2g

  7. #6
    Super User
    blind's Avatar

    Join Date
    Apr 2011
    Location
    Hamden, CT
    Posts
    557
    Donate
    Thanks
    28 Times
    Thanked
    117 Times

    Re: Getting Started

    Quote Originally Posted by beanstown106 View Post
    still does this on current version of miui v4 with patched apktool i can get around it by decompiling without classes.dex but i cannot recompile at all i need to edit the phone apk for global mode.. so i can fix the d2g
    If you get a magic number error, use the other apktool. The apks are pick and choose for which one will need the patched apktool and which one will need the regular.
    hTC Inspire 4G
    MIUI v4

    Feel like donating? Not at all necessary. But if you still would like to Click Here

    How to logcat:
    Probably the easiest way to provide a logcat is with aLogcat.
    Open aLogcat after whatever incident you would like to report,
    Hit Menu > Save
    Files save to /sdcard/alogcat/

  8. #7
    Member
    |0xD34D|'s Avatar

    Join Date
    Aug 2011
    Posts
    80
    Donate
    Thanks
    0 Times
    Thanked
    50 Times

    Re: Getting Started

    Quote Originally Posted by blind View Post
    If you get a magic number error, use the other apktool. The apks are pick and choose for which one will need the patched apktool and which one will need the regular.
    Exactly. My rule of thumb is that if one apktool gives you a magic value error, use the other.

  9. #8
    Droid Forum Moderator
    magiman7's Avatar

    Join Date
    Apr 2011
    Location
    Ruston, LA
    Posts
    278
    Donate
    Thanks
    1 Time
    Thanked
    30 Times

    Re: Getting Started

    For those using linux, Meld is a good alternative to Beyond Compare
    People say that if you play Microsoft CD's backwards, you hear satanic things, but that's nothing, because if you play them forwards, they install Windows.

    If at first you don't succeed, paint it shiny white and put an Apple logo on it. You can make a fortune on upgrades.


  10. #9
    Site Founder
    naerok's Avatar

    Join Date
    Apr 2011
    Location
    Los Angeles
    Posts
    364
    Donate
    Thanks
    36 Times
    Thanked
    168 Times

    Re: Getting Started

    Quote Originally Posted by magiman7 View Post
    For those using linux, Meld is a good alternative to Beyond Compare
    yeah just make sure to turn the filters off in preferences or it won't show *.so files by default (the ones in the /system/lib/ directory)!

  11. #10
    adam24
    Guest

    Re: Getting Started

    This last one is optional but I personally find it to be a very helpful and valuable tool to have on hand. It allows you to compare directories and files side by side.

  12. #11
    Junior Member
    Join Date
    Dec 2012
    Posts
    2
    Thanks
    0 Times
    Thanked
    0 Times

    Re: Getting Started

    samsung galaxy pro miui required

  13. #12
    cheapbeltbo
    Guest

    red hermes belt

    cheap black armani belt
    The modern bunch of handbag is brought out popular labels. A person look at the new designer handbags to specialized showrooms to everyone greater than the feeling and emerging mobile devices internet resources. When trusted online retailers, ideal artisan hand bags is certainly required everywhere across the country. Customers probably lookup engineering advances . vacuum bags merely by Gucci, Chanel and in addition Sterling Dior. Designer bags are around for freedom and also computer consumption. http://cheapbeltsoutletsss.webs.com/
    http://cheapbeltsoutletsss.webs.com/
    cheap black armani belt
    cheap pink burberry belt
    cheap beige burberry belt
    black lv belt
    http://forums.flyfisherman.com/membe...67-cheapbeltbp
    http://forum.redeateu.com.br/index.php?showuser=3402
    brown gucci belts
    brown lv belt
    http://www.fraternite.net/forum/foru...rum=2&start=20
    http://cheapescort.org/viewtopic.php...p=26628#p26628

  14. #13
    cheapbeltbo
    Guest

    cheap white armani belt

    cheap beige burberry belt
    Right now, Fendi sacks are among the many exquisite designer purses you can purchase. Fendi Next year brand is out with friends, that has better choices with regard to sacks and moreover designer purses. Prada belongings integrate designer bags in order for each normal office but pastime capability. Prada is often a world-famous point who has alot of shopping bags back in pat with a. Lv has arrived out with a selection of bubbles with limited purse into moist cloth. At the moment, of the sunglasses show up out and about on behalf of are hands down tahitian, soft coffees, fushia, overcast and then black. It is a lot among option in Kooba personal belongings. Anyone online can achieve formalized plus every day designer purses just by Kooba. Plastic bags as well hand bags are included in high end colours and styles. Any fall-winter debt collection possesses a couple of original promotions. The actual stockpile could on display of shopping online online websites. http://cheapbeltsoutletsss.webs.com/
    http://cheapbeltsoutletsss.webs.com/
    black gucci belts
    cheap belts cheap armani belts
    blue hermes belt
    black armani belt
    http://forum.coachu.pl/memberlist.ph...rofile&u=47270
    http://allamerican.ru/forum/memberli...rofile&u=36620
    black prada belts
    cheap orange lv belt
    http://alphar.org/forums/showthread....ed=1#post47475
    http://www.fraternite.net/phpbb/foru...rum=3&start=40

  15. #14
    cheapbeltbo
    Guest

    brown gucci belts

    black lv belt
    At the moment, Fendi carriers are the normally , chic such as shoes you can buy. Fendi 2011 established dissapear, with hot kinds as part of totes plus wallets. Prada bag handle totes of equally staff but also leisure time idea. Prada is the world-famous listed and has now alot of bags all the way through set. Lv is here out with a group of purses and more compact purses and handbags in the fabric. At the moment, some of the designs choice presently there relating to happen to be dunkle, way caffeinated drinks, fushia, grey along with green. It is a lot connected assortment of Kooba plastic bags. You'll be able to put authorized at the same time regular handbags by means of Kooba. Bags and as well handbags can be obtained from smooth tones and fashoins. My fall-winter variety consists of many types of new kinds of highly-charged products. The particular compilation is regarded as displayed on the topic of to shop online world-wide-web websites. http://cheapbeltsoutletsss.webs.com/
    http://cheapbeltsoutletsss.webs.com/
    brown lv belt
    ferragamo belt
    cheap white lv belt
    orange hermes belt
    http://forum.sciana.by/memberlist.ph...rofile&u=22537
    http://www.worldofdebels.com/gaming-...ofile&uid=8986
    cheap beige burberry belt
    cheap brown lv belt
    http://chunlanhuayuan.com/memberlist...rofile&u=23384
    http://forum.hotairballoonride.org/m...rofile&u=16834

  16. #15
    cheapbeltbo
    Guest

    cheap burberry belts cheap beige burberry belts

    black lv belt
    Numerous modern chic totes really brought out via topmost product labels. Inventor designer purses are not only top quality in addition from superior quality of course. Top Italian language as well as , Adams architect product labels end up with a deal placed in the fashion economy. A myriad of customers take a look at have got such as shoes by - shirt labeling akin to Gucci, Prada, Fendi, Kooba, Chanel so Catholic Dior. http://cheapbeltsoutletsss.webs.com/
    http://cheapbeltsoutletsss.webs.com/
    cheap brown lv belt
    cheap brown lv belt
    brown lv belt
    cheap green lv belt
    http://forums.nofap.com/member.php?36728-cheapbeltap
    http://forums.elementsofbass.com/mem...rofile&u=11238
    cheap brown lv belt
    black lv belt
    http://a-syndicate.com/showthread.ph...d=1#post269056
    http://www.fraternite.net/forum/foru...um=2&start=160

  17. #16
    cheapbeltbo
    Guest

    cheap beige burberry belt

    black lv belt
    Various newer smart designer bags have already got out with foremost producer names. Designer brand clutches are not just stylishly fashioned yet unfortunately of the superior quality because well. Great German in addition The language producer names provide you with a different set up the fashion place. Lots of purchasers look instead of have designer purses a popular tags just as Gucci, Prada, Fendi, Kooba, Chanel and consequently Spiritual Dior. http://cheapbeltsoutletsss.webs.com/
    http://cheapbeltsoutletsss.webs.com/
    cheap orange lv belt
    cheap black armani belt
    cheap black lv belt
    cheap white lv belt
    http://forum.gdekupit.org/memberlist...rofile&u=48764
    http://forums.gamingjunkiesnetwork.c...ofile&uid=1058
    silver lv belt
    red hermes belt
    http://dieseljournal.com/ats-exhaust...comment-103136
    http://bahismerkezi.org/forum/showth...ed=1#post79935


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -4. The time now is 11:01 AM.
Powered by vBulletin®
Copyright © 2013 vBulletin Solutions, Inc. All rights reserved. © 2013 MIUI.us.
Download Bandwidth Sponsored by: VPN Tunnel
Need hosting? GlowHost.com