hi devs,
is would like to modify an apk! after some google-work, i found apktool to decompile & to compile the modded! but without success!
what i have done? (OS=linux)
download (aapt,apktool,apktool.jar) to /usr/local/bin
adb pull /system/app/DeskClock.apk /home/htc/
cd /home/htc/
apktool d DeskClock.apk ./out
change the /res/values-de/strings.xml and save
apktool b -f -d out (compile the folder to new apk)
adb shell & cd /system/app & mv DeskClock.apk DeskClock.old & ^ctrl+D
adb push /home/htc/out/dist/DeskClock.apk /system/app/
ok, in my opinion that should be all, but it doesn't work!
i cant see the Clock App on my Droid.
Can anybody say me, were is my misstake?
I'm not very talented in Linux, but your steps seem to be right. I always used Windows at work, so I do only know the apk took for Win XP
But did you check if the recompiled file has the same size as the original one?
Apktool ERROR
Hey I'm trying to use apktool to recompile my SystemUI.apk but anytime i run apktool b SystemUI the following error pops up
C:\Windows\system32>cd C:\Windows
C:\Windows>apktool if C:\Windows\framework-res.apk
I: Framework installed to: C:\Users\Mama\apktool\framework\1.apk
C:\Windows>apktool if C:\Windows\SystemUI.apk
I: Framework installed to: C:\Users\Mama\apktool\framework\127.apk
C:\Windows>apktool d SystemUI.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Mama\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
C:\Windows>apktool b SystemUI
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
C:\Windows\SystemUI\res\values\styles.xml:3: error: Error retrieving parent for
item: No resource found that matches the given name '@*android:style/TextAppeara
nce.StatusBar'.
C:\Windows\SystemUI\res\values\styles.xml:8: error: Error retrieving parent for
item: No resource found that matches the given name '@*android:style/TextAppeara
nce.Large'.
C:\Windows\SystemUI\res\values\styles.xml:11: error: Error retrieving parent for
item: No resource found that matches the given name '@*android:style/Widget.But
ton'.
C:\Windows\SystemUI\res\values\styles.xml:16: error: Error retrieving parent for
item: No resource found that matches the given name '@*android:style/TextAppear
ance.StatusBar'.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, --min-sdk-version, 10, --target-sdk-ver
sion, 10, -F, C:\Users\Mama\AppData\Local\Temp\APKTOOL1762758136473137198.tmp, -
I, C:\Users\Mama\apktool\framework\1.apk, -S, C:\Windows\SystemUI\res, -M, C:\Wi
ndows\SystemUI\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:255)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
at brut.androlib.Androlib.buildResources(Androlib.java:269)
at brut.androlib.Androlib.build(Androlib.java:192)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 10, --target-sdk-version, 10, -F, C:\Users\Mama\AppData\Local\Temp\AP
KTOOL1762758136473137198.tmp, -I, C:\Users\Mama\apktool\framework\1.apk, -S, C:\
Windows\SystemUI\res, -M, C:\Windows\SystemUI\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:253)
... 6 more
C:\Windows>
I know that some of the .xml file might be wrong but i tried just decompiling and recompiling the SystemUI.apk and the same error appear...
Is there something im doing wrong??
Please help!!!!!!
maybe posting in the thread for apktool might get you help faster
and nice revive of a 10 month old dead thread
Hello!
I'm not sure if my question fits in here, but since i'm not allowed to post at the development section yet.. oh well.
Anyhow. I tried to make some changes on the Framework-Res.apk (values/dimens.xml) without success.
Apktool appears to be doing it's work like it should, but the resulting file is much smaller then the original one. (6,53MB compared to 10,1MB) So i'm not sure if i'm simply doing something wrong, or if it's Apktools fault?
Oh and all i was trying to do is making the navbar smaller on a stock rom.
Here's the output for anyone interested:
..apktool.jar if framework-res.apk
Code:
I: Framework installed to: C:\Users\..\apktool\framework\1.apk
..apktool.jar d framework-res.apk
Code:
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
..apktool.jar b framework-res
Code:
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Hi
I successfully did the same thing,
The file size is correct, dont worry about it.
My problem was that i used wordpad.exe to edit the dimens.xml file which led to boot looping
Using notepad++ solved my issue
Good luck
Savoury.Monkey said:
Hello!
I'm not sure if my question fits in here, but since i'm not allowed to post at the development section yet.. oh well.
Anyhow. I tried to make some changes on the Framework-Res.apk (values/dimens.xml) without success.
Apktool appears to be doing it's work like it should, but the resulting file is much smaller then the original one. (6,53MB compared to 10,1MB) So i'm not sure if i'm simply doing something wrong, or if it's Apktools fault?
Oh and all i was trying to do is making the navbar smaller on a stock rom.
Here's the output for anyone interested:
..apktool.jar if framework-res.apk
Code:
I: Framework installed to: C:\Users\..\apktool\framework\1.apk
..apktool.jar d framework-res.apk
Code:
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
..apktool.jar b framework-res
Code:
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Click to expand...
Click to collapse
I am getting the following errors when I attempt to decompile GoogleLatinIME.apk(copied directly from system- app) and SamsungIME.apk(downloaded from xda thread) with apktool I put the framework-res.apk and SystemUI.apk into the framework folder by running command prompt - apktool if .... , also I tried adding twframework-res.apk to the framework folder in apktool. I am running http://forum.xda-developers.com/ver.../rom-eclipse-s5-tw-v1-0-12-8-14-real-t2967151
The possibility exists that I have no idea what I am doing so any help is much appreciated. Thanks!!!
C:\Users\GLEN\apktools\phone\apktool>apktool d GoogleLatin.apk
Input file (GoogleLatin.apk) was not found or was not readable.
C:\Users\GLEN\apktools\phone\apktool>apktool d GoogleLatinIME.apk
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode ars
c file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibRes
ources.java:491)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.jav
a:74)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.jav
a:66)
at brut.androlib.Androlib.getResTable(Androlib.java:50)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:44)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
2)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
... 8 more
C:\Users\GLEN\apktools\phone\apktool>apktool d SamsungIME.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.Direc
toryException: java.util.zip.ZipException: error in opening zip file
at brut.androlib.ApkDecoder.hasSources(ApkDecoder.java:199)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:83)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
Caused by: brut.directory.DirectoryException: java.util.zip.ZipException: error
in opening zip file
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:55)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:38)
at brut.androlib.res.util.ExtFile.getDirectory(ExtFile.java:55)
at brut.androlib.ApkDecoder.hasSources(ApkDecoder.java:197)
... 3 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:53)
... 6 more
C:\Users\GLEN\apktools\phone\apktool>
Hello friends! It can e obtained decompile framework com.lge.sui.widget.apk
can anyone have any idea how to get solve this problem?
Log
Code:
Processing...
I: Using Apktool 2.0.3-b0eb58-SNAPSHOT on com.lge.sui.widget.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\evgenijya\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
Exception in thread "main" java.lang.ClassCastException: brut.androlib.res.data.
value.ResBoolValue cannot be cast to brut.androlib.res.data.value.ResAttr
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(Re
sStyleValue.java:65)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResour
ces.java:502)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:252
)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:136)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
!!!Aborted!!!
All done!
You haven't install framework..
would anyone share how i can properly add setting menu to SecSettings2.apk? when i try using apktool it always failed on compiling. i already specify my rom framework.
the file i've edited:
device_info_settings.xml @ res/xml folder
strings.xml @ res/values folder
D:\SecSettings2>apktool if framework-res.apk
I: Framework installed to: C:\Users\san\AppData\Local\apktool\framework\1.apk
D:\SecSettings2>apktool if tw-framework.apk
I: Framework installed to: C:\Users\san\AppData\Local\apktool\framework\2.apk
D:\SecSettings2>apktool d SecSettings2.apk
I: Using Apktool 2.3.0 on SecSettings2.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\san\AppData\Local\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
D:\SecSettings2>apktool b SecSettings2
I: Using Apktool 2.3.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: fakeLogOpen(/dev/log_security, O_WRONLY) failed
W: fakeLogOpen(/dev/log_security, O_WRONLY) failed
W: D:\SecSettings2\SecSettings2\res\values\public.xml:13803: error: Public symbol string/ambient_display_pickup_summary declare
d here is not defined.
W: D:\SecSettings2\SecSettings2\res\values\public.xml:13802: error: Public symbol string/ambient_display_pickup_title declared
here is not defined.
............................
........................
.............
Click to expand...
Click to collapse