yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] adamgaltress:
Just to confirm, will this fix this issue? I get it when I install com.htc.resources.apk and when I decompile apks which I believe is causing issues for me when I rebuild the apps
[G1 Android Development] iBotPeaches:
Yes, I've been working on that bug.

Its because of the new (semi new API 13) resource structure shown here: http://developer.android.com/reference/android/util/DisplayMetrics.html

which also differs from more android documentation here: http://developer.android.com/reference/android/content/res/Configuration.html

So you basically have to pick and choose until it works since two different documentation lies.

You can use aapt directly to output the structure and thats when I noticed the problems.

imsi=0/0 lang=de reg=-- orient=0 touch=0 dens=240 kbd=0 nav=0 input=0 ssz=0x0 sw0dp w0dp h0dp sz=0 long=0 ui=0 night=0 vers=4.0
imsi=0/0 lang=ko reg=-- orient=0 touch=0 dens=240 kbd=0 nav=0 input=0 ssz=0x0 sw0dp w0dp h0dp sz=0 long=0 ui=0 night=0 vers=4.0
imsi=0/0 lang=ko reg=-- orient=0 touch=0 dens=320 kbd=0 nav=0 input=0 ssz=0x0 sw0dp w0dp h0dp sz=0 long=0 ui=0 night=0 vers=4.0
[G1 Android Development] chrisch1974:
Nice to see that there is some progress on the apktool. Thanks for working on it.

I tried to fix some stuff myself but couldn't find the right way to fix the stuff. But maybe I could help you with some stuff.
[G1 Android Development] plegdroid:
just so glad I've found this thread, been using 1.4.2 to decompile and recompile framework, but could never do so with systemui, going to give it a try with 1.4.5a ,with and without class dex at decompile . thank you for taking the time to progress this and sharing. :)
[G1 Android Development] raziel23x:
I cannot wait until the official 1.4.6 release as it will fix a few major issues for my application that u have this integrated into.
[G1 Android Development] adamgaltress:
Same here, I will be sure to send iBotPeaches a few beers when the update is out as a little incentive ;)
[G1 Android Development] iBotPeaches:
Just don't worry about building it from source. The current source is bugged anyway. I just have to push broken or not so I can program at both computers.

I'll post binaries when their done. Its stressful fixing this directory bug, but I think I'm getting closer.
[G1 Android Development] raziel23x:
Ah i was just wondering why they was not compiling at all well i created batch files on my git versions to automate to process of compiling the source in windows machines i just been copying over your changes to my copy of brut.all i am thinking of just scraoing his git and use your samli and brut.all.apktool and jusy sync with yours
[G1 Android Development] raziel23x:
I was lazy and just created bat files. In each instead of a single batch to do the compiling of the packages and then the main source. If you like i can create a single maven batch installer which will make compiling easy for all who does source builds to try out your nightly builds when they do compile lol
[G1 Android Development] raziel23x:
I was going to try your version of the smali but compile issues prevent its use but as you said i will keep a eye out and grab tge source then when your ready to release
[G1 Android Development] KBizzle:
Excuse my ignorance. What do you mean by "manually fix the XML files"?? Does this just involve changing the string format? Because if that is the case, my XML strings look like that <id name="test">value</id> but contacts still FCs. Thank you for your contribution to the community.
[G1 Android Development] iBotPeaches:
To fix that.

<id name="test">value</id>

should be

<item type="id" name="test">value</item>

So do that with all of them, until apktool is done. Been busy this week, but should have time to finish up v1.4.6 soon.
[G1 Android Development] KBizzle:
Thanks. So if I am just editing Colors.xml, I just need to go through and change all of those values in that xml, Correct?
[G1 Android Development] iBotPeaches:
You know what, I think colors is just simply

<color name="name">#hexcolor</color>
[G1 Android Development] KBizzle:
Thats what mine look like when they are decompiled. :(
[G1 Android Development] iBotPeaches:
That wouldn't be the error then. Give me the exact error and I'll see.
[G1 Android Development] KBizzle:
Its not an error in apktool, its the FC of Contacts. I quoted you from a few pages back when you were explaining to someone that they could manually change the xmls and it should work so that contacts doesnt fc. Or maybe I misread. Its just beyond me how some people are able to change those colors in the xml for their themes. Its like some hidden secret, one of which I cant figure out. Lol
[G1 Android Development] iBotPeaches:
No, I mean the FC of contacts.

It should help explain this :p
[G1 Android Development] KBizzle:
I guess it isnt technically a FC. When the phone app is opened, the message "Contacts has stopped working" comes up and the phone closes.
[G1 Android Development] iBotPeaches:
Thats just a fancy ICS Force close.

Grab it via

"adb logcat".

Sorry but heading out now. So post it here, I'll get back to it.
[G1 Android Development] KBizzle:
Ok, Ill get it for you in just a min.
[G1 Android Development] KBizzle:
Here is the Logcat.
[G1 Android Development] Fusion777:
OK so I've spent a few hours searching around trying to solve this problem. It's the familiar "No resource identifier found for attribute" error that people frequently experience when working with framework-specific APKs.

However, in my case the attribute being looked for is actually part of the APK being decompiled/compiled. The App isn't framework specific, although it does require ICS.

I can actually see the attributes hanging out in their .smali files.

I'm not sure what to do here, any advice? Thanks Peaches for taking over dev & maintenance of this tool btw
[G1 Android Development] iBotPeaches:
I was a bit confused as to what you said, but the resources don't really have much to do with the .smali. As thats just the java portions decompiled using JF's baksmali.

I believe the resource identifiers is because of the changes among API versions in regards to some types filetypes that are updated, so apktool doesn't know how to handle it. So it outputs those APKTOOL_DUMMY portions.
[G1 Android Development] Fusion777:
My line of thought is that it can't find the package the resources are compiled into, so I double checked the smali files such as R$attr.smali which I am presuming get picked up on the recompile and packaged up as available resource id's. Now I see your point, the problem lies in The resources not the resource id's.

How would you suggest I proceed troubleshooting it? Reverse engineering isn't new to me, but I am definitely a newbie in the android development dept.

Sent from my iPad using Forum Runner
[G1 Android Development] KBizzle:
Did you get a chance to look at my logcat?
[G1 Android Development] expeacer:
Hy!

When you want to release the 1.4.6 version? I always get error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute? error, when I want recompile the MIUIv4 Music app, and it's very annoying :( .

Thanks for your work!
[G1 Android Development] Fusion777:
I think you might just need to load the miui framework for that one...

Sent from my iPad using Forum Runner
[G1 Android Development] expeacer:
I loaded that, i'm using Patchrom to recompile APKs, and the first move in it to load all of the frameworks.
[G1 Android Development] Fusion777:
OK just makin sure. Wish I had another suggestion for ya!
[G1 Android Development] expeacer:
Now I removed the two line, but it's not the stable solution :mad:
[G1 Android Development] iBotPeaches:
I've been busy. Its no easy task working with this application. I spend most my time setting breakpoints and just figuring out how the application works.

I've been making my own whitepapers just so I can figure out how to read the data, because I can simply read the code and understand that is skips the first 4 bytes, but by re-doing the resource side of things and understanding for myself why bytes are skipped and why things are read helps me fix it.

I don't wanna say I'll have it out by x time. I do this stuff in my free time. The positional error due to the formatted="false" is fixed in v1.4.6.
[G1 Android Development] raziel23x:
I written a compiler script that automates downloading the repos as well as compiling them over on my personal github I just have not fully tested the scripts as my development computer went into bsod mode ever since my wife decided to try and watch netflix so I had to send it back to bestbuy for repairs but it requires you to have the android sdk and maven pre installed on your windows machine.
[G1 Android Development] Thatgrass:
Error

Hey, I want to de/recompile the SEcLauncher.apk from sgsIII. But I keep getting this error: maybe you can do something?
[G1 Android Development] iBotPeaches:
You can delete those folders temporarily, as those are new folder structures in API 13 ( i think). Which apktool doesn't have support for.
[G1 Android Development] Thatgrass:
How can I get them back?
[G1 Android Development] iBotPeaches:
You can't. apktool during rebuild doesn't know how to recompile them into the APK, since it doesn't know how to handle that folder name.
[G1 Android Development] Thatgrass:
Alright, I'll wait for an update that maybe will support this :)
[G1 Android Development] Looki75:
Hello everybody!

I'm rather new to APKTools, although I already modded several apps, like:

* Changing graphics

* Changing language strings

...

There is an app I'm trying to mod right now, but it does not work.

This app was originally developed on a fixed density screen value (I guess).

On my HD2, if I set density = 240, the original app is working fine.

If I set density = 160 (my day-to-day value), the original app is shown little in the center of the screen (it does not scale).

I tried spare parts compatibility setting - no effect.

So I decided to mod the apk.

I decompile successfully.

I found the file I need to mod: dimens.xml in /res/values.

I modded it and built the apk successfully.

I signed the modded app - fine.

On the phone: when I install the app first, it is working fine! Woooowo! Scaled to full screen on my 160 density.

ISSUE THOUGH: after phone reboot, the apk in data/app folder changed size (from 15MB down to 4MB) and the app is not working anymore!!!

I don't know if it is related, but I am using an app2sd script.

Any idea how to solve the issue???

Thanks
[G1 Android Development] FredC94:
Hello there,

I'm trying to recompile an app that I have translated, but I got this error message:

This is probably due to accented characters, so how can I encode this special characters in the XML file ?

Thank you
[G1 Android Development] adamgaltress:
Any idea when the next update is going to be ready Peaches? I have a little cash in my bank when it is ready ;)
[G1 Android Development] iBotPeaches:
Its progress. I'm aiming for the end of this month.
[G1 Android Development] adamgaltress:
That is awesome! Thank you for your development on this awesome tool!
[G1 Android Development] Ticklefish:
Oh no, now I have a date to aim for. I could wait when the release date was vague but now..bring on the end of the month!
[G1 Android Development] adamgaltress:
Neither can I! :D
[G1 Android Development] iBotPeaches:
Now I definitively have to make it :)

Been working on it a lot today.
[G1 Android Development] adamgaltress:
Or we will hunt you down! :rolleyes:
[G1 Android Development] Ticklefish:
Oh, I wouldn't say that..lol
[G1 Android Development] adamgaltress:
Yeah, we should just hire someone to do it instead :p hehehe

I look forward to playing with the new release :D
[G1 Android Development] Looki75:
Do you guys think that the new release would solve my issue (quoted)?
[G1 Android Development] he_stheone64:
apktool should tell you the line in error log, were it`s malformed. You have a syntax error in your code, which you only need to fix.
[G1 Android Development] iBotPeaches:
Little progress update.

Some of the issues I'm encountering all revolve around this com.htc.resources.apk file. Even the raw aapt tool has troubles with it. Throwing random errors. I thought it had to do with dependencies that com.htc.resources had, but that wasn't it either. I'm putting that portion of apktool on the backburner. I'll spend hours debugging it stepping line by line through that file, and it just makes no sense. The output of aapt isn't reflected correctly which makes me believe that HTC has some tools that aren't exactly public, because some of their APKs are packaged in ways I haven't seen before.

This could be because I'm not understanding it properly, or an actual bug. I'm not entirely sure at this point. Merged some fixes from Charles in about the 9patch images and been testing those today as well as working with the -hdpi and -tvdpi.
[G1 Android Development] adamgaltress:
Thanks for the update :) good luck finding the issue!
[G1 Android Development] Ticklefish:
Tsk, darn HTC. Trust them to make things tricky!
[G1 Android Development] he_stheone64:
I can compile com.htc.resources from Sense 4.0 (One S) with a little workaround, don`t know if that helps in any way.

http://xdaforums.com/showthread.php?t=1642224

m.10 files are still the biggest hurdle for Sense 4.0 Themers and devs. Also you get a very severe decompile error (tested with all sorts of different apktool versions) with HtcDialer in Sense 4.0, maybe you can check the reason for that one.

Exception in thread "main" brut.androlib.AndrolibException: Arsc files with zero or multiple packages
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:67)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
[G1 Android Development] iBotPeaches:
Just duplicated that problem with HtcDialer. I wonder how a resources file can have multiple packages. I've had enough of apktool today. I'll start fresh tommorow with the hex editor, mapping out that file to see what is different.

Thanks for the heads up. As for that layout.xml problem. I thought layout.xml would fall into the default <item etc> but it appears it didn't. So I'm gonna add a resLayoutValue(), so that'll it stop that file from breaking during decompile.
[G1 Android Development] iBotPeaches:
You can re-read the last 7 pages of this topic and find anwsers to all of that. One of those errors messages is telling you how to fix it.

Add formatted="false" to any of those problems.

Switch the setup to <item type="plurals"> </item>
[G1 Android Development] he_stheone64:
Or simply use the apktool version from my thread link just 2 posts above yours. That also includes ICS smali baksmali properties.

Send from my One S
[G1 Android Development] fishingfon:
Hi,

i am trying to decompile lots of apks from the new Samsung Galaxy S3 rom from using this apktool. but i keep getting this error:

C:\Windows\system32>

C:\Windows\system32>apktool d C:\temp\applicationsprovider.apk

I: Baksmaling...

Exception in thread "main" java.lang.RuntimeException: bad magic value: 64 65 78

0a 30 33 36 00

at org.jf.dexlib.DexFile.<init>(DexFile.java:377)

at org.jf.dexlib.DexFile.<init>(DexFile.java:274)

at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder .java:44)

at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder .java:33)

at brut.androlib.Androlib.decodeSourcesSmali(Androlib .java:68)

at brut.androlib.ApkDecoder.decode(ApkDecoder.java:85 )

at brut.apktool.Main.cmdDecode(Main.java:128)

at brut.apktool.Main.main(Main.java:65)

C:\Windows\system32>

Can someone please help me with this.

Cheers Corey
[G1 Android Development] bernabap:
Can someone help me? I know that my doubt has not much to do with this program but ... I saw you talking about here resign the application is only one command line ... I tried using jarsigner but am having problems ... I am newbie ... I tried the following:

$ Java-classpath testsign.jar testsign out.apk

Exception in thread "main" java.lang.NoClassDefFoundError: testsign

Caused by: java.lang.ClassNotFoundException: testsign

at java.net.URLClassLoader $ 1.run (URLClassLoader.java: 200)

at java.security.AccessController.doPrivileged (Native Method)

at java.net.URLClassLoader.findClass (URLClassLoader.java: 188)

at java.lang.ClassLoader.loadClass (ClassLoader.java: 307)

at sun.misc.Launcher $ AppClassLoader.loadClass (Launcher.java: 301)

at java.lang.ClassLoader.loadClass (ClassLoader.java: 252)

at java.lang.ClassLoader.loadClassInternal (ClassLoader.java: 320)

Could not find the main class: testsign. Program Will exit.

I'm just trying to change an icon in the application Wapedia.apk, I do not know if it's really necessary to use this application, I could just rename Wapedia.apk to Wapedia.zip to modify the icon I want and rename back to. apk. I tried it too but I had the same problem in the installation, missed resign.

Would someone post the command line necessary to resign? Or point me to a how-to!

Before posting here I tried to find here in the forum about resign .apk, but have not found any tutorial to make me understand.
[G1 Android Development] Brut.all:
I think testsign.jar is for signing update.zip and some system files (is it true?). Jarsigner is enough to resign normal apk, instructions are here:

http://developer.android.com/guide/publishing/app-signing.html

Look into "Obtain a suitable private key" and "Sign your application with your private key".
[G1 Android Development] mezmer1ze:
I've tried your tool on Facebook.apk (v1.1.3), it decodes fine, added some stuff (translation to my native language) but it throws some errors.

Then I've tried simple decoding and building of original app without anything added and it throws the same errors.
[G1 Android Development] Brut.all:
Hah, there are almost two times more downloads of Windows installation helper than apktool ;-D
[G1 Android Development] antz88c:
newbie question: can this be used to make 2.1 apks work under 1.5? Say Google Maps 4.1.1 or FriendStream?
[G1 Android Development] Brut.all:
It could simplify some things, for example modifying minimal SDK version, so there will be no need for build.prop hacking. And... I don't know, what FriedStream is, but I think porting most of apps, including GM, is nearly impossible :-)
[G1 Android Development] Brut.all:
Just add --no-src switch :-) Ok, I will catch this exception and output suggestion about --no-src switch :-)

Someone reported it a few pages ago, but didn't answered my questions. I don't know what are 0x02* resources (0x01* is android framework, 0x7f* is an app), I guess some HTC bits, but I must do research to know, whether these resources are compatible between various HTC devices, etc. So I must find some dumps from HTC devices and look into them: boooring ;-)

At the beginning apktool wasn't embedding its dependencies, but it was to complicated for most people to install it ;-) Soo.. hmm... maybe one version with and one without dependencies? But there are many of them, so I think it doesn't make much sense, because then people will ask: and if new SDK will be released, could we use it without having to wait for a new apktool? :-)
[G1 Android Development] JsChiSurf:
LOL, I'm really not a noob, I just play one in this thread :p. Thanks for stating the obvious!

Let me know what I can do to assist.

I understand. I was really thinking more along the lines of keeping everything embedded, but allow for a switch/flag that would/could point to an external override if desired. Don't know, maybe over complicating things.

Thanks again for such a great tool.
[G1 Android Development] Brut.all:
Hmm.. it should be possible without changing apktool.jar, but wrapper script only :-) If you run it as:

java -classpath /path/to/baksmali.jar:/path/to/apktool.jar brut.apktool.Main

then AFAIK Java will use external baksmali. Of course baksmali interface must be identical to embedded one.

I could integrate such functionality to wrapper scripts, thanks for an idea :-)
[G1 Android Development] JsChiSurf:
Cool :cool:

Just wanted to report, again, for no other purpose than to hopefully assist with the continual progress of this tool, that after decompiling my framework-res.apk, with the '-s' flag (:p), my attempt to immediately rebuild resulted in the following:

: Building resources...
/home/virtualbox/android/sdk/tools/res_out/res/values/public.xml:2471: error: Public entry identifier 0x1080338 entry index is larger than available symbols (index 824, total symbols 824).
/home/virtualbox/android/sdk/tools/res_out/res/values/public.xml:2471: error: Public symbol drawable/selected_day_background declared here is not defined.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL6283854152266645869.tmp, -x, -S, /home/virtualbox/android/sdk/tools/res_out/res, -M, /home/virtualbox/android/sdk/tools/res_out/AndroidManifest.xml, /home/virtualbox/android/sdk/tools/res_out/9patch]
at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL6283854152266645869.tmp, -x, -S, /home/virtualbox/android/sdk/tools/res_out/res, -M, /home/virtualbox/android/sdk/tools/res_out/AndroidManifest.xml, /home/virtualbox/android/sdk/tools/res_out/9patch]
at brut.util.OS.exec(Unknown Source)
... 7 more

I'm guess it's a similar issue with HTC specific content...
[G1 Android Development] Brut.all:
It think not ;-) Could you upload this file somewhere (or tell from what system it was pulled - I will search for a dump).
[G1 Android Development] JsChiSurf:
Sure, this is from the most recent Sprint HTC Hero 2.1 leak.
[G1 Android Development] pl_laszlo:
Anyone know how to sign rebuilded framework-res.apk? After fresh install modded framework-res.apk (signed, not signed) casues loop.
[G1 Android Development] bitizx:
Anyone know this error

when I ran the apktool.bat, I got an error like this

(My os is WinXP sp3)

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Documents and Sett

ings\admin\Local Settings\Temp\brut_util_Jar_8912869035665469621.tmp: Can't load

this .dll (machine code=0x101) on a IA 32-bit platform

at java.lang.ClassLoader$NativeLibrary.load(Native Method)

at java.lang.ClassLoader.loadLibrary0(Unknown Source)

at java.lang.ClassLoader.loadLibrary(Unknown Source)

at java.lang.Runtime.load0(Unknown Source)

at java.lang.System.load(Unknown Source)

at brut.util.Jar.load(Unknown Source)

at brut.androlib.res.AndrolibResources.<clinit>(Unknown Source)

at brut.androlib.Androlib.<init>(Unknown Source)

at brut.apktool.Main.main(Unknown Source)
[G1 Android Development] Brut.all:
Are you sure you have apktool 1.0?
[G1 Android Development] bitizx:
sorry!

I used the old version...:o

Thanks a lot!
[G1 Android Development] Royal2000H:
If you can please help me understand how to use this, it would be greatly appreciated.

I'm trying to make some modifications of the Google Voice app.

So I ran the apktool with the d command on the apk and got my plaintext xmls and smali files.

I'm reading the smali files and they are half reminiscent of languages I am used to (java, c, php, etc) in structure but still the formatting is something I have never seen before.

So what next step do I take in order to get the files in a way that I can edit them as I wish?

Thanks! :)
[G1 Android Development] Brut.all:
Smali is assembler code, so it is quite specific ;-) But I ain't its maker, I just use it in apktool. For more info look here: http://code.google.com/p/smali/

Do not expect you will get Java code for compiled app :-)