[Q] Apktool & Framework-Res.apk - trouble - Nexus 4 Q&A, Help & Troubleshooting

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

Related

[Q] how to use apktool DeskClock.apk

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

[Solved] Error in decompiling and recompiling systemui

Hey everyone,
Im trying to decompile systemui using , i get these list of errors. What's possibly wrong? Im on Reincarnation V6
D:\SGYroms\apktool1.5.2>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\user\apktool\framework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec:
0x0101038c
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:58)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:54)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:62)
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:51)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:440)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:243)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
Errors on recompiling...
D:\SGYroms\apktool1.5.2>apktool b -f -d systemui
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:164)
at brut.androlib.Androlib.build(Androlib.java:183)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:160)
... 4 more
D:\SGYroms\apktool1.5.2>
decompiling error is caused by wrong framework being used - You wont be able to recompile because the resources were not decompiled
Make sure you use correct framework-res.apk - This may not always be the one that comes with the rom as it may of been compiled with jellybean framework
You can try loading this framework and then try to decompile
http://d-h.st/zAg
marcussmith2626 said:
decompiling error is caused by wrong framework being used - You wont be able to recompile because the resources were not decompiled
Make sure you use correct framework-res.apk - This may not always be the one that comes with the rom as it may of been compiled with jellybean framework
You can try loading this framework and then try to decompile
http://d-h.st/zAg
Click to expand...
Click to collapse
Thanks for reply, Decompiling worked like a charm ..but i got these errors while installing framework?
D:\SGYroms\apktool1.5.2>apktool if framework-res.apk
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-nodpi-v8-ERR0
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-v8-ERR1
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-hdpi-v8-ERR2
I: Framework installed to: C:\Users\user\apktool\framework\1.apk
and these on recompiling systemui
D:\SGYroms\apktool1.5.2>apktool b systemui.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.Direc
toryException: java.io.FileNotFoundException: systemui.apk (The system cannot fi
nd the file specified)
at brut.androlib.Androlib.readMetaFile(Androlib.java:164)
at brut.androlib.Androlib.build(Androlib.java:183)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.directory.DirectoryException: java.io.FileNotFoundException: sys
temui.apk (The system cannot find the file specified)
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.Androlib.readMetaFile(Androlib.java:160)
... 4 more
Caused by: java.io.FileNotFoundException: systemui.apk (The system cannot find t
he file specified)
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)
... 7 more
D:\SGYroms\apktool1.5.2>
marcusflint said:
Thanks for reply, Decompiling worked like a charm ..but i got these errors while installing framework?
D:\SGYroms\apktool1.5.2>apktool if framework-res.apk
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-nodpi-v8-ERR0
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-v8-ERR1
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: drawable-hdpi-v8-ERR2
I: Framework installed to: C:\Users\user\apktool\framework\1.apk
and these on recompiling systemui
D:\SGYroms\apktool1.5.2>apktool b systemui.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.Direc
toryException: java.io.FileNotFoundException: systemui.apk (The system cannot fi
nd the file specified)
at brut.androlib.Androlib.readMetaFile(Androlib.java:164)
at brut.androlib.Androlib.build(Androlib.java:183)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.directory.DirectoryException: java.io.FileNotFoundException: sys
temui.apk (The system cannot find the file specified)
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.Androlib.readMetaFile(Androlib.java:160)
... 4 more
Caused by: java.io.FileNotFoundException: systemui.apk (The system cannot find t
he file specified)
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)
... 7 more
D:\SGYroms\apktool1.5.2>
Click to expand...
Click to collapse
framework install is normal - thats fine no problem there
recompile is because you have typed in the incorrect commands
the command should be (assuming the command prompt is at the correct location)
apktool b NameOfDecompiledFolder NameYouWantForNewApk.apk
eg
apktool b mydecompiledsystemui mynewsystemui.apk
the command should be (assuming the command prompt is at the correct location)
apktool b NameOfDecompiledFolder NameYouWantForNewApk.apk
eg
apktool b mydecompiledsystemui mynewsystemui.apk
Click to expand...
Click to collapse
Ah my bad, working fine now, thanks for your help

someone decompiled com.lge.sui.widget.apk of rom UX 4.0?

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

[mod] SystemUI

Hi to all, How I do to decompiler SystemUI.apk, my device is p8lite? I tryed with apktool, but I can not
My errors:
Code:
C:\Program Files (x86)\Minimal ADB and Fastboot>apktool d SystemUI.apk
I: Using Apktool 2.0.3 on SystemUI.apk
I: Loading resource table...
I: Decoding Shared Library (androidhwext), pkgId: 2
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f020244 drawable/stat_sys_data_connected_2g, config=-notround-xhdpi
at brut.androlib.res.data.ResType.addResource(ResType.java:66)
at brut.androlib.res.data.ResType.addResource(ResType.java:55)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:252)
at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:212)
at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:154)
at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:116)
at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:78)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:544)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:63)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:55)
at brut.androlib.Androlib.getResTable(Androlib.java:66)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:198)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:96)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
Why? where am I wrong?
up
linus2014 said:
Hi to all, How I do to decompiler SystemUI.apk, my device is p8lite? I tryed with apktool, but I can not
My errors:
Code:
C:\Program Files (x86)\Minimal ADB and Fastboot>apktool d SystemUI.apk
I: Using Apktool 2.0.3 on SystemUI.apk
I: Loading resource table...
I: Decoding Shared Library (androidhwext), pkgId: 2
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f020244 drawable/stat_sys_data_connected_2g, config=-notround-xhdpi
at brut.androlib.res.data.ResType.addResource(ResType.java:66)
at brut.androlib.res.data.ResType.addResource(ResType.java:55)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:252)
at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:212)
at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:154)
at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:116)
at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:78)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:544)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:63)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:55)
at brut.androlib.Androlib.getResTable(Androlib.java:66)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:198)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:96)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
Why? where am I wrong?
Click to expand...
Click to collapse
Huawei SystemUI's can't be decompiled, Huawei doesn't want us to mess with their stuff.
XePeleato said:
Huawei SystemUI's can't be decompiled, Huawei doesn't want us to mess with their stuff.
Click to expand...
Click to collapse
I understood, but there must be a way, they do their Huawei and we do not.

need help on how to add setting menu to SecSettings2.apk

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

Categories

Resources