yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] jonata:
try as you say but I have this :

....

F:\APKTool>apktool b systemui.apk

Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN

otExist: apktool.yml

at brut.androlib.Androlib.readMetaFile(Androlib.java:142)

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

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

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

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

Caused by: brut.directory.PathNotExist: apktool.yml

at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:

103)

at brut.androlib.Androlib.readMetaFile(Androlib.java:138)

... 4 more

......

somethings about apktool.yml

???

tks mate

SOLVED !!!!!

wrong input : apktool b systemui is right ..... wa in wrong because type : apktool b systemui.apk ....

no need extension .apk

tks to all

:D
[G1 Android Development] Droidzone:
You didnt try what I told you to..You're still typing it wrong..

apktool b systemui.apk

That does not make sense. systemui.apk is a file. Where's your source directory which should be compiled to a file?

apktool b systemui systemui.apk

is the command if systemui is the dir you extracted it to.. apktool cant find any valid files when you dont specify a source folder
[G1 Android Development] Droidxda:
Hi all,

i m new in moddind app :) i try to decompile SystemUI.apk of my HTC Desire HD port ROM.

apktool d -d SystemUI.apk

didn't give me the smali directory, and i don't know what to do.

i hava no error, and the res is created, but not the smali, i d looked for in google, xda and i don't find anything.

i use the apktool-R04-brut1 on linux.

any help will be appreciate.

thank you

EDIT - Finally i found, i m on an odexed ROM :)
[G1 Android Development] 00McD00:
I am having trouble recompiling the framework-res from ICS 4.0.3 I have the latest apktool with the Aapt.exe from the SDK and it has worked great on other ICS files like the SystemUI, etc. but even when I try to compile a non-modified framework-res I get errors from res>values>plurals line 79. Does anyone have a solution/workout for this? TIA.
[G1 Android Development] vegetaleb:
So this ICS systemui problem(flags errors) is for all brands or only HTC?

And is it limited to systemui or all system apks?
[G1 Android Development] akellar:
Trying to decompile/recompile framework-res.apk for Galaxy Nexus. Any ideas why I am getting this error? Decompiled with 1.4.2, compiled with 1.4.3 (fixes plurals errors). Framework is installed. http://pastebin.com/Ydh73HQW
[G1 Android Development] xavierjohn22:
This is basic apktool know how, this thread

In the xml, all those in public variables are not in the values.xml, thats why it throws error.
[G1 Android Development] akellar:
Basic know how? The rom dev didn't know either so I wouldn't call it basic. I'm not changing anything from the rom's framework, simply decompiling/recompiling. No changes should mean no issues.
[G1 Android Development] erdano:
anyone know how to compile and build the framework of the MIUI v4??

thanks
[G1 Android Development] mattmanwrx:
Try with an updated aapt.exe.... i think that is the problem...
[G1 Android Development] mattmanwrx:
Known issue with ics, code.google.com/p/android-apktool/issues/detail?id=277&colspec=ID%20Stars%20Type%20Status%20Priority%20Milestone%20Owner%20Summary if u "star" the problem i think it gets updated quicker....
[G1 Android Development] lanternslight456:
I'm working on /system/framework/android.policy.jar

This is with a Gingerbread file.

I've tried this with apktool 1.4.3 and 1.4.2

I've tried this even without edits (a straight decode then build)

I've tried this with and without frameworks tagged.

When decompiling it gives me the apktool.yml and everything is broken down into .smali files

Whichever way I do this (with or without framework) the apktool.yml reads:

of course when I used 1.4.2 it stated that instead

I know the frameworks are correct, I use it all the time for other things no problems.

I also tried manually editing the apktool.yml to

and then

always the same error
[G1 Android Development] tommytomatoe:
This is a jar file...you need to use baksmali to decode then smali rebuild..

But a shortcut is to change the extension from jar to apk. Then run.the commands.

apktool d android.policy.apk

You'll get a folder android.policy

Then.build

apktool b android.policy

Rename new file back to jar. Good to go.
[G1 Android Development] lanternslight456:
Thank you very much

this has been a message from the dead pool.
[G1 Android Development] ldiomedi:
Hi. I'm trying to moddific my SystemUi.apk from cm9. i install apktool several times from several sources and severals ways and the result is the same. I try in windows 7 and ubuntu 11.10 and get the sames errors.

Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL4969943293578220603.tmp, -I, /home/ldiomedi/apktool/framework/1.apk, -S, /home/ldiomedi/apktool/projects/SystemUI/res, -M, /home/ldiomedi/apktool/projects/SystemUI/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more

Have to said that aapt is already in PATH and have the correct permission. I'm connfused because all the people has haave the same error could fix it puting aapt in the path, but mine is in there. Can anybody know why is that? Thanks so much.

Lucas
[G1 Android Development] mattmanwrx:
Do you have the latest aapt from API 16... it could be your error...
[G1 Android Development] ldiomedi:
I downloaded directly from Google's sources page. I suppose it's for the last api
[G1 Android Development] mattmanwrx:
Have you installed the framework from the rom that the systemUI is from?
[G1 Android Development] ldiomedi:
Mmmm. I didn't. How should i do that? I never read about that before
[G1 Android Development] mattmanwrx:
http://code.google.com/p/android-apktool/wiki/FrameworkFiles will tell you all you need to know about installing framework, but to make it short,

apktool if framework-res.apk

But please do read up about it, cos you can tag them for different framework-res.apk files from different roms...
[G1 Android Development] ldiomedi:
Thanks matt. I'll try tonight at home. Then I'll tell you if i could do it. Thanks again
[G1 Android Development] leftheodo:
Has anyone found a way to decompile systemUI.apk with dependencies of htc.resources.apk without gettting an error? (Sense 3.6, Android 4.03, apktool 1.43). Thanks in advance!
[G1 Android Development] leftheodo:
+1 to that! I've tried every "fix" available ( i think ;) ) but i get the same error! HTC messed up something with the new resources! If someone has a tip i'll be very gratefull!
[G1 Android Development] memnoc:
Don't worry folks, i found the key, soon a guide will come in dhd dev section;)

Inviato dal mio HTC Desire HD with Beats Audio usando Tapatalk
[G1 Android Development] 80slovechild:
i have been trying to edit the ics framework-res for my droid razr. i can decompile and edit the files but i cannot build apk

im using ubuntu with latest sdk and apktools installed

apktool d works without errors

apktool b gives this error http://pastebin.com/igNfHS1V

what do i need to do. any help would be appreciated
[G1 Android Development] atlaware:
Any news about the dj options?

Regards
[G1 Android Development] atlaware:
Ok, found the problem... apktool generate java until version 1.4.2. Use 1.4.1 and all work ok.

Regards
[G1 Android Development] Droidzone:
This doesn't yet have ics support, right? Decompiled an ics Non-system app, recompiled without changes. It failed to start up stating a bland 'Resources error'. apktool itself did not report any errors while working on it. maven refuses to compile apktool from source so I can't see if brut is working on something.
[G1 Android Development] PFittech:
Some news about support for AND 4.0+ ?

De/compiling apk its not possible for ISC souces-apks :(

...Config flags size > 32. Exceeding bytes: -1FFF0000.

W: Invalid config flags detected. Dropping resources: bool-v13-ERR10

....at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)...
[G1 Android Development] deaffob:
Same thing happens to me when I tried to recomplie framework-res.apk
[G1 Android Development] he_stheone64:
For ICS 4.03 or 4.04 framework (or other ICS apk`s) try the following, which always works for me:

Decompile with this modified apktool version:

http://dl.dropbox.com/u/348210/apktool.zip

Make your changes and then compile with standard apktool 1.43

---------- Post added at 12:29 PM ---------- Previous post was at 12:25 PM ----------

See my comment and link above.
[G1 Android Development] janis605:
I am using this way:

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

it is a bit more complicated, but it works for me! ;)
[G1 Android Development] sambastrakan:
Working fine to decompile/recompile framework-res.apk from ICS4.0.3 AOSP ! No more multiple substitutions errors.

Thanks or that !
[G1 Android Development] TUN_SD:
with every ICS framework I set

java -jar apktool.jar if framework-res.apk

I get errors in some files like

<item type="drawable" name="APKTOOL_DUMMY_02b3">false</item>
<item type="drawable" name="APKTOOL_DUMMY_0571">false</item>

I tried 1.4.2 and 1.4.3, no success!

I tried nearly every guide, what can I do to de/compile framework.res with no errors?

never had problems with GB apks. Its annoying!!
[G1 Android Development] he_stheone64:
Solution is only 3 posts above your`s...:D
[G1 Android Development] TUN_SD:
sadly not! I tried it, but same errors, but if you want to test, see attached..

I used these commands:

java -jar apktool.jar if framework-res.apk

java -jar apktool.jar d framework-res.apk

java -jar apktool.jar b framework-res.apk

(thanks for trying)
[G1 Android Development] memnoc:
Hey @stehone how r u??;) we miss u;)

Check this, could find it useful and it works 100% for me, i resized an entire Sense this way

http://xdaforums.com/showthread.php?p=22845752

Inviato dal mio HTC Desire HD with Beats Audio usando Tapatalk
[G1 Android Development] bmfc187:
I moved the files apktool, apktool.jar, and aapt to /usr/local/bin, i type apktool in terminal, and get the following:

bmfc@bmfc-laptop:~$ apktool
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
bmfc@bmfc-laptop:~$

anybody help me out with this? using ubuntu karmic...thanks in advance...

-BMFC
[G1 Android Development] spongaweb:
So has anyone used this or found out any other method to avoid the blacklisting in NBA League Pass?

Mainly I think it has to feeding it another 'fake gps' coordinate, maybe this is the tool.

Iphone already has their version unlocked
[G1 Android Development] Brut.all:
I ain't Java master, but quick Googling and it seems you have older Java version installed. But it is weird, cause in Karmic repos there is 1.6 only :-/ (and 1.6 is required one)

Try: "java -version".
[G1 Android Development] kingchris:
you have first to remove all java5 versions onyour pc

then install java6
[G1 Android Development] JAguirre1231:
Sounds like he has both 1.6 and 1.5 (1.5 is needed to build from source last time I checked). To fix I did this:

sudo update-java-alternatives -s java-6-sun

If it throws out errors, ignore. It's basically saying there are no alternatives for files from your previous Java, but it is setting your system up to use Java 1.6.

Then for Android, I forget which command I used, so do both:

export ANDROID_JAVA_DIR=$JAVA_DIR

export ANDROID_JAVA_HOME=$JAVA_HOME

This worked for me, but YMMV
[G1 Android Development] kingchris:
@brut.all do you add a support for odex-files?
[G1 Android Development] Brut.all:
Maybe later. I prefer to work on some unique features and deodexing would be just a copy of deodexer functionality.
[G1 Android Development] bmfc187:
thanks guys yeah i switch back and forth between 1.5 and 1.6 for certain things, and im quite familiar with update-java-alternatives, i guess i just figured that this would require 1.5 just like the android build system does. user error. thanks for the help! now lets see what this puppy can do!

-BMFC
[G1 Android Development] flak0:
Hopefully things like decompiling and recompiling the desire browser without the XML errors Hehe. Awesome Work
[G1 Android Development] UAE:
Not workin ?? :?

Worked through instructions, but am still getting the below when running without commands:

[Lotidroid@Loti ~]$ apktool
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at brut.apktool.Main.main(Unknown Source)

JRE version is:

[Lotidroid@Loti ~]$ java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)

Seems like a bug :/, running on Fedora 12
[G1 Android Development] Brut.all:
Are you sure you have latest apktool.jar file? Earlier version (0.9.1) did not have decent args parsing and it just crashed when something goes wrong.
[G1 Android Development] canadiancow:
Finally got around to playing with the new apktool.

I think that for the Windows bat file, you should replace the main line with:

java -jar %~dp0\apktool.jar %1 %2 %3 %4 %5 %6 %7 %8 %9

%~dp0 represents the path of the bat file, so as long as the jar is in the same directory, it will work.

I am never going to stick some random third party application in my Windows directory, so this allows me to put it anywhere on my path, and still use it with just "apktool".

Edit: Maybe I'm missing something, but in your video you had a "dj" option for decoding into "Java". Is this not yet present?
[G1 Android Development] rac2030:
As far as I know from my talks with brut.all, this is in early development stage and just works for picked apps and producing errors on most of the apps.

Even that I know that it's not easy to make a proper translator, I can't await that switch ;-P
[G1 Android Development] domenukk:
supernice and working so far.

but a dj option would be awsome, indeed.

reading smali, no play, makes domenukk a dull boy :D
[G1 Android Development] culy:
system application

The tool is amazing, I am using it to add local language of MOTO milestone 2.1.

But some of the system applications can not be built correctly, such as Settings.apk, in windows just blocked at >I: Building resources...I have attached the apk file.

The log showed android package in resources.arsc was skipped, is it necessary to fix android.jar to change some ids to public as you said?

If you have no time to fix the android.jar, could you please tell me how to fix it?It will be very helpful for me...
[G1 Android Development] Brut.all:
Thanks! I wanted to do it this way, but didn't know how :-)

Yes, I understand you, but you should consider that this is an "Installation for noobs" :-) General instructions are just: JRE, aapt in PATH, apktool.jar somewhere and that's all - you could setup it, as you want. Noobs don't know, what PATH is, how to run jar file and they usually don't care about putting some new files to system directories. AFAIK only Windows and system32 directories are always in a PATH and first one is less "internal one", so I've chosen it.

About "dj" command: it is harder, then I thought - Java has many, many troublesome features like: synthesized methods and classes, anonymous classes, etc. And even if I don't need to fully decompile code, just extract declarations, this will involve some "decompile thinking" too. But I have made some progress :-)

Ahh and this will be "apktool d[ecode] [-j|--java]" to be consistent with current interface.

I know of that bug, it is one of ****ty things among niceness of Java (I'm new to this language, so I still compare it to other ones). If you run Process.waitFor() method, Java will block and if executed command will fill out its whole output buffer, then it will block too. So: underlying process waits for calling process and calling process waits for called process ;-)

It is weird to me that Process doesn't have any method for non-blocking checking of process status, so I could read from Process buffers during its runtime. I'm sure that there is some simple solution to this problem, but it should be straightforward. I didn't even do any googling for that yet.

Sometimes there are some few framework resources in an app O_o I don't know, what they are and how to write such thing to XML files. So far I was skipping these resources and everything was fine.

Earlier I thought that only a few "bad" apps (Google Maps, DeskClock) use private framework resources and because making resources public is dirty hack, I've chosen to publicize these required resources only. Now I see that there are more such apps (Settings.apk), so I think we have no other choice than to make all framework resources public.

I did it through editing in hex ;-) If you run "aapt d resources android.jar" then you will see many of "flags=0x40000000". That "4" at the beginning is public flag. It is possible to find this data in binary file: all flags from one type are stored in a block, one after another.

And maybe I don't have arsc-file builder, but... I have a parser :-) I will hack it to run through android.jar file modifying all public bits. It should not be a problem.
[G1 Android Development] canadiancow:
Maybe you should release a beta version with the current implementation of the j flag ;)
[G1 Android Development] olearyp:
There may be a simpler way, but here's how I handle it in GUSTO. The interesting bit starts at line 56, with the key stunt being lines 71-98.
[G1 Android Development] Brut.all:
Not a bad idea :-)

All we need is Java code, that is compilable and has (nearly) identical interface/declarations as smali files. It doesn't really matter, whether apktool will decode it to 100% correct form or it will fail with some things and then human will correct them. So even current version might be described as "fully workable", but it involves more manual works, than future versions will.

For know I found some apps, which had just a few (<10) errors after decoding and I corrected them in minutes. Most of apps are too errorous though.

Ahh and I think decoding to Java may be semi-automatic forever. There are some really problematic situations, mainly related to that Java bytecode does not have to obey Java source rules - it may be just not presentable as 1:1 sourcecode.

For example I found an app that after decoding had two methods with identical prototypes. How was it possible? One of them was synthesized hence was called by different bytecode instructions, so JVM could run it properly. But how to write it as Java code? We can't just remove that synthesized method, because it is referenced in smali-in-a-comment and we can't have both of them too. I think I would change name of one of them, but then I will have to modify it in all smali-in-a-comment blocks too...

So I warn you that it is quite probable, that Java decoding may require good smali and Java understanding even in apktool 6.2.1 .

Thanks :-) I was thinking about another thread - it may be standard way to do such things in Java.

But... this is what irritates me most in Java - it is f** awesome language, but there are many things, that need to be written in 30 lines of code, even if there will be just 2 lines in other language. I'm Python minimalist, I hate such things.
[G1 Android Development] olearyp:
I hear 'ya, I like Python too. :) In truth, I'm a MATLAB programmer at heart...but you do get into silliness like directly calling Java from MATLAB (it's like BeanShell with completely different syntax) and all sorts of fun results--like having two different types of strings running around which are sometimes compatible, with no apparent rhyme or reason.

Of course, given that Java is a statically typed imperative language, I do expect it to be more verbose than the dynamic languages--which doesn't mean I don't miss vectorized operators/listcomps when in Java, which would work just fine with static typing, thank you (Haskell, anyone?)

Anyway--back sort of on topic--an uncomfortable fact of Java is you end up having to create threads waaaaay too often, then Java goes and makes concurrency difficult, so it's just a pain in the rear. This is even more true when using the common GUI toolkits (Swing, Android) which are not thread-safe.
[G1 Android Development] benj9:
apktool / framework-res - problem

I have the problem: decompile framework-res.apk with apktool, make minor changes and then recompile it. But the phone then enters a bootloop. When I push back the original framework-res, everything fine again.

I tried with decompile framework-res and recompile without any changes, same problem.

Recompiling was without any errors. What is the problem?

( Using SGS2 (tried even with different roms/kernels, even with stock rom and simple cf kernel). Used adb to pull and push the framework-res from/to phone. )
[G1 Android Development] TUN_SD:
http://xdaforums.com/showpost.php?p=22836863&postcount=1578

same problem! apktool doesn´t de/compile without errors and failures!

I don´t have a solution for this atm! I´m pi....ed off too!:mad:
[G1 Android Development] benj9:
Yeah that's really strange. I am wondering how the theme makers compile the framework-res. Obviously not with apktool, or they have some extra voodoo.
[G1 Android Development] TUN_SD:
Its the voodoo!

I believe, that if you have a stock rom, like the nexus one, than it works all fine.

But I have a AOSP rom, compiled from the source code, and that makes problems.

If somebody have another idea or can correct me, please let me know!
[G1 Android Development] Zaiaku:
Not sure what happened. I tried it first time and everything worked great. No problems what so ever. I desided to just rename the pakkage name and recompile and now I keep getting an error msg

Nothing else was changed. Using the exact same source files.
[G1 Android Development] shanman-2:
Problem compiling SystemUi.apk????

I am using APK Multi-Tool and have no problem de-compiling SystemUi,apk,

thing is I get the same error if I edit anything inside the apk or not..

All the errors are related to pubic.xml and drawables

no .9.png errors

I have included the logcat file.

Would appreciate any help... thanks
[G1 Android Development] TUN_SD:
Where is the beginning of the log?

Delete public.XML and try again. If apktool has one error, sometimes all the pngs are fail. Please Try and report.

send with ice cold fingers
[G1 Android Development] shanman-2:
Have tried deleting public.xml, no joy!!

Just ran it through again, seems to start at the end of an error...?

new log below
[G1 Android Development] mattmanwrx:
have you installed the correct framework-res from the rom that the systemui is from?
[G1 Android Development] TUN_SD:
ok, I´m no pro to that, but it looks to me, that you have some problems with some png images.

ERROR: Failure processing PNG image

which rom you are using? (maybe it is modded)

can you attach the systemUI.apk?
[G1 Android Development] shanman-2:
Just pulled it from the rom, tried using the framework-res.apk from the same rom( hyperdroid 5.8.0) as a dependee and it gets rejected..

---------- Post added at 07:36 PM ---------- Previous post was at 07:32 PM ----------

Just pulled it from the rom, tried using the framework-res.apk from the same rom( hyperdroid 5.8.0) as a dependee and it gets rejected..