Okay! I took much time surfing all over the net to find this and finally I got the Perfect solution for people who are beginners(n00b)
If you try to decompile directly it won't work(not atleast for Core but only for some devices), so here we go
Things you will need:
APKTOOL
Script
Rooted Core
Root Browser (or something similar)
Make sure you have Java SDK installed in pc.
Notepad++ or a decent xml editor
Preparation :
1)Copy these two apks' in sd card or somewhere you can access it from pc.
system\framework\"framework-res.apk"
and
system\app\"SystemUI.apk"
2)Copy these two apk in your computer system
3)Extract APKTOOL and Script until you get "aapt.exe", "apktool.bat", "apktool.jar" .
4) Make a new folder anywhere in your comp. and paste these
(i) framework-res.apk
(ii) SystemUI.apk
(iii) aapt.exe
(iv) apktool.bat
(v) apktool.jar
(vi) You also need to paste "cmd.exe", use Run command to find it and paste it in the folder...
Steps:
(i) Open cmd.exe, it should show the location of the current folder
(ii) Type
Code:
apktool if framework-res.apk
(iii) After it is done, Type
Code:
apktool d SystemUI.apk
(iv) Now you successfully have SystemUI.apk decompiled in the same folder !!!
Precautions:
i) Ensure you have not "CUT" but "COPIED" the apks from the folder, this can HARD BRICK your phone !
ii) Decompiling apks' takes time according to one's pc's speed, have patience.
iii) Please do not try to decompile or play with framework-res.apk in anyway if you are not experienced !
iv)And as thcoreguy says
No nuclear war is going on!
Click to expand...
Click to collapse
Checked and tested:
*I have used win7 64-bit SONY laptop
*Worked for I8262 and SHOULD work for I8260 (the files)
Acknowledgements
@Brut.all for making apktool
connor.tumbleson for uploading files
@thecoreguy for making root tutorial
People who made XDA forum possible
Samsung for making Core
You for reading this
Me(ofcourse) for creating this
Press Thanks if you also achieved to decompile this!
Reserved.
Reserved for recompiling
use multitool very easy to use no need cmd
zrox said:
use multitool very easy to use no need cmd
Click to expand...
Click to collapse
Nvm, Im focussing on Xposed Modules now
no more modding........
PS U can help me if u have some info
...now i hve only greenify and lockscreen for xposed...
nn
How to remove the green line below the toggles??
hello guys im decompile settings app of official Realme C3 Realme Ui 1.0 Android 10..
im use framework and settings app to decompile using apktool..
D:\Working Projects\dex-tools-2.1-SNAPSHOT>apktool d -f Settings.apk
I: Using Apktool 2.6.0 on Settings.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Fire7ly\AppData\Local\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Loading resource table from file: C:\Users\Fire7ly\AppData\Local\apktool\framework\12.apk
I: Decoding Shared Library (oppo), pkgId: 12
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
this is the output of command prompt...
this is the output directory of apktool output in dex2jar directory..
i wanna to edit some section in about device page of Realme devices.
like under ColorOS Version Own string Of MY Things.
Any help Will Be appreciated
Thanks In Advance..
Related
[GUIDE] How to decompile an apk <updated w/ guide><updated with compiling>
How to decompile an .APK:
Step 1:
Download >>This<< this is a tool for decompiling an .apk (i take no credit for this tool i did not make it i cant remember where i got it but the credit goes to the maker)
Step 2:
Now go to your C:\ directory create a new folder (doesnt matter what you name it) now extract the apk_manager to the folder that you created.
Step 3:
Download: >>This<< and also >>This<<
(whatever you are using 7zip or winrar, go into settings and integration and check the .BZ2 file extension)
Step 4:
Extract both files to the other folder in apk_manager
Step 5:
Plug your phone into your computer and pull framework-res.apk and twframework-res.apk from your /system/framework/ directory and place both files in the other folder
Step 6:
open up command prompt and enter
cd/
cd (whatever you named the folder that you put apk_manager)
cd other
apktool if framework-res.apk
Step 7:
cd/
cd (whatever you named the folder that you put apk_manager)
cd other
apktool if twframework-res.apk
Step 8:
now grab the apk that you want to decompile and place it in the place-apk-here-for-modding folder
Step 9:
open script now enter 22 into command press enter, press corresponding number for your apk for ex. 1 then press enter, now press 9 then enter... APK should now be decompiling (decompiled apk should be in the projects folder)
[size=+2]Compiling[/size]
You do nearly the same thing for compiling an apk press 22 and enter to select what project you want to do, then 11; your apk should be compiled
Let me know if anyone has any problems with this
I like how you were excited enough to post about making a post later.
Lol I was going to do it then but I got sidetracked...
Sent from my SGH-T959V using XDA App
ok....updated post w/ the guide
Going to try this method...
I did my framework-res.apk last night, font color changed for the pop-up windows. seemed to work fine, but then once it booted, i noticed that my volume bar was showing the loading spinner instead of the slider (whoops) and I was unable to get to the volume controls due to FC'ing.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I'll try this method and see if it works for me.
Many thanks for this!
I got so frustrated, I had to pull the toy out of the garage and let it loose down an empty road... lol
Lol lmao,hope this works for you
Sent from my SGH-T959V using XDA App
alos note you will have to delete the resourace arsc out of the apk u decompled and let the apk tool recompile a new one.. espcaly so if using a apk from a diffrent phone
Yeah I replaced the res directory, the manifest and the resources file with the one that apk tool compiled... I hadn't seen this post until I had already tried another method... Wife sprained her ankle so I won't have the time to try it for a couple of days.
Can I add a color to the colors.xml file the point to it in the styles.xml item?
Sent from my GS4G using XDA app.
how do I get the xml to stick when changing colors.xml in the value folder? When you get to the step to delete from the "keep" folder the value folders aren't there, they are hidden.
Sent from my SGH-T959V using Tapatalk
shotchacokov said:
Yeah I replaced the res directory, the manifest and the resources file with the one that apk tool compiled... I hadn't seen this post until I had already tried another method... Wife sprained her ankle so I won't have the time to try it for a couple of days.
Can I add a color to the colors.xml file the point to it in the styles.xml item?
Sent from my GS4G using XDA app.
Click to expand...
Click to collapse
sorry to hear that
So any advice on the problems we are both having? Thanks
Sent from my SGH-T959V using Tapatalk
Just tried your guide and it worked succesfully! Seems like all the files decompiled - I just needed to have a quick look at the decompiled AndroidManifest.xml and that file was decompiled.
I am curious about the error I received.
That's the console output (Windows 7 x64 command line):
Code:
Please make your decision:9
Decompiling Apk
test"An Error Occured, Please Check The Log (option 21)"
Drücken Sie eine beliebige Taste . . .
The log says this:
Code:
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
C:\Users\emelie\Downloads\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/signedcom.DevBob.DeskClockPlus-1.apk konnte nicht gefunden werden
C:\Users\emelie\Downloads\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedcom.DevBob.DeskClockPlus-1.apk konnte nicht gefunden werden
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\emelie\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 3
at java.lang.String.charAt(Unknown Source)
at brut.androlib.res.xml.ResXmlEncoders.findNonPositionalSubstitutions(ResXmlEncoders.java:165)
at brut.androlib.res.xml.ResXmlEncoders.enumerateNonPositionalSubstitutions(ResXmlEncoders.java:142)
at brut.androlib.res.data.value.ResStringValue.encodeAsResXmlValue(ResStringValue.java:45)
at brut.androlib.res.data.value.ResArrayValue.serializeToResValuesXml(ResArrayValue.java:55)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:264)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)
Could you point me in any direction how to get rid of this error?
Like I said everything seems to decompile correctly but still I don't like errors
EDIT:
In the end I downloaded apktool by itself and it ran without any errors. Don't know what happened there..
when trying to preform step 6 i get the msg " 'java' not recognized as and internal or external command operable program or batch file."
read on a post in a diff forum that java2sdk was needed so i installed this and still getting the same command error...
what am i doing wrong?
Can this be used to translate system menus?
Sent from me
thanks for the post man!
I use apk multi tool, myself, but whichever tool you use just be sure to have the latest adb and Java sdk installed.
Sent from my SGH-T959V using XDA App
You realize, Java has to be in your path. Also, you should also install twframework.
Apktool if ~pathtotwframework-res.apk
Sent from my SGH-T959V using xda premium
I use apktool. It works on all platforms and it it uses a later bug free version. Apk manager is a big batch file that uses an old extremely buggy edition of apktool Yes all decompile tools are based on smali, baksmali, and apktool. In fact apktool requires Smali and baksmali to decompile classes.dex and odex files.
The steps to use apktool are.
1. Download apktool(Google it)
2. palace it in an apktool folder on your desktop or somewhere.
3. Download any thing else on the website.for your OS.
4. Unzip everything and add them to your folder. Add the folder to your path or CD to it every time
5. Run terminal or CMD
6.TYPE
apktool if (path to framework Res.apk)
Apktool if (path to twframework Res.apk)
(Now you never will have to worry about dependencies unless you have a new from)
Apktool d apkorjarfile output folder
(Example....
.. apktool d /users/airfluip/desktop/Settings.apk /users/airfluip/desktop/decompiledsettings )
Now it shows progress. It may take some time.
If you get PNG errors, it will still decompile, but copy the original drawable-hdpi folder Into the decompiled one after decompile
Next make changes
Next
Apktool b /foldertodecompiled.
You should have the apk in the "apk" folder in the decompile folder
Sent from my SGH-T959V using xda premium
so i added java to the path but now i get a pop up java has experianced an error and has to close... what am i doing wrong?
also i have some friends who are using apkmanager just fine and have never put anything in there PATH variable. why is it that they can use apkmanager with no errors and im getting alot?
Rookie407 said:
so i added java to the path but now i get a pop up java has experianced an error and has to close... what am i doing wrong?
also i have some friends who are using apkmanager just fine and have never put anything in there PATH variable. why is it that they can use apkmanager with no errors and im getting alot?
Click to expand...
Click to collapse
This is a problem with your system and java not getting along. ensure you have the latest edition of java installed. If so uninstall it and get a fresh download from the java Website
If the problem persists...um ahhhhh back up your important data and do a system restore? or ask someone else I'm not an i.t. Expert but a fresh start is always nice....
Sent from my SGH-T959V using XDA App
Hi guys
I need your help.
I'm adding Hebrew support to Valhalla Final.
I was able to decompile all files using APKTOOL like you explained
Added all files RES\Values-IW (with strings taken from SGS-i9000 ROM)
but I get error while trying to re-compile these files :
* Browser
* Contacts
* Framework-res
* Street
* Talk2
* Touchwizcalendar
* Tweaks
Also all the APKs that I successfully recompiled - do not work and not appear in the phone and cause Force Close when I launch them.
10x!
So I tried to compile APKs but this is the error I get :
Code:
--------------------------------------------------------------------------
|Sat 06/02/2012 -- 15:11:27.61|
--------------------------------------------------------------------------
--2012-06-02 15:11:28-- http://update.apkmultitool.com/apkver.txt
Resolving update.apkmultitool.com (update.apkmultitool.com)... 199.59.62.20
Connecting to update.apkmultitool.com (update.apkmultitool.com)|199.59.62.20|:80
... connected.
HTTP request sent, awaiting response... 200 OK
Length: 152 [text/plain]
Saving to: `apkver.txt'
0K 100% 178K=0.001s
2012-06-02 15:11:29 (178 KB/s) - `apkver.txt' saved [152/152]
'java' is not recognized as an internal or external command,
operable program or batch file.
--------------------------------------------------------------------------
|Sat 06/02/2012 -- 15:21:33.26|
--------------------------------------------------------------------------
--2012-06-02 15:21:33-- http://update.apkmultitool.com/apkver.txt
Resolving update.apkmultitool.com (update.apkmultitool.com)... 199.59.62.20
Connecting to update.apkmultitool.com (update.apkmultitool.com)|199.59.62.20|:80
... connected.
HTTP request sent, awaiting response... 200 OK
Length: 152 [text/plain]
Saving to: `apkver.txt'
0K 100% 270K=0.001s
2012-06-02 15:21:34 (270 KB/s) - `apkver.txt' saved [152/152]
A subdirectory or file projects already exists.
A subdirectory or file place-apk-here-for-modding already exists.
A subdirectory or file place-ogg-here already exists.
A subdirectory or file place-apk-here-to-batch-optimize already exists.
A subdirectory or file place-apk-here-for-signing already exists.
'java' is not recognized as an internal or external command,
operable program or batch file.
--------------------------------------------------------------------------
|Sat 06/02/2012 -- 15:25:06.85|
--------------------------------------------------------------------------
--2012-06-02 15:25:06-- http://update.apkmultitool.com/apkver.txt
Resolving update.apkmultitool.com (update.apkmultitool.com)... 199.59.62.20
Connecting to update.apkmultitool.com (update.apkmultitool.com)|199.59.62.20|:80
... connected.
HTTP request sent, awaiting response... 200 OK
Length: 152 [text/plain]
Saving to: `apkver.txt'
0K 100% 341K=0s
2012-06-02 15:25:07 (341 KB/s) - `apkver.txt' saved [152/152]
A subdirectory or file projects already exists.
A subdirectory or file place-apk-here-for-modding already exists.
A subdirectory or file place-ogg-here already exists.
A subdirectory or file place-apk-here-to-batch-optimize already exists.
A subdirectory or file place-apk-here-for-signing already exists.
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b40)
Java HotSpot(TM) Client VM (build 24.0-b11, mixed mode, sharing)
'""platform-tools"\adb.exe"' is not recognized as an internal or external comman
d,
operable program or batch file.
The system cannot find the path specified.
The system cannot find the path specified.
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Android\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Nitish\AppData\Local\Temp\
APKTOOL2900661449421036432.tmp, -I, C:\Users\Nitish\apktool\framework\1.apk, -S,
C:\Program Files (x86)\Android SDK\projects\HoloLauncher_Beta6.apk\res, -M, C:\
Program Files (x86)\Android SDK\projects\HoloLauncher_Beta6.apk\AndroidManifest.
xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:302)
at brut.androlib.Androlib.buildResources(Androlib.java:249)
at brut.androlib.Androlib.build(Androlib.java:172)
at brut.androlib.Androlib.build(Androlib.java:155)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\Nitish\AppData\Local\Temp\APKTOOL2900661449421036432.tmp, -I, C:\Users\Niti
sh\apktool\framework\1.apk, -S, C:\Program Files (x86)\Android SDK\projects\Holo
Launcher_Beta6.apk\res, -M, C:\Program Files (x86)\Android SDK\projects\HoloLaun
cher_Beta6.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:87)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": CreateProcess error=2
, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:78)
... 7 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th
e file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more
Press any key to continue . . .
I have Java Runtime Environment (JRE) 8 (64 - Bit) and Java Development Kit 8 (64 - Bit) installed and am still getting this error...
I have even tried it on previous versions of JRE and JDK, but still got the same error on them
I am using Windows 7 64 - Bit.
What should I do?
What all you modified in decompiled apk?
Burned from my laser torch using pencil cells
varun.chitre15 said:
What all you modified in decompiled apk?
Burned from my laser torch using pencil cells
Click to expand...
Click to collapse
Just to change one string in "/values/strings.xml"
Changed "All" to "Apps"....
That's all I did and tried to compile and got this error......
try apktool might work
as i cant see here any thing whats wrong
modding went good
but maybe the tool isnt updated or anything
CoolCatGetHome said:
try apktool might work
as i cant see here any thing whats wrong
modding went good
but maybe the tool isnt updated or anything
Click to expand...
Click to collapse
Thank you for your reply but I am using the latest version of APK MultiTool download from :
http://www.apkmultitool.com/?q=node/5
Could there be anything wrong apart from this?
Try APK tool 1.4.2 and also try APK Manager
I don't see anything which should object compiling
btw which app is this? Holo launcher?
I will try and let you know
varun.chitre15 said:
Try APK tool 1.4.2 and also try APK Manager
I don't see anything which should object compiling
btw which app is this? Holo launcher?
I will try and let you know
Click to expand...
Click to collapse
Yeah....
Its Holo Launcher....
A friend of mine is a big fan of it and wanted the "All" renamed to "Apps"....
I have tried APK Tool but not Manager....
I will try that and let you know....
I tried compiling with APKTool, APK Manager and APK MultiTool.
All give the same error.
I even decompiled the HoloLauncher APK and compiled it back without and modifications and its still giving the same error....
Any suggestions / solutions?
It looks to me, at a quick scan, that you don't have the aapt tool in your path.
It can't find aapt, at least, that much it says. The computer needs both apktool and aapt to recompile apks. I use linux, where putting both in usr/local/bin suffices.
post link to aapt.exe of android sdk.
mateorod said:
It looks to me, at a quick scan, that you don't have the aapt tool in your path.
It can't find aapt, at least, that much it says. The computer needs both apktool and aapt to recompile apks. I use linux, where putting both in usr/local/bin suffices.
Click to expand...
Click to collapse
please can u post the link of aapt.exe?
Ace King 34 said:
please can u post the link of aapt.exe?
Click to expand...
Click to collapse
Just install the latest Android SDK.
I am going to reinstall Windows 7 x64 tomorrow.....
And this is what I would be installing :
1. Java Runtime Environment (64 - Bit)
2. JDK (64 - Bit)
3. Latest version of Android SDK.
Do I need anything apart from these for my APKTool / Manager to work?
Bump.....
I will be formatting in an hour or so....
Please answer my questions before that....
Bump again....
Gimme the apk
Ive modded holo launcher before
Sent from my GT-Xperia S using xda premium
CoolCatGetHome said:
Gimme the apk
Ive modded holo launcher before
Sent from my GT-Xperia S using xda premium
Click to expand...
Click to collapse
Thank you but its not about the APK but the error....
I would be Modding APKs in the future too and I don't want to be stuck with errors like these.....
Would JRE, JDK and Android SDK be enough for APK Modding or do I need to installing anything more?
holo launcher apk.
CoolCatGetHome said:
Gimme the apk
Ive modded holo launcher before
Sent from my GT-Xperia S using xda premium
Click to expand...
Click to collapse
@CoolCatGetHome here is the apk of holo launcher.
please change 'all' tab to 'apps' tab.
thanks.
Can someone please answer this?
[email protected] said:
I am going to reinstall Windows 7 x64 tomorrow.....
And this is what I would be installing :
1. Java Runtime Environment (64 - Bit)
2. JDK (64 - Bit)
3. Latest version of Android SDK.
Do I need anything apart from these for my APKTool / Manager to work?
Click to expand...
Click to collapse
Hmm weird
Get png prob
Sent from my GT-S5830 using xda premium
CoolCatGetHome said:
Hmm weird
Get png prob
Sent from my GT-S5830 using xda premium
Click to expand...
Click to collapse
"png porblem"?
And what would that be like?
Manually Deodexing (Windows/Linux/OSX)
Let's start first with deodexing manually in order to learn about how the whole process works. Deodexing manually can be very useful if you only want to deodex a couple apks, or if some apks are giving tools such as xUltimate trouble. So here's what you'll need:
Basic knowledge of odex vs. deodex... READ THIS
Smali/baksmali installed correctly (if you are on Linux/OSX you can get the wrapper script as well, otherwise just use the .jars)
Java JRE installed correctly
The apks you want to deodex
ALL of the files in /system/framework from your ROM
This is also an excellent read for understanding the process of deodexing an apk
The first thing we want to do is find the bootclasspath for the ROM you are using. You will have to get the file /init.rc from your phone in some way; if you prefer using root explorer then use root explorer to copy it to your sd card, I prefer using adb. Once you have init.rc on your computer, open it up in a text editor. Search for the line that begins with "export BOOTCLASSPATH" and copy the rest of the line. It should look like this:
Code:
/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework-ext.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar:/system/framework/com.motorola.frameworks.core.addon.jar:/system/framework/kafdex.jar:/system/framework/com.motorola.orange.simauth.jar
The bootclasspath is simply a list of dependencies that the system apps need to run - i.e. jars/apks that contain code that the system apps use. It is necessary to have the correct bootclasspath when deodexing.
Now that we have the bootclasspath we can start to set up for the actual deodexing. All the files listed in the bootclasspath are found in /system/framework, so grab all the jars/apks in /system/framework from your ROM (adb pull them or take them from the flashable zip if available) and put them in a folder named "framework" somewhere that you can remember, such as your desktop or at the root of your hard drive (i.e. C:\framework). We will use the bootclasspath to find all the files in this folder that are needed to deodex the apps properly.
Now we have to modify the bootclasspath in order to get the baksmali command to work correctly. The current bootclasspath that we have is saying that all the frameworks are in the /system/framework folder of your computer, but most of you have the frameworks somewhere like C:\framework or /home/me/framework. So open your text editor again and paste the current bootclasspath. Hopefully your editor will have a find/replace function; if so, just keep replacing all instances of "/system/framework" with the path to your frameworks. For example, this is what it would look like if your frameworks are in C:\framework:
Code:
C:\framework\core.jar:C:\framework\core-junit.jar:C:\framework\bouncycastle.jar:C:\framework\ext.jar:C:\framework\framework.jar:C:\framework\framework-ext.jar:C:\framework\android.policy.jar:C:\framework\services.jar:C:\framework\apache-xml.jar:C:\framework\filterfw.jar:C:\framework\com.motorola.android.frameworks.jar:C:\framework\com.motorola.android.widget.jar:C:\framework\com.motorola.frameworks.core.addon.jar:C:\framework\kafdex.jar:C:\framework\com.motorola.orange.simauth.jar
Finally we are ready to actually deodex the apks. Place the apks and odex's (odexes?) you want to deodex anywhere... your desktop, a folder somewhere, the root of your hard drive... it does not matter. Place the smali/baksmali .jar's in the same directory as the apps you wish to deodex. Open up a command prompt/terminal/etc and "cd" to the directory that the .apk's are in. For example if they are in C:\apps_to_deodex then I would type
Code:
cd C:\apps_to_deodex
The process for deodexing is a little dance like this:
Use baksmali to decompile the .odex file to smali
Use smali to compile the .smali files to a .dex
Use an archive manager (ex. 7zip) to put the newly created .dex file into the original .apk
Delete the old .odex file and all the decompiled smali.
So, let's begin.
BAKSMALI
Since baksmali/smali are .jar's, we will be using java to execute them. The syntax for the baksmali command is something like this:
Code:
java -jar baksmali.jar -a [COLOR="Red"]api_level[/COLOR] -c [COLOR="red"]bootclasspath[/COLOR] -x [COLOR="red"]file.odex[/COLOR]
The -a argument is not necessary with ICS. If you are on GB then you must use "-a 10" in order for it to deodex properly.
The bootclasspath is the bootclasspath that we determined earlier
The file.odex is, of course, the name of the odex file you want to decompile.
So let's say I want to decompile abc.odex, which was built for ICS. The command would be:
Code:
java -jar baksmali.jar -c C:\framework\core.jar:C:\framework\core-junit.jar:C:\framework\bouncycastle.jar:C:\framework\ext.jar:C:\framework\framework.jar:C:\framework\framework-ext.jar:C:\framework\android.policy.jar:C:\framework\services.jar:C:\framework\apache-xml.jar:C:\framework\filterfw.jar:C:\framework\com.motorola.android.frameworks.jar:C:\framework\com.motorola.android.widget.jar:C:\framework\com.motorola.frameworks.core.addon.jar:C:\framework\kafdex.jar:C:\framework\com.motorola.orange.simauth.jar -x abc.odex
This command creates a directory called "out" containing the decompiled odex file.
SMALI
Now that we have "baksmalid" the odex file, we now need to "smali" it to turn the .smali code into the .dex format. The syntax for this command is something like this:
Code:
java -jar smali.jar out -o classes.dex
We are calling the newly generated file "classes.dex" because that is the file that Android looks for in deodexed apks.
When the command completes you will have a file called "classes.dex" sitting in the directory holding all the deodexed apps.
ARCHIVE MANAGER
Hopefully by now you understand the difference between an odexed app and a deodexed app...
Odexed -> abc.apk AND abc.odex
Deodexed -> abc.apk ONLY which contains classes.dex
So, since we have the classes.dex, all we have to do is drag-n-drop it into the respective.apk using an archive manager such as 7zip (Windows). The result is an .apk which contains all the files necessary for it to install and run... it is deodexed.
CLEANUP
If you are going to repeat the process multiple times you will begin to get confused with filenames and everything. Since you now have a fully funtional abc.apk, you can delete:
-The abc.odex file as it is no longe necessary
-The "out" folder created in step 1
-The classes.dex because it is already copied into abc.apk
TROUBLESHOOTING
Sometimes, no matter what you try, you just can not get an app to deodex because it just isn't finding the right dependencies to load. If you come across some troublesome apps, you can use the "-I" argument when baksmaling to force it to decompile:
Code:
java -jar baksmali.jar -a [COLOR="Red"]api_level[/COLOR] -c [COLOR="red"]bootclasspath[/COLOR] -x -I [COLOR="red"]file.odex[/COLOR]
A warning... if you use the -I option on an app that is normally able to deodex fine, you will most likely get force closes and other random errors. Only use -I as a last resort.
For some reason our BOOTCLASSPATH on the ICS leak seems to list some files that don't exist in /system/framework. This means that when you try to baksmali you will get an error about not being able to load class files. If you get this error, look for the .jar that it references, and delete it from the BOOTCLASSPATH and try again. In the end it should look something like this in Windows:
Code:
C:\path_to_frameworks\core.jar:C:\path_to_frameworks\core-junit.jar:C:\path_to_frameworks\bouncycastle.jar:C:\path_to_frameworks\ext.jar:C:\path_to_frameworks\framework.jar:C:\path_to_frameworks\framework-ext.jar:C:\path_to_frameworks\android.policy.jar:C:\path_to_frameworks\services.jar:C:\path_to_frameworks\apache-xml.jar:C:\path_to_frameworks\filterfw.jar:C:\path_to_frameworks\com.motorola.android.frameworks.jar:C:\path_to_frameworks\com.motorola.android.widget.jar:C:\path_to_frameworks\com.motorola.frameworks.core.addon.jar
Thanks alteredlikeness for the tip!
Deodexing Automatically with xUltimate (Windows)
Coming soon...
Hope this helps clear up some questions that you've had... enjoy!
Nice work!
Mods, stickify please?
Sent from my SAMSUNG-SGH-I747 using xda premium
Grrreat! Thank you for putting this together! I swear I dreamed about this last nite...
But, a note on bootclasspath: For ICS, I have run into problems using it directly from the init.rc - we don't physically have all of those jar files in our framework. So, I removed a couple and have not ran into problems since. Here's what I got:
Code:
/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework-ext.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar:/system/framework/com.motorola.frameworks.core.addon.jar
Edit: edited.
alteredlikeness said:
Grrreat! Thank you for putting this together! I swear I dreamed about this last nite...
But, a note on bootclasspath: For ICS, I have run into problems using it directly from the init.rc - we don't physically have all of those jar files in our framework. So, I removed a couple and have not ran into problems since. Here's what I got:
Code:
/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework-ext.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar:/system/framework/com.motorola.frameworks.core.addon.jar
Click to expand...
Click to collapse
Thanks! I haven't manually done anything in ICS so I forgot about that... modified OP
hello i got classes.dex and put it in Bluetooth.apk , i put it on system/app and removed old apk, .odex files but after reboot i can't find bluetooth.odex in system/app , and not working what i changed in apk...
Error when attempting first deodex
I get this error not matter how I do the command in CMD.
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Util.ExceptionWithContext: Cannot locate boot class path file C
at org.jf.dexlib.Code.Analysis.ClassPath.loadBootClassPath(ClassPath.java:218)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:146)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.java:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:101)
at org.jf.baksmali.main.main(main.java:308)
I am a noob when it comes to this stuff...do you have any insight on this? Thanks.
jcvermillion
HTC Droid Incredible 4G LTE
Rooted
Unlocked Bootloader
Ready to Deodex the old fashion way.
First: I got this error:
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Util.ExceptionWithContext: Cannot locate boot class path file C
at org.jf.dexlib.Code.Analysis.ClassPath.loadBootClassPath(ClassPath.java:218)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:146)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.java:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:101)
at org.jf.baksmali.main.main(main.java:308)
Click to expand...
Click to collapse
after writing this
Code:
java -jar baksmali-1.4.2.jar -a 10 -c \framework\core.jar:\framework\bouncycastle.jar:\framework\ext.jar:\framework\framework.jar:\framework\android.policy.jar:\framework\services.jar:\framework\core-junit.jar -x framework.odex
(I am using mac os x)
Second: what should I use to put classes.dex files inside .jar files??
I have the same error and where i must put your solution
"java -jar baksmali-1.4.2.jar -a 10 -c \framework\core.jar:\framework\bouncycastle.jar:\framework\ext.jar:\framework\framework.jar:\framework\android.policy.jar:\framework\services.jar:\framework\core-junit.jar -x framework.odex"
Where i must put this?
Thanks.
Edit: i used this topic to deodex my pre-rooted ROM: http://forum.xda-developers.com/showthread.php?t=2374008
Help-Me Memo.odex Samsung GT-S5360B
Help-me
C:\framework>java -jar baksmali.jar -a 10 -c c:\framework\core.jar:c:\framework\
bouncycastle.jar:c:\framework\ext.jar:c:\framework\framework.jar:c:\framework\an
droid.policy.jar:c:\framework\services.jar:c:\framework\core-junit.jar -x Memo.o
dex
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Util.ExceptionWithContext: Cannot locate boot class path file c
at org.jf.dexlib.Code.Analysis.ClassPath.loadBootClassPath(ClassPath.jav
a:237)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:14
5)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.j
ava:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:111)
at org.jf.baksmali.main.main(main.java:293)
anexo: Memo.apk, Memo.odex, init.rc, BOOTCLASSPATH.txt
Anyone got solution for these 'cannot find boot class path in C' error ?
EDIT:FOUND IT!!!
Just copy all framework files in C:/framework and instead of -c use -d
and command should look like
Code:
java -jar baksmali.jar -a [COLOR="Red"]##(api lvl)[/COLOR] -d C:/framework/ -x [COLOR="red"][.odex file][/COLOR]
No need to type the whole bootclasspath he just needs the path to framework folder
Hope it helps
I am trying to deodex telephony-common.jar and telephony-common.odex
I tried first
Code:
java -jar baksmali.jar -x telephony-common.odex
and got
Code:
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find superclass Landroid/app/Service;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadSuperclass(ClassPath.java:784)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:668)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:163)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPathFromOdex(ClassPath.java:110)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:98)
at org.jf.baksmali.main.main(main.java:278)
Error while loading class Landroid/accessibilityservice/AccessibilityService; from file ./framework.zip
Error while loading ClassPath class Landroid/accessibilityservice/AccessibilityService;
then
Code:
java -jar baksmali.jar -c "/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/core.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/core-junit.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/bouncycastle.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/ext.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/framework.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/framework-ext.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/android.policy.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/services.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/apache-xml.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/filterfw.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/com.motorola.android.frameworks.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/com.motorola.android.widget.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/com.motorola.frameworks.core.addon.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/kafdex.jar:"/home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework"/com.motorola.orange.simauth.jar -x telephony-common.odex
and got
Code:
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Util.ExceptionWithContext: Cannot locate boot class path file /home/matthew/temp/X9006&X9076ColorOS_V1.2.7i_full/system/framework/core.jar
at org.jf.dexlib.Code.Analysis.ClassPath.loadBootClassPath(ClassPath.java:237)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:145)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.java:131)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:105)
at org.jf.baksmali.main.main(main.java:278)
Here how i want to made a change in LatinIME.apk ( Keyboard ) in Bruce2728 Rom
1. I work on (AutoAPKTool2.0.4)
2. I download the rom cm-10-20121030-bruce2728-pyramid (HTC Sensation)
3. I drag out the file from APP directory (LatinIME.apk) this is keyboard to desktop
4. Then i go to Framework directory in this rom and drag out file Framework-res.apk and drag it to desktop
5. Then i add this 2 files in "AutoAPKTool2.0.4\_INPUT_APK" and run AutoAPKToolMain.bat
6. When open this window i select number 1 (if framework-res.apk) and press enter
7. Then i select number 81 ( Instrall additional framework file ) and add the location of Framework-res.apk witch is in _INPUT_APK and press enter
8. Then i select number 6 and add location of LatinIME.apk and press enter and wait until decompile
9. When decompile end i open the "AutoAPKTool2.0.4\_INPUT_APK\LatinIME\res\values" directory and edit Style.xml with notepad++ ( <item name="keyHintLetterColor">#80000000</item> ) to ( <item name="keyHintLetterColor">#80E0E4E5</item> )
10. Then i go back to AutoAPKToolMain.bat and select number 9 and add location of "\_INPUT_APK\LatinIME" and press enter
11. Wait until recompile and then i get this error:
"[*] "C:\Documents and Settings\Anonymous26\Desktop\AutoAPKTool2.0.4\_INPUT_APK\LatinIME"
recompiling "C:\Documents and Settings\Anonymous26\Desktop\AutoAPKTool2.0.4\_INPUT_APK\LatinIME"...
I: Smaling...
I: Building resources...
I: Copying libs...
I: Building apk file...
The system cannot find the drive specified."
12. Ok i close this log and open "AutoAPKTool2.0.4\_INPUT_APK\LatinIME\dist\LatinIME.apk ( Recompiled File ) and drag out this resources.arsc and drag it to desktop
13. Then i open the original LatinIME.apk and replace Original Resources.arsc with edited Resources.arsc
14. Then i upload this file to SD card and install it then start install and when must type App installed type app not installed :/
Does anyone know what is wrong ?
Hi,
You are better off asking where a dev or themer will see this.
Look HERE
XporteR21 said:
Here how i want to made a change in LatinIME.apk ( Keyboard ) in Bruce2728 Rom
1. I work on (AutoAPKTool2.0.4)
2. I download the rom cm-10-20121030-bruce2728-pyramid (HTC Sensation)
3. I drag out the file from APP directory (LatinIME.apk) this is keyboard to desktop
4. Then i go to Framework directory in this rom and drag out file Framework-res.apk and drag it to desktop
5. Then i add this 2 files in "AutoAPKTool2.0.4\_INPUT_APK" and run AutoAPKToolMain.bat
6. When open this window i select number 1 (if framework-res.apk) and press enter
7. Then i select number 81 ( Instrall additional framework file ) and add the location of Framework-res.apk witch is in _INPUT_APK and press enter
8. Then i select number 6 and add location of LatinIME.apk and press enter and wait until decompile
9. When decompile end i open the "AutoAPKTool2.0.4\_INPUT_APK\LatinIME\res\values" directory and edit Style.xml with notepad++ ( <item name="keyHintLetterColor">#80000000</item> ) to ( <item name="keyHintLetterColor">#80E0E4E5</item> )
10. Then i go back to AutoAPKToolMain.bat and select number 9 and add location of "\_INPUT_APK\LatinIME" and press enter
11. Wait until recompile and then i get this error:
"[*] "C:\Documents and Settings\Anonymous26\Desktop\AutoAPKTool2.0.4\_INPUT_APK\LatinIME"
recompiling "C:\Documents and Settings\Anonymous26\Desktop\AutoAPKTool2.0.4\_INPUT_APK\LatinIME"...
I: Smaling...
I: Building resources...
I: Copying libs...
I: Building apk file...
The system cannot find the drive specified."
12. Ok i close this log and open "AutoAPKTool2.0.4\_INPUT_APK\LatinIME\dist\LatinIME.apk ( Recompiled File ) and drag out this resources.arsc and drag it to desktop
13. Then i open the original LatinIME.apk and replace Original Resources.arsc with edited Resources.arsc
14. Then i upload this file to SD card and install it then start install and when must type App installed type app not installed :/
Does anyone know what is wrong ?
Click to expand...
Click to collapse
Whats wrong with just apktool - that on its own has never failed me, its only when you add other utilities in that things **** up (with the exception of VTS which I use for multiple apk like the tweaks but for single apk I use apktool on its own). Also with apktool on its own, its a hell of a lot easier to debug problems
So what tools to use
Sent from my HTC Sensation using xda app-developers app
XporteR21 said:
So what tools to use
Sent from my HTC Sensation using xda app-developers app
Click to expand...
Click to collapse
Virtuous Ten Studio: http://www.virtuousrom.com/p/ten-studio.html
Apktool 1.5.0 by iBotPeaches: http://forum.xda-developers.com/showthread.php?t=1755243
Replace the apktool in the virtuous program files folder with the iBotPeaches one - I have never had any problems decompiling/recompiling apk's or jar's with this combination
Jonny said:
Virtuous Ten Studio: http://www.virtuousrom.com/p/ten-studio.html
Apktool 1.5.0 by iBotPeaches: http://forum.xda-developers.com/showthread.php?t=1755243
Replace the apktool in the virtuous program files folder with the iBotPeaches one - I have never had any problems decompiling/recompiling apk's or jar's with this combination
Click to expand...
Click to collapse
heheheh i try you're metod and it's working i can install the app but app crash every time i open it :/
XporteR21 said:
heheheh i try you're metod and it's working i can install the app but app crash every time i open it :/
Click to expand...
Click to collapse
replied to the PM
still no secsess ;(
Sent from my HTC Sensation using xda app-developers app
Hy all i know i'm anoying with this but i realy want to edit this apk file (LatinIME.apk) can ayone explane me what is wrong whit this error and how to fix it :/
Oky Step by Step
1. I work on (AutoAPKTool2.0.4)
2. I download the rom cm-10-20121030-bruce2728-pyramid (HTC Sensation)
3. I drag out the file from APP directory (LatinIME.apk) this is keyboard to desktop
4. Then i go to Framework directory in this rom and drag out file Framework-res.apk and drag it to desktop
5. Then i add this 2 files in "AutoAPKTool2.0.4\_INPUT_APK" and run AutoAPKToolMain.bat
6. When open this window i select number 1 (if framework-res.apk) and press enter
7. Then i select number 81 ( Instrall additional framework file ) and add the location of Framework-res.apk witch is in _INPUT_APK and press enter
8. Then i select number 6 and add location of LatinIME.apk and press enter and wait until decompile
9. When decompile end i open the "AutoAPKTool2.0.4\_INPUT_APK\LatinIME\res\valu es" directory and edit Style.xml with notepad++ ( <item name="keyHintLetterColor">#80000000</item> ) to ( <item name="keyHintLetterColor">#80E0E4E5</item> )
10. Then i go back to AutoAPKToolMain.bat and select number 9 and add location of "\_INPUT_APK\LatinIME" and press enter
11. Wait until recompile and then i get this error:
"[*] "C:\Documents and Settings\Anonymous26\Desktop\AutoAPKTool2.0.4\_INP UT_APK\LatinIME"
recompiling "C:\Documents and Settings\Anonymous26\Desktop\AutoAPKTool2.0.4\_INP UT_APK\LatinIME"...
I: Smaling...
I: Building resources...
I: Copying libs...
I: Building apk file...
The system cannot find the drive specified."
12. Ok i close this log and open "AutoAPKTool2.0.4\_INPUT_APK\LatinIME\dist\LatinIM E.apk ( Recompiled File ) and drag out this resources.arsc and drag it to desktop
13. Then i open the original LatinIME.apk and replace Original Resources.arsc with edited Resources.arsc
14. Then i upload this file to SD card and install it then start install and when must type App installed type app not installed :/
i allready try with Virtous ten Studio i Decompile file, edit it, recompile back to apk, sign it, uplolad on sd card, install it... and still crash every time i open the keyboard every time i want to type any message.... Sorry i'm new in this :/