yashsingh1/xdaforums huggingface dataset:
[Android Software Development] iBotPeaches:
Try removing the -d (debug) flag and see if that decompiles without error.
[Android Software Development] denversc:
Yep, that did it. Thanks!!
[Android Software Development] bgcngm:
denversc, how have you generated that full output log? It has been discussed before on this thread that the following command it not working as it is supposed to.

apktool d example.apk > log.txt
[Android Software Development] raziel23x:
Try

apktool d example.apk >> log.txt
[Android Software Development] denversc:
What you're looking for is:

apktool d example.apk >log.txt 2>&1

An application actually has two different output "streams" to which it can write: standard output and standard error. These two streams are both combined in the command prompt window but in fact come from two distinct sources. The number assigned to "standard output" is 1 and "standard error" is 2. So the "2>&1" merges standard output and standard error into one single stream, then the ">log.txt" redirects the resulting stream to log.txt. Applications typically send progress messages to standard output and error, warning, and log messages to standard error. Java stack traces, for example, go to standard error by default.

Note that switching the order of the redirections will not work. You must put ">log.txt" before "2>&1" to get this desired behaviour. Otherwise, the error output will not be redirected to the file but instead printed on the screen. This is true for both Windows and Linux.

---------- Post added at 02:40 PM ---------- Previous post was at 02:38 PM ----------

This will append to log.txt instead of writing overtop of it. But it won't redirect standard error to log.txt. If log.txt doesn't exist then this is exactly the same as using a single '>' character.
[Android Software Development] TorqueWrench001:
Awesome! Working well for me.

[ROM][4.2.1] Slim Bean(I897) Captivate Beta 1. Decompile framework-res.apk, and SystemUI.apk. Made some xml edits, recompile, flash to phone. Joy. Life is good.

iBotPeaches you rock

Using latest aapt and pr3.
[Android Software Development] n0need4introductions:
Pff not working for me with SystemUI.apk from Paranoid Android 2.99 BETA-9 (4.2.1) for Nexus 7, tried with the linux, windows and osx versions, always the same issue:

Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x01010457

and another "Could not decode ..." errors

I got the output folder, but when trying to compile the apktool.yml is missing... well maybe it's the ROM... or it's because it's beta...

I used different aapt files but no luck, and another framework files. Well that's my report..
[Android Software Development] joeyfettucine:
HTC's framework-htc-res has been a head scratcher for the last few otas. It compiles fine, as far as apktool goes, but all the public IDs change from 0x04* to 0x03*. Any thoughts on how to prevent this? Editing via binary is a pita. We're spoiled.

My apologies if this has already been asked. It's hard to get a good search via the app. I did peruse and didn't see anything. Thanks.

Sent from my LTEVO running Frozen Jelly Belly
[Android Software Development] bgcngm:
I had a similar problem once, not with framework-htc-res.apk, but with a secondary framework from Huawei. Back then, I had no other chance than to port those resources into main framework-res and edit all entries in smali files to those resources. Luckily, there were only just a few resources. :silly:

During the past week, I have been trying also to do some changes in a HTC ROM and have stumbled upon the exact same problem as you did. In this case, editing via binary is crazy. Maybe iBotPeaches has some idea to deal with this "issue".
[Android Software Development] cojo11:
So,i give up,after trying around 4 Weeks

I try to Compile the SystemUI now on different PC`s (from Xp to win8),i got always the same Error

Newest aapt,Java Path is correct,SDK is New,try every constalation

Maybe someone have a Look on the apk`s and try it self

Here the APK`s

http://www.mediafire.com/?itr2dhdai2zwxlb
[Android Software Development] varun.chitre15:
Do you have latest aapt?
[Android Software Development] cojo11:
Newest aapt,Java Path is correct,SDK is New,try every constalation

shure
[Android Software Development] CosmicDan:
I know for a fact that APKTool is using an old aapt.exe version. These resource folders have been supported for a *very* long time.
[Android Software Development] cojo11:
i have the aapt from OP Post,i work with GB apks the last 12month,but now with the new ICS for the LG P990 i can do what i want,with what i wnat,i cant compile the new ICS apk`s
[Android Software Development] CosmicDan:
No, you don't. Well, you do but it's not being used because an older one in your path is being used instead. All nearly all ICS and JB ROM's have those resource folders and they've been supported for over a year, so you have an extremely ancient aapt.exe somewhere in your path. I am 100% sure this is your problem because I work on ROM's every day that have these resource folders.

Go to console and type

echo %PATH%

And search all those folders for aapt.exe. Delete or rename them to disable them. Then APKTool will be forced to use the aapt.exe in the same folder as itself.

Or, RTFM. Use the new -a option to point to the latest AAPT binary.
[Android Software Development] joeyfettucine:
Yeah, that's what we've been doing. Some binary, but arrays and such are easier done the long way around.

Sent from my LTEVO running Frozen Jelly Belly
[Android Software Development] joeyfettucine:
How is that done? Is there an option I'm missing?

As for resources, don't do that. Recompile resources and one by one track down and fix the errors. Not sure we'd be dealing with the same errors.

Sent from my LTEVO running Frozen Jelly Belly
[Android Software Development] joeyfettucine:
Hit me up on pm, if you like

Sent from my LTEVO running Frozen Jelly Belly
[Android Software Development] swat4samp:
Get this error while compiling everytime i use any apk file..apkmultitool doesnt give me any error like this..using apktool 1.5.0 n latest aapt from op

D:\Anand\Android\Tools\APK Tool>apktool b JellyBean.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:162)
at brut.androlib.Androlib.build(Androlib.java:179)
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.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:158)
... 4 more
[Android Software Development] ÜBER™:
LOL its not

apktool b JellyBean.apk

Its

apktool b JellyBean

You can't compile the already compiled apk... You compile the folder. :p

Sent from my SGH-T999
[Android Software Development] swat4samp:
:confused: I didnt get you

As mentioned earlier i used to get the same error for all apk files even SystemUI.apk

Edit: Sorry for being noobish :mad:
[Android Software Development] PerfectSlayer:
The « b » option tooks a directory name, not the apk name.

That's why he said you can't compile apk ;)
[Android Software Development] swat4samp:
Um so after decompiling apk..how to compile it??
[Android Software Development] PerfectSlayer:
As UBER said here : http://xdaforums.com/showpost.php?p=35936752&postcount=1157

After decompile an apk, a directory will be created near to your apk with the same name (if you don't specified it)

So you need to build with this name (without « .apk » extension as given in the example).

(read its example and the manual ;))
[Android Software Development] joeyfettucine:
Just name the folder... Leave off ".apk"

Edit: sorry, I didn't realize it loaded a page early.

Sent from my LTEVO running Frozen Jelly Belly
[Android Software Development] swat4samp:
Now i get it..thanks for help guys :)

EDIT:Still getting some error while compiling :(

D:\Anand\Android\Tools\APK Tool>apktool b Holo
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
D:\Anand\Android\Tools\APK Tool\Holo\res\layout-v14\ok_cancel.xml:5: error: Erro
r: No resource found that matches the given name (at 'style' with value '@androi
d:style/Holo.ButtonBar.AlertDialog').
D:\Anand\Android\Tools\APK Tool\Holo\res\layout-v14\ok_cancel.xml:6: error: Erro
r: No resource found that matches the given name (at 'style' with value '@androi
d:style/Widget.Holo.Button.Borderless.Small').
D:\Anand\Android\Tools\APK Tool\Holo\res\layout-v14\ok_cancel.xml:7: error: Erro
r: No resource found that matches the given name (at 'style' with value '@androi
d:style/Widget.Holo.Button.Borderless.Small').
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, --min-sdk-version, 8, --target-sdk-vers
ion, 14, -F, C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\APKTOOL3151119297401048488.tmp,
-I, C:\Documents and Settings\Administrator\apktool\framework\1.apk, -S, D:\Anan
d\Android\Tools\APK Tool\Holo\res, -M, D:\Anand\Android\Tools\APK Tool\Holo\Andr
oidManifest.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, 8, --target-sdk-version, 14, -F, C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\A
PKTOOL3151119297401048488.tmp, -I, C:\Documents and Settings\Administrator\apkto
ol\framework\1.apk, -S, D:\Anand\Android\Tools\APK Tool\Holo\res, -M, D:\Anand\A
ndroid\Tools\APK Tool\Holo\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:253)
... 6 more
[Android Software Development] joeyfettucine:
Looks like you didn't install all your framework apks. It's looking for the styles in @android and can't find them. I don't recognize the apk. Is it system or data?

Sent from my LTEVO running Frozen Jelly Belly
[Android Software Development] iBotPeaches:
Paste those lines, or send me the APK, and re-install the framework(s) as it might be out of date. I don't see Holo support, which is like API 14. Been tracking down this styles bug for awhile. Still have plans on releasing official v1.5.1 tomorrow. I'll work about this bug and others for future releases.
[Android Software Development] swat4samp:
Actually its just a random app i tried to check whether i can succesfully recompile but got that error..just to be clear im using cm7 rom so i should install framework-res.apk right??
[Android Software Development] joeyfettucine:
I am not on CM*, but @android refers to framework-res. So always be sure to apktool if framework with system apks. If data, delete your apktool folder in your home (user) folder on your pc.

Sent from my LTEVO running Frozen Jelly Belly
[Android Software Development] DaOldMan:
Ne1 has an answer to my problems, which I described about two pages ago in post:

http://xdaforums.com/showpost.php?p=35848070&postcount=1141

Please help :)

Thanks,

Thomas
[Android Software Development] Archon810:
According to http://code.google.com/p/android-apktool/wiki/Changelog, 1.5.1 is out, but the download list doesn't have it yet. Any idea when it'll get there?
[Android Software Development] Deadly:
This vvvvvvvvvvv

___________________________________

[HELP THREAD]Ask Any Questions!

No one is listening until you make a mistake.
[Android Software Development] iBotPeaches:
Since I have to do like 100 things every release I'm doing it all now with a break every few hours, with the last thing being the release of the binary. Which is tomorrow. I'm still updating posts and WIKIs and what not getting it ready. Its been a few months since I've done an official release so I forgot what I had to do, but the official binary will be released tomorrow. Though you might see other things updating throughout today.
[Android Software Development] Archon810:
Thanks. I added a TODO in our internal AndroidPolice tracker to cover the release when the download is up.
[Android Software Development] iBotPeaches:
I need to re-write the entire non-positional XML function, as it messes up as proof in that APK. Just go to those lines and add formatted="false" in the meantime. I'll aim for a rewrite of that function later, as it will be hell to do.
[Android Software Development] einrae214:
cool i think. not trying to sound that why just confused onto what you might be saying the error report, open that file i.e strings folder and find the error line and then put what in the line. ="false"
[Android Software Development] joeyfettucine:
Check this out. The answer is there for how to add it and the root cause.

http://stackoverflow.com/questions/4414389/android-xml-percent-symbol

Sent from my LTEVO running Frozen Jelly Belly
[Android Software Development] bgcngm:
iBotPeaches, I know you're really busy with the new release of apktool, but did you had the chance to look into discussion from post 1144 and 1145 and later on posts 1152 and 1153? I just wanted to be sure you didn't missed those posts and at least you will look into that. :good:
[Android Software Development] 1982Strand:
If i want to try to do this myself, would i have to download the complete android source, or is there a way only to download the needed parts to build the aapt file? (for linux)

Thanks :)
[Android Software Development] modstorm:
I am currently working on creating a new rom for the Note 2 (Android 4.1.2) and I was trying to edit SecSettingsProvider.apk. While I could decompile it, apktool kept bringing up errors while compiling even when not even modifying the apk. On other system files it worked correctly so I'm wondering if there's a different process to use with this file ?

This is the error :

Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:168)
at brut.androlib.Androlib.build(Androlib.java:185)
at brut.androlib.Androlib.build(Androlib.java:180)
at brut.apktool.Main.cmdBuild(Main.java:209)
at brut.apktool.Main.main(Main.java:72)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:164)
... 4 more

Thanks :)
[Android Software Development] iBotPeaches:
A new version has been released!

v1.5.1 (Released December 28 - 2012 ) Codename : 4.2 Support

MigrationInstructions (v1.4.x -> 1.5.1) : http://code.google.com/p/android-apktool/wiki/MigrationInstructions#v1.4.x_->_v1.5.1

Download http://code.google.com/p/android-apktool/downloads/detail?name=apktool1.5.1.tar.bz2&can=2&q=

This is the first public release since the change from Maven -> Gradle. There are bound to be undiscovered bugs when the product reaches the estimated 250,000 downloads it gets. I will aim to fix those quickly, but I'm glad to be able to start releasing new versions very quickly. Now on my goal is

- HTC framework

- Proguard (drop JAR size from 8.9mb)

- Redo non-postional functions relating to detecting non-postional vs postional strings.
[Android Software Development] stanlin salu:
Bro, I was not able to recompile a 4.2 keyboard, do anyone can guide me, plz!
[Android Software Development] anukilimanoor:
Still I have problem with some apks example secPhone.apk. Have to edit string %
[Android Software Development] iBotPeaches:
Keep manually fixing it then. Making code for something like non-positional strings is literally impossible to get it work on every possible situation. As I said in the previous post a rewrite for that is coming.
[Android Software Development] ÜBER™:
That's not the error that's the part after the error where apktool goes on a pissy fit and craps out. You need what happens prior to that. Get us the whole log.

Sent from my Galaxy Nexus
[Android Software Development] jozka.1:
Thx for answer, but when I don't remove classes.dex so it doesn't decompile - about oldest version apktool, now with new apktool it is ok with classes.dex in apk, but compile reports the same problem.
[Android Software Development] darkmantra:
Notepadd++ Smali syntax highlighter

Hi everyone, i just want to share this syntax highlighter for notepad++ which i came across while surfing the net. It works perfectly on Notepad++ V6.1.3.

How to use:

1. Download attached smali_npp.zip file and unzip to any folder.

2. Open Notepad++, click View menu and select User-Defined Dialogue....

3. At the dialog window, click Import and locate where you unzip the smali_npp.zip and select smali_npp.xml.

4. Restart Notepad++ and open any smali file, you should have highlighted syntax.
[Android Software Development] Dunc001:
Or just start using Virtuous Ten Studio which has the most amazing interactive smali syntax highlighting (hover over for explanation, quickjumps to methods, etc) plus incredibly comprehensive built in smali help section
[Android Software Development] darkmantra:
Yep, i know this just in case peeps still want to use the old school method. :D
[Android Software Development] Blacklabel84:
Will this reverse engineer snote premium suite to get it rumning on cm9 roms?
[Android Software Development] cantIntoCode:
Java is not in your path, google how to add things to path in windows/your OS.
[Android Software Development] 1brainsurgeon:
Thank you. I did finally figure it out and still have a few head hairs to twirl. :D

Sent from my SPH-L710 using Xparent ICS Tapatalk 2
[Android Software Development] evilbarcode:
Can someone please help me with this error, I dont understand why it wont compile.

Cheers,

Evil.
[Android Software Development] bgcngm:
You are missing one resource: drawable/ic_lockscreen_settings.
[Android Software Development] evilbarcode:
Thanks I get it now. Seems stupid now. Thank-you for pointing that out. I'm slowly getting use to this.

Cheers,

Evil
[Android Software Development] iBotPeaches:
I have finished work on v1.4.9 / (other wise known as v1.4.8 beta 3).

Working on testing and will release if all tests pass. (I really just need to add as many unit tests as possible to prevent regression, but I'll save that for later.
[Android Software Development] t-ryder:
For 5 nights now I try to translate a MIUI 4 ROM. No success.

I use apktool 1.4.7 renamed to 1.4.3 in AutoAPKTool2.0.4 and decompile the MIUI4 apks I need to be translated.

Maybe this 1.4.7 will work.

Thank you.
[Android Software Development] iBotPeaches:
I didn't really read the post above mine at all. I just wanted to chime in, that I got my hands on a public aapt that seems to be in between version r16 and r18. Its not the most updated one, but it prevents the directory errors and seems to work with all APKs I've tried so far.

Heading to bed now, I have to try out Touchwiz APKs and those dreaded Sense 4.0 APKs, otherwise everything else is working.
[Android Software Development] raziel23x:
Alkyl my xml files gain a ton of spaces between all the ">" and "/>".

It does not break anything but it bloats the file size.
[Android Software Development] jozka.1:
I compiled apktool from source on the git, but I have still the same problem :( >> http://xdaforums.com/showpost.php?p=28962480&postcount=99

Any chance for repair?

Apktool v1.4.9: link removed

E: I'm sorry, if I compiled it wrong
[Android Software Development] iBotPeaches:
Don't post my un-released variants of apktool and release it here :o. I'm testing that version as I think I found one little niggle bug with Sense APKs. As for that error. I didn't experience it, please tell me the exact commands your running and what your doing in between.

You can't delete classes.dex. That is required. Everytime you say you delete the classes.dex I'm scared. You just can't do it.
[Android Software Development] jozka.1:
Excuse me.

Yes, I didn't remove classes.dex, but the problem is still.
[Android Software Development] iBotPeaches:
I lost those APKs. Could you re-send them? I thought I fixed this.
[Android Software Development] jozka.1:
Here is SystemUI > http://www.mediafire.com/?3e7k3m6n7m8e397 and framework-res > http://www.ulozto.net/x8j9CHE/framework-res-apk

Thank you for your help!
[Android Software Development] DaOldMan:
Dear iBotPeachers/Ne1 that knows :),

First congrats on the new version, you rock!

Please can you answer my post #1141 (http://xdaforums.com/showpost.php?p=35848070&postcount=1141) ?

For some reason no one has seemed to say anything about this.

Many thanks and happy new year,

Thomas (IceBullet-Rom)
[Android Software Development] einrae214:
this is what im getting now.

Microsoft Windows [Version 6.0.6002]

Copyright (c) 2006 Microsoft Corporation. All rights reserved.

C:\ics apktool\ICS Apktool>apktool b secphone1 secphone-new.apk

I: Checking whether sources has changed...

I: Checking whether resources has changed...

I: Building resources...

C:\ics apktool\ICS Apktool\secphone1\res\values-es\strings.xml:195: error: Multi

ple substitutions specified in non-positional format; did you mean to add the fo

rmatted="false" attribute?

C:\ics apktool\ICS Apktool\secphone1\res\values-es\strings.xml:196: error: Unexp

ected end tag string

C:\ics apktool\ICS Apktool\secphone1\res\values-es-rUS\strings.xml:204: error: M

ultiple substitutions specified in non-positional format; did you mean to add th

e formatted="false" attribute?

C:\ics apktool\ICS Apktool\secphone1\res\values-es-rUS\strings.xml:205: error: U

nexpected end tag string

C:\ics apktool\ICS Apktool\secphone1\res\values-it\strings.xml:201: error: Multi

ple substitutions specified in non-positional format; did you mean to add the fo

rmatted="false" attribute?

C:\ics apktool\ICS Apktool\secphone1\res\values-it\strings.xml:202: error: Unexp

ected end tag string

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl

ibException: brut.common.BrutException: could not exec command: [aapt, p, --min-

sdk-version, 16, --target-sdk-version, 16, -F, C:\Users\Beatrice\AppData\Local\T

emp\APKTOOL3767036759111958970.tmp, -I, C:\Users\Beatrice\apktool\framework\1.ap

k, -S, C:\ics apktool\ICS Apktool\secphone1\res, -M, C:\ics apktool\ICS Apktool\

secphone1\AndroidManifest.xml]

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:357)

at brut.androlib.Androlib.buildResources(Androlib.java:282)

at brut.androlib.Androlib.build(Androlib.java:205)

at brut.androlib.Androlib.build(Androlib.java:176)

at brut.apktool.Main.cmdBuild(Main.java:218)

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

Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not

exec command: [aapt, p, --min-sdk-version, 16, --target-sdk-version, 16, -F, C:

\Users\Beatrice\AppData\Local\Temp\APKTOOL3767036759111958970.tmp, -I, C:\Users\

Beatrice\apktool\framework\1.apk, -S, C:\ics apktool\ICS Apktool\secphone1\res,

-M, C:\ics apktool\ICS Apktool\secphone1\AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:349)

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:335)

... 5 more

Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd

k-version, 16, --target-sdk-version, 16, -F, C:\Users\Beatrice\AppData\Local\Tem

p\APKTOOL3767036759111958970.tmp, -I, C:\Users\Beatrice\apktool\framework\1.apk,

-S, C:\ics apktool\ICS Apktool\secphone1\res, -M, C:\ics apktool\ICS Apktool\se

cphone1\AndroidManifest.xml]

at brut.util.OS.exec(OS.java:89)

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:347)

... 6 more

C:\ics apktool\ICS Apktool>
[Android Software Development] iBotPeaches:
Send me the frameworks & that APK. You only sent the APK. Nothing I can with that :(

@einrae214 Go to those lines in XML and add formatted="false" as attributes.