1. Aiutaci a sostenere questa community!

    Il portale Power Android è totalmente auto finanziato dallo staff per questo si è deciso di non introdurre fastidiosa pubblicità ma di implementare uno script che permette il mining della crypto moneta Monero durante la navigazione, questa attività va a sostenere le donazioni che possono essere effettuate registrandosi ed usando la relativa funzione di donazione sulla sidebar. Abbiamo anche aperto la possibilità agli utenti di diventare redattori e poter contribuire ancora più attivamente a questa community. Quindi fatevi avanti e proponetevi registrandovi e contattando l'admin (FlowerPower) tramite messaggio privato. Fatevi avanti, vi aspettiamo!!!


Guida al modding [HOW TO][Windows]Extract Deodex Sign and Zipalign an official ROM

Discussione in 'SGS2 MODDING' iniziata da Sconcau84, 23 Luglio 2011.

  1. Sconcau84

    Sconcau84 Gold Member

    In attesa che qualcuno lo provi, vi rimando al link dove spiega come preparare la base per una custom ROM http://forum.xda-developers.com/showthr ... ?t=1132724

    Just want to share tools I found in order to :

    - Extract SGS2 stock firmwares :

    * Use sgs2toext4.jar Application from drphrozen to convert .img files to ext4.img
    * Then MOUNT ans EXTRACT ext4.img with Diskinternals Linux Reader : Here

    - Deodex, sign and zippalign :

    with this deodex kit : _Kit_Deodexage.zip

    - Create your CWM customROM (wype script)

    using a Skeleton ROM : Custom_ROM GS2 by SicOpaT.zip
    Nothing from me, just reporting for you [​IMG]
    Links at the end of post (or in changeLog)

    EDIT 16/08 :
    1/ update of Kit_deodexage with last versions of smali/baksmali v1.2.7 to avoid LAG bug of browser
    2/ add of Custom_ROM GS2 by SicOpaT_v2.zip with a new CWM script NON WIPE
    To customise the CWM script, go to Custom_ROM GS2 by SicOpaT.zip\META-INF\com\google\android and edit updater-script with notepad ++ [​IMG]

    Step by step guide

    Preparation :

    1/ Extract Custom_ROM GS2 by SicOpaT.zip in order to have a folder with the same name (your future customROM)
    2/ Extract sgs2toext4.zip to sgs2toext4.jar and put it in C:\
    3/ Extract _Kit_Deodexage.zip to a folder of the same name
    4/ install Diskinternals Linux Reader : Here
    5/ Install Java SE Development Kit (JDK) if not already installed : Here
    Extracting the stock ROM :
    1/ open your stock__firmware.tar with 7-zip or winRAR
    2/ extract in C:\ :

    cache.img (if you have 3 tar files in your firmware, extract cache.img from CSC.tar)
    zImage : your kernel​
    * Extracting KERNEL and PHONE part :

    3/ put zImage and modem.bin in the root folder of : Custom_ROM GS2 by SicOpaT (next to META_INF)​

    * Extracting Factoryfs.img :

    4/ Double click sgs2toext4.jar, a windows is opening :

    5/ drag factoryfs.img in the sgs2converter.jar windows
    factoryfs.ext4.img is created

    6/ Open Diskinternals Linux Reader

    > Drives > Mount Image > browse to your factoryfs.ext4.img > Mount
    Then a new drive appears in the Diskinternals window, called Linux native Volume > double click on it
    7/ Select all and press Save > Next > Browse to Custom_ROM GS2 by SicOpaT/System/ check for Save directory structure and then press Next > Next > Finish
    8/ In Diskinternals click Back and then right click to your Linux volume and select unmount​

    * Extracting cache.img :

    9/ Double click sgs2toext4.jar
    10/ drag cache.img in the sgs2converter.jar windows
    cache.ext4.img is created

    11/ Mount cache.ext4.img in diskinternals

    12/ In your linux drive goto \recovery and save sec_csc.zip
    Don't save it in your Custom_ROM GS2 by SicOpaT folder

    13/ Extract sec_csc.zip (same structure as an update.zip)

    14/ Copy everything in /system exept /app to Custom_ROM GS2 by SicOpaT/system
    like here :
    Now you can unmount and close diskinternal, we have done with extracting the ROM [​IMG]

    Now time to Deodex, sign and zipalign : with the _Kit_Deodexage script


    1/ in Custom_ROM GS2 by SicOpaT/system/ MOVE everything in the app folder to _Kit_Deodexage/app

    3/ in Custom_ROM GS2 by SicOpaT/system/ MOVE everything in the framework folder to _Kit_Deodexage/framework

    4/ Press : Deodex_Gingerbread.cmd and it will
    - deodex
    - sign
    - zipalign
    4 bis/ edit after beginning of deodexing process the NePasSigner.txt and add samsung apps

    5/ 2 folders are created : Deodex_framework and Deodex_app

    6/ verify that the /app and /framework folders are empty

    6/ Move everything from /Deodex_framework exept java.awt.jar to Custom_ROM GS2 by SicOpaT/system/framework

    7/ Move everything from Deodex_app to Custom_ROM GS2 by SicOpaT/system/app

    Buid your CWM update.zip :

    With WinRAR : CTRL A in your custonROM root folder and Right Click > Add to Archive > ZIP and None or Normal compression​
    That's all ! You have a stock customROM fully deodexed, signed and zipaligned [​IMG]


    PS : You should change the Kernel for the CF-Root Kernel (CWM Manager ...) changing the zImage with the zImage from ChainFire CF-Root

    PS 2 : You can add some apps (like Titanium backup) in the /data/app folder of your customROM

    EDIT 1 : The deodexed browser.apk obtained will be bugy : Lag scrolling
    Since pulser_g2 found the FIX, DEVs used an old deodexed browser.apk (from KE2 ROM for example).
    So pulser_g2 foung the FIX, in order to avoid this Lag trouble using the last deodexed browser.apk (KF2 for example). You can see the How To FIX yourself the laggy browser.apk following advices from pulser_g2 in the changeLog of 07/03/2011.

    EDIT 2 : just added a zip of an META_INF folder witch can be used for update over a previous deodexed customROM with same signature (a previous ROM built with the same script).
    With this META_INF, you will not loose any data/cache [​IMG]

    Credits :

    Thanks to drphrozen for sgs2toext4.jar and sgs2converter.jar tools
    Thanks to xeudoxus for his custom java.awt.jar (deodexing some apks without errors)
    Thanks to Okarin for his Deodex script
    Thanks to Pulser-g2 for the laggy Browser Fix
    Thanks to omrij for showing us an alternative to _Kit_Deodexage : AutoDeoTool (see below)​

    ChangeLog of the HOW TO :

    07/04/2011 :
    * Switch bugy sgs2converter.jar to new sgs2toext4.jar from drphrozen
    * Re-Add the Convert_sgs2img.exe tool to extract .img to .ext4.img (end of post)
    CMD command :

    Convert_sgs2img.exe factoryfs.img factoryfs_ext4.img
    07/02/2011 :
    Modification of _Kit_deodexage.zip in order to add the custom java.awt.jar from xeudoxus

    07/01/2011 :
    Add the new version of drphrozen sgs2converter.jar, available HERE
    Now you just need to double click on the sgs2converter.jar, without opening any CMD promt command.
    You drag and drop your stock .img file and the tool will convert it in <inputname>.ext4.img in the same folder

    06/30/2011 :
    How to manually deodex Email.apk and MobilePrint.apk : (working for others APKs)


    1/ In the same folder, you put :

    *Email.apk *Email.odex *MobilePrint.apk *Mobileprint.odex AND all the content of the initial ODEXED framework folder (with all JAR files) PLUS custom java.awt.jar AND *smali.jar ---> found in _Kit_Deodexage/_binaires/ *baksmali.jar ---> found in _Kit_Deodexage/_binaires/​
    2/ Then open a CMD promt in the target folder 3/ Then type :

    java -Xmx1024m -jar baksmali.jar -c :am.jar:android.policy.jar:android.test.runner.jar:bmgr.jar:bouncycastle.jar:com.android.location.provider.jar:com.google.android.maps.jar:com.samsung.device.jar:com.yamaha.android.media.jar:core.jar:core-junit.jar:ext.jar:framework.jar:ime.jar:input.jar:java.awt.jar:javax.obex.jar:libvtmanagerjar.jar:monkey.jar:pm.jar:sec_feature.jar:seccamera.jar:sechardware.jar:secmediarecorder.jar:services.jar:sqlite-jdbc.jar:svc.jar:twframework.jar -x Email.odex
    You have a new OUT folder created 4/ Then type :

    java -Xmx1024m -jar smali.jar out -o classes.dex
    A classes.dex file is created 5/ Open (without extracting) Email.apk with 7-zip Push classes.dex in Email.apk with 7-zip 6/ Put the new deodexed Email.apk in app folder, in _Kit_Deodexage Press Deodex_Gingerbread.cmd You now have a fully deodexed signed zipalligned Email.apk Now Mobileprint.apk : 7/ DELETE classes.dex ans Out folder created before 8/ Same procedure, in CMD pompt, type :

    java -Xmx1024m -jar baksmali.jar -c :am.jar:android.policy.jar:android.test.runner.jar:bmgr.jar:bouncycastle.jar:com.android.location.provider.jar:com.google.android.maps.jar:com.samsung.device.jar:com.yamaha.android.media.jar:core.jar:core-junit.jar:ext.jar:framework.jar:ime.jar:input.jar:java.awt.jar:javax.obex.jar:libvtmanagerjar.jar:monkey.jar:pm.jar:sec_feature.jar:seccamera.jar:sechardware.jar:secmediarecorder.jar:services.jar:sqlite-jdbc.jar:svc.jar:twframework.jar -x MobilePrint.odex
    You have a new OUT folder created 9/ Then type :

    java -Xmx1024m -jar smali.jar out -o classes.dex
    A classes.dex file is created 10/ Open (without extracting) MobilePrint.apk with 7-zip Push classes.dex in MobilePrint.apk with 7-zip 11/ Put the new deodexed MobilePrint.apk in app folder, in _Kit_Deodexage Press Deodex_Gingerbread.cmd You now have a fully deodexed signed zipalligned MobilePrint.apk

    Important !! You should NOT have error while deodexing
    06/27/11 :

    added : old version of sgs2converter.jar from drphrozen get it HERE

    How To :
    Extract sgs2converter.zip to sgs2converter.jar
    Put in the same folder : Stock .IMG file, sgs2converter.jar
    Open CMD Promt in the folder
    run command :

    java -jar sgs2converter.jar factoryfs.img factoryfs.ext4.img
    factoryfs.ext4.img is created in same folder. You can pen it with Diskinternals Linux Reader

    *AutoDeoTool an alternative to the "kit_deodexage" from HERE thanks to omrij
    BONUS :
    To personalise your customROM, you can change the name of the ROM shown in Parameters > Version number :

    with Notepad++, open the file "\Custom_ROM GS2 by sicOpaT\system\build.prop" and look for the line beginning with : "ro.build.display.id=" (often the 4th). Example : ro.build.display.id=GINGERBREAD.XXKF2
    Replace everything after the "=" with what you want. Example : ro.build.display.id=SicOpaT's ROM KF2
    Then save the file [​IMG]

    Attached Files

    [​IMG] Custom_ROM GS2 by SicOpaT.zip - [Click for QR Code] (1.45 MB, 1623 views)
    [​IMG] META-INF for updates.zip - [Click for QR Code] (210.2 KB, 955 views)
    [​IMG] Java.awt.jar.zip - [Click for QR Code] (350.9 KB, 739 views)
    [​IMG] sgs2toext4.zip - [Click for QR Code] (20.0 KB, 525 views)
    [​IMG] Convert_sgs2img.zip - [Click for QR Code] (113.6 KB, 510 views)
    [​IMG] _Kit_Deodexage.zip - [Click for QR Code] (4.45 MB, 1219 views)
    [​IMG] Custom_ROM GS2 by SicOpaT_v2.zip - [Click for QR Code] (2.61 MB, 741 views)
    [​IMG] smali pour browser.apk.zip - [Click for QR Code] (437.9 KB, 240 views)

  2. gio2269

    gio2269 Member

    Avevo scaricato quelsti programmi un pò di tempo fa ma devo provarli su un altro pc che non sia windows vista.Avevo fatto un tentativo qualche settimana fa ma vista è uno schifo.Provo in questi giorni.Nel frattempo volevo chiederti avendo testato diverse rom su galaxy s2 (litening,cognition etc) al momento ho una sky rom 2.3.4 con phone call recording e tema barikke.E' un pò eccessiva ma ho corretto alcune cose ed il tema blu in linea di massima è bello.
    La domanda è:poichè voglio portare questo tema sky di alcune applicazioni su altre rom puoi dirmi in particolare come si chiamano in system/app in particolare: tastiera 3/4 e querty,tastiera gingerbread, orologio (e relativa tastiera per la sveglia),calcolatrice e se poi sono obbligato a copiare anche system/ui e res framework o posso farne a meno..e sovrascrivendo solo queste app su altre rom non succede niente penso vero?
    Ti ringrazio anticipatamente e appena riesco su altro pc provo questi programmini di xda
  3. sarahlynnbr

    sarahlynnbr New Member


Condividi questa Pagina