yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] zenkinz:
hi all,

I am trying to use apktool to modify framework-res.apk to change the text font color

I use both 1.3.1 and 1.3.2.

In both instances, the decompile and recompile are both ok. But I get into a bootloop. What could be the reason?

I did get some warning, but thought they looks ok

C:\Android\APKTool\Overcome>java -jar ..\apktool.jar b framework-res

W: Could not find sources

I: Checking whether resources has changed...

I: Building resources...

aapt: warning: string 'attempts' has no default translation in C:\Android\APKToo

l\Overcome\framework-res\res; found: bg cs da de el es es_US et et_EE fi fr ga g

a_IE hr hu is is_IS it kk kk_KZ lt lv mk mk_MK nl no no_NO pl pt pt_PT ro ru sk

sl sl_SI sr sv tr uk

aapt: warning: string 'global_actions_orange' has no default translation in C:\A

ndroid\APKTool\Overcome\framework-res\res; found: cs de es fr pl ro

aapt: warning: string 'keyguard_password_attempts_count_pin_code' has no default

translation in C:\Android\APKTool\Overcome\framework-res\res; found: bg cs da d

e el es es_US et fi fr ga hr hu is it kk lt lv mk nl no pl pt pt_PT ro ru sk sl

sl_SI sr sv tr uk

aapt: warning: string 'lockscreen_sim_puk1_blocked_message' has no default trans

lation in C:\Android\APKTool\Overcome\framework-res\res; found: cs da de el es f

r it pl pt pt_PT ru sv tr

aapt: warning: string 'permlab_accessLocationExtraCommands' has no default trans

lation in C:\Android\APKTool\Overcome\framework-res\res; found: bg cs da de el e

s es_US et et_EE fi fr ga ga_IE hr hu is is_IS it kk kk_KZ ko lt lv mk mk_MK nl

no no_NO pl pt pt_PT ro ru sk sl sl_SI sr sv tr uk zh_CN zh_HK zh_TW

aapt: warning: string 'serviceClassDataTurnigOff' has no default translation in

C:\Android\APKTool\Overcome\framework-res\res; found: bg cs da de el es es_US et

fi fr ga hr hu it pl pt

aapt: warning: string 'serviceClassDataTurnigOn' has no default translation in C

:\Android\APKTool\Overcome\framework-res\res; found: bg cs da de el es es_US et

fi fr ga hr hu it pl pt

aapt: warning: string 'shutdown_confirm_Orange' has no default translation in C:

\Android\APKTool\Overcome\framework-res\res; found: bg cs da de el es es_US et f

i fr ga hr hu is it kk lt lv mk nl no pl pt pt_PT ro ru sk sl sl_SI

I: Building apk file...

C:\Android\APKTool\Overcome>
[G1 Android Development] tommytomatoe:
I've had that error before, and I fixed it by replacing my aapt with a compatible one. I was recompiling a framework-res from a froyo rom with a gb aapt.
[G1 Android Development] JGW310:
i am trying to install this on my mac............. uh, a little help here?? how do i "unpack" them in usr/local/bin??????????

PLEEEEEEEEAAAAAAASEEEEEEEE HELLLLLLPPPPPPPPP!!!!!!!!!!!!!!
[G1 Android Development] xavierjohn22:
can you send me your froyo froyo and gb aapt?

need to use it too, lol. Thanks buddy

xavierjohn22@gmail.com
[G1 Android Development] xavierjohn22:
No problem dude.

yeah 1.3.1 also has no problems for me, when GB miui comes along, i feel the need for this since we're like batch processing every week, ha ha.

thanks again.
[G1 Android Development] xavierjohn22:
have you tried correcting those unwanted string above and recompile again?

if yes, try to use my tool

http://xdaforums.com/showthread.php?t=1053227
[G1 Android Development] tommytomatoe:
Sure thing. Next chance i get. I'm moving right now...
[G1 Android Development] pendo:
Well, maybe I can help with this one then....I just recently discovered this, but froyo aapt is in your sdk.

(whatever you named sdk directory)/platforms/android-8/tools
[G1 Android Development] xavierjohn22:
Yeah but i already have the latest config, thought he could send faster, lol

C:\android-sdk-windows\platform-tools
[G1 Android Development] zenkinz:
Ok turns out it is because i didnt copy over the manifest xml and meta folder to the newly compiled apk.

Everything works well once i do tt.
[G1 Android Development] Jwtiyar:
cutiyar@cutiyar-laptop:~$ apktool

apktool: command not found

cutiyar@cutiyar-laptop:~$

what that problem?
[G1 Android Development] Brut.all:
Hah, I've just read last 15 pages of this thread ;-D

I must say: thank you guys for support and helping others. This is really great that I don't develop apktool for many months, but still it has its community - it wasn't abandoned :-)

As you might notice I pushed ~25 commits and sent nearly 100 updates to issues in last 2 days. There will be v1.3.3 soon. Finally ;-)

But I have no idea about these problems with Settings app on newer HTC devices. Only one clue is that Intent doesn't have component set. Did you tried to install any alternative launcher and use it?
[G1 Android Development] Brut.all:
Ok, that's not true. "Starting: Intent {}" message does not tell you what intent was sent by a launcher, but what was matched.

Could someone upload htc framework and settings.apk?
[G1 Android Development] kam333:
Hi

im trying to decompile google maps v5.4, but keep receiving the following error:

Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f020022 drawable/btn_compass_mode, config=-mdpi

at brut.androlib.res.data.ResConfig.addResource(Unknown Source)

at brut.androlib.res.data.ResConfig.addResource(Unknown Source)

at brut.androlib.res.decoder.ARSCDecoder.readEntry(Unknown Source)

at brut.androlib.res.decoder.ARSCDecoder.readConfig(Unknown Source)

at brut.androlib.res.decoder.ARSCDecoder.readType(Unknown Source)

at brut.androlib.res.decoder.ARSCDecoder.readPackage(Unknown Source)

at brut.androlib.res.decoder.ARSCDecoder.readTable(Unknown Source)

at brut.androlib.res.decoder.ARSCDecoder.decode(Unknown Source)

at brut.androlib.res.AndrolibResources.getResPackagesFromApk(Unknown Source)

at brut.androlib.res.AndrolibResources.loadMainPkg(Unknown Source)

at brut.androlib.res.AndrolibResources.getResTable(Unknown Source)

at brut.androlib.Androlib.getResTable(Unknown Source)

at brut.androlib.ApkDecoder.getResTable(Unknown Source)

at brut.androlib.ApkDecoder.decode(Unknown Source)

at brut.apktool.Main.cmdDecode(Unknown Source)

at brut.apktool.Main.main(Unknown Source)

Could Not Find C:\Documents and Settings\Kam1\Desktop\APK Manager\place-apk-here-for-modding\../place-apk-here-for-modding/signedtGMaps54.apk

Could Not Find C:\Documents and Settings\Kam1\Desktop\APK Manager\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedtGMaps54.apk

a search has thrown up several similar ppl with this issue (1 example):

http://code.google.com/p/android-apktool/issues/detail?id=148

also a possible work around:

https://github.com/fboldog/brut.apktool/commit/1b6d63cb355d4a36274f5edf0383a2c4e6e0f868#diff-0

however i have no idea how to implement or test this fix.

any pointers would be appreciated

Many thanks

p.s. no problems with most apk's, tho this has occurred once before with a different app
[G1 Android Development] Brut.all:
As you can see I set it's a duplicate of Issue 124: http://code.google.com/p/android-apktool/issues/detail?id=124#c12 and there you could find my comment:

Download above file, grab newer aapt tool from Android SDK, remove $HOME/apktool/framework/1.apk file and you're ready to go. Or just wait for next version of apktool.
[G1 Android Development] kam333:
thanks for the quick reply,

i updated my sdk at the start of the week but still have the issue, i read your comment "wait for new apktool-install-* packages :-)" thinking the fix from https://github.com/fboldog/brut.apktool/commit/1b6d63cb355d4a36274f5edf0383a2c4e6e0f868#diff-0 will be added at a later date.

will try updating sdk again.

thanks.
[G1 Android Development] Brut.all:
Newer aapt/sdk is needed to build apk back. If you can't even decode it, then it's not related to aapt.

I think you still use old apktool.jar. Could you check this out?
[G1 Android Development] kam333:
not sure how to check this?

im using apk manager 4.9 the apktool.jar in the "other" folder says modified 3 sept 2010.
[G1 Android Development] Brut.all:
Did you downloaded file from my above link: http://www.multiupload.com/YSAIN889OA ? It was built few days ago. I think Sept10' is an apktool v1.3.2 .
[G1 Android Development] kam333:
just tried, now getting a new error?

W: Could not decode attr value, using undecoded value instead: ns=android, name=hardwareAccelerated, value=0xffffffff

I: Decoding file-resources...

W: Could not decode attr value, using undecoded value instead: ns=android, name=iconifiedByDefault, value=0x00000000

W: Could not decode attr value, using undecoded value instead: ns=android, name=iconifiedByDefault, value=0x00000000

W: Could not decode attr value, using undecoded value instead: ns=android, name=showAsAction, value=0x00000005

W: Could not decode attr value, using undecoded value instead: ns=android, name=showAsAction, value=0x00000005

W: Could not decode attr value, using undecoded value instead: ns=android, name=showAsAction, value=0x00000001

I: Decoding values*/* XMLs...

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

edit: just checked projects folder & it has finally decomp' the res folder, my concern is that it wont recompile.
[G1 Android Development] Brut.all:
In my first post I've written:

There were just 3 things to do, but I had to repeat android.jar part. Now seems you didn't remove 1.apk file as well (or did that before android.jar replacement). Remove $HOME/apktool/framework/1.apk and you should be able to decode your file without errors.
[G1 Android Development] kam333:
no need to get arsey, before your comment, you quoted =

"I think I have fixed Honeycomb support in apktool 2 days ago. You could build it from sources or use this one apktool.jar: http://www.multiupload.com/YSAIN889OA . It's built from 9612159d254df45aa53f."

so it wasnt clear your instructions were aimed at my issue since i did not mention honeycomb in my query.

anyways, thanks for your help so far. il take it from here.

regards

Kam
[G1 Android Development] pendo:
Hey Brut.all, good to see you in your thread again. :)
[G1 Android Development] Brut.all:
In this thread and in development :-)
[G1 Android Development] Devildog8791:
Which aapt tool should I grab, the one out of the platform-tools folder?

Edit: I figured it out. Thank you for the update, Brut.all. I was starting to go insane because I was getting so many errors lately.
[G1 Android Development] kam333:
just posting to confirm this works, not so much for your benefit but for others having issues, whilst i was searching for a solution, ive seen a number of ppl on different sites with similar errors, hopefully they will find this thread.

although you appear to be a bit of an a$$, your a bit clever too :)

thanks once again, much appreciated.
[G1 Android Development] Brut.all:
When I will release next version of apktool, I will post migration instructions on a project site: update apktool, update apktool-install-* (which contains aapt), remove 1.apk file.
[G1 Android Development] klquicksall:
thanks for the great tool.
[G1 Android Development] JGW310:
how do i unpack to /usr/local/bin?????????????
[G1 Android Development] tommytomatoe:
Check your pm buddy.

tar -C /usr/local/bin -xvf <zipped file>
[G1 Android Development] pendo:
Tommy's suggestion would probably be considered the pro way to do it (certainly fastest). But when I was first getting my feet wet, I actually used another method.

I enabled viewing of hidden files/folders. Then I just dragged/dropped into /usr/local/bin. It will ask for your password. While you can enable viewing of hidden files folders with a terminal command, you can also use Secrets Preference Pane. Makes a lot of "hidden" features of Mac easily and quickly accessible. Download Secrets PrefPane 1.0.6
[G1 Android Development] tommytomatoe:
Pendo is a cool dude!

If you don't want to install the secrets prefpane (which you should), you can also install this app. Link below. It's sole purpose is to hide and reveal hidden files and directories. Works on OS x 10.2 and up.

macupdate.com/app/mac/29096/show-hidden-files
[G1 Android Development] JGW310:
thanks so much guys, but now i got this when i typed "apktool" into terminal...

"Apktool v1.3.2 - a tool for reengineering Android apk files

Copyright 2010 Ryszard Wi?niewski <brut.alll@gmail.com>

Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)

Usage: apktool [-v|--verbose] COMMAND [...]

COMMANDs are:

d[ecode] [OPTS] <file.apk> [<dir>]

Decode <file.apk> to <dir>.

OPTS:

-s, --no-src

Do not decode sources.

-r, --no-res

Do not decode resources.

-d, --debug

Decode in debug mode. Check project page for more info.

-f, --force

Force delete destination directory.

-t <tag>, --frame-tag <tag>

Try to use framework files tagged by <tag>.

--keep-broken-res

Use if there was an error and some resources were dropped, e.g.:

"Invalid config flags detected. Dropping resources", but you

want to decode them anyway, even with errors. You will have to

fix them manually before building.

b[uild] [OPTS] [<app_path>] [<out_file>]

Build an apk from already decoded application located in <app_path>.

It will automatically detect, whether files was changed and perform

needed steps only.

If you omit <app_path> then current directory will be used.

If you omit <out_file> then <app_path>/dist/<name_of_original.apk>

will be used.

OPTS:

-f, --force-all

Skip changes detection and build all files.

-d, --debug

Build in debug mode. Check project page for more info.

if|install-framework <framework.apk> [<tag>]

Install framework file to your system.

For additional info, see: http://code.google.com/p/android-apktool/

MacBook-Pro:~ JGW$"

WHAT SHOULD I TYPE???
[G1 Android Development] tommytomatoe:
apktool d /nameof.apk /nameof

For example....

apktool d Users/MrTomatoehead/Desktop/Rosie.apk /users/MrTomatoehead/Desktop/Rosie-out

That line decodes my Rosie.apk into a folder called Rosie-out.

Just a word of advice, I recommend reading lots before asking these questions. All this stuff can be found in this thread and else where. I understand you're new and all, but help yourself by reading. It will help. I promise.
[G1 Android Development] tommytomatoe:
And J,

Before you decode anything. You need to run "apktool if framework-res.apk", where the framework is of the Rom you are modding. If it is a sense app, you need to use com.htc.resources.apk in conjunction with framework-res, but I find that com.htc.res is often enough.
[G1 Android Development] JGW310:
whooooaaaa, now im totally confused.... this app is neither ASOP nor Sense, but it functions (most of the time) on both........... so whaatttt???? and i have been going through the forum, but instead of wasting more of my time, can you tell me how i would tell it to let me edit the .XML's?
[G1 Android Development] tommytomatoe:
Do this.

apktool d Nameofyour.apk /Nameofyour-out

Then, inside the "nameofyour-out" folder are your xmls and what not. I use text wrangler (it's free, use Google to find it), but text edit works just as well. That's it. Just make your necessary edits like you told me you know. Your xml are in the res directory. Until you are more familiar, I wouldn't recommend smali edits or stuff like that. Just stick with the layout xml's.

Then, after you done,

apktool build /Nameofyour-out /Nameofyour.apk

All done.
[G1 Android Development] JGW310:
first off, thank you so much for all of your help

secondly, i am sorry i am such an idiot/noob :)

third, something went wrong, see below :(

MacBook-Pro:~ JGW$ apktool d WiMaxNotifier.apk /WimaxNotifier-out
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.util.zip.ZipException: error in opening zip file
at brut.androlib.ApkDecoder.hasSources(Unknown Source)
at brut.androlib.ApkDecoder.decode(Unknown Source)
at brut.apktool.Main.cmdDecode(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.directory.DirectoryException: java.util.zip.ZipException: error in opening zip file
at brut.directory.ZipRODirectory.<init>(Unknown Source)
at brut.directory.ZipRODirectory.<init>(Unknown Source)
at brut.androlib.res.util.ExtFile.getDirectory(Unknown Source)
... 4 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:127)
at java.util.zip.ZipFile.<init>(ZipFile.java:144)
... 7 more
MacBook-Pro:~ JGW$
[G1 Android Development] Brut.all:
WiMaxNotifier.apk selected by you doesn't exist or it isn't a valid apk/zip file. Try to open it using any archive tool.
[G1 Android Development] Bikers:
error: Error: No resource type specified (at 'drawable' with value '@7F02000A').

I'm trying to play with an apk and I get this error! I saw something like this in posts from 2010, but I didn't see any solutions.

can somebody help me?
[G1 Android Development] JGW310:
Oh ok, so should I have it in a specific folder for apktool to recognize it?
[G1 Android Development] tommytomatoe:
Do this.

Type "apktool d ", then drag your apk into the terminal. This automatically writes the path for you. Then press space bar if it didn't automatically give you one, then drag apk into terminal again. This time change name.apk to name-out
[G1 Android Development] JGW310:
will try when i get home!!! thanks so much AGAIN!!! will report back if it works!!!!!
[G1 Android Development] pendo:
@JGW310

Just a quick note.....although I believe what Tommy is telling you is probably the "proper" syntax to use it is not absolutely necessary to specify the output directory. You can simply type

apktool d foo.apk

The output of this will create a directory named foo with the decompiled apk.

Another great tip: (this is particularly true when you're getting your feet wet) you should rebuild the apk without any mods to make sure you have that step down. This will often be the first question someone will ask you if you come here with compiling problems.

apktool b foo

Remember, you still need to sign your new apk. If it is a system apk, then you'll need to inject the META-INF folder as well as the AndroidManifest.xml (unless you edited the manifest, which that's another ball of wax) into your new apk that will be created in the dist folder.
[G1 Android Development] tommytomatoe:
Listen to Pendo, j. :-)
[G1 Android Development] JGW310:
i will try this as soon as i can,im going out of town til thursday :|
[G1 Android Development] Treken:
apktool error?

I simply tried to decompile an apk and build it back without making any changes and this is what I get:

I: Copying assets and libs...

treken@linuxmint ~ $ apktool b Launcher2

I: Checking whether sources has changed...

I: Smaling...

I: Checking whether resources has changed...

I: Building resources...

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL7569633204993908504.tmp, -I, /home/treken/apktool/framework/1.apk, -S, /home/treken/Launcher2/res, -M, /home/treken/Launcher2/AndroidManifest.xml]

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/APKTOOL7569633204993908504.tmp, -I, /home/treken/apktool/framework/1.apk, -S, /home/treken/Launcher2/res, -M, /home/treken/Launcher2/AndroidManifest.xml]

at brut.util.OS.exec(Unknown Source)

... 7 more

Caused by: java.io.IOException: Cannot run program "aapt": java.io.IOException: error=13, Permission denied

at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)

at java.lang.Runtime.exec(Runtime.java:593)

at java.lang.Runtime.exec(Runtime.java:466)

... 8 more

Caused by: java.io.IOException: java.io.IOException: error=13, Permission denied

at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)

at java.lang.ProcessImpl.start(ProcessImpl.java:65)

at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)

... 10 more

treken@linuxmint ~ $

Any insight on the matter would be great!
[G1 Android Development] pendo:
What version of apktool are you using? And from what sdk did you get aapt from? I know Brut.all has got some new stuff working but aside from that its generally been adviseable to use aapt from sdk 8 and not the newer ones.
[G1 Android Development] klquicksall:
@ pendo when I install an aol from the dist folder it fc. Is there a work around for this?

Thanks for the help.
[G1 Android Development] Treken:
As far as. I know it's 1.3.2 and my machine is mint Linux
[G1 Android Development] ihtfp69:
Make sure aapt is either in your PATH or the same folder as apktool. Try executing aapt while in the same folder as apktool. If it says the command is unknown, that's your issue.
[G1 Android Development] Treken:
Can you provide a link to the files that your talking about including the apktool? When I get home today, I'll download them and install then run again.
[G1 Android Development] tommytomatoe:
I'm not pendo...but have you moved the original meta-inf and android manifest over to the new apk?

Also, if that doesn't work, here is what I do and I've never had problems. Use your original apk, but replace only the xml or classes.dex that you edited. Ie, if you edited main.xml in res/layout/ only, then take original apk and replace that xml with the one in the build/apk/ directory if your working folder. That way, you keep all the other files in original form and only change necessary files. Everyone does things their own way, but for me this way works the best.
[G1 Android Development] tommytomatoe:
You can find the aapt in your android-sdk. If you don't have that set up, I recommend you do that first.

sdk link

You can find aapt in platform-tools. You will want to install a platform first though. as pendo said, sdk api 8 is the best version for those apks working with froyo roms.
[G1 Android Development] klquicksall:
Thanks. I'll give that a shot.
[G1 Android Development] pendo:
I think you and I both were victims of the spell checker again, lol. I just went back and changed mine to say 'sdk' instead of 'ask' :D

What apk are we talking about here by the way? Did you sign it?

You can tell what version of apktool it is by just typing "apktool" (no quotes) in terminal. It should list the version as well as all the available commands.

But you didn't say where you are getting your aapt from. Try this...in your sdk directory, navigate to platforms/android-8/tools and grab the aapt binary copy the aapt binary from there into your /usr/local/bin directory (must have su privileges!)

Then try your apktool b command.
[G1 Android Development] klquicksall:
Systemui
[G1 Android Development] pendo:
OK...gotta ask....how's that any different than injecting META-INF and AndroidMandifest into the new one :D
[G1 Android Development] pendo:
OK...well, I'm gonna repeat what TT just said. That's a system apk, so you can't just resign it with a test cert or your own private cert. (well, you can, but that's another hack all together) So take your fresh new apk that's in the dist folder and open it with your archive manager, but do not extract it. Then do the same with the original, unmodified SystemUI.apk.

Then drag both the META-INF folder and the AndroidManifest.xml from the original to the new apk.
[G1 Android Development] Treken:
Thanks. I'll give it a try when I get home. I do have sdk installed. I'll check for that file you told me about. Thanks again
[G1 Android Development] JGW310:
awesome. did it. it worked (i think :D) but where is the decomplied file that i can make edits to???????
[G1 Android Development] tommytomatoe:
Well, with apktool 1.3.1 I had issues with some of the layout xmls decompiling with a "\" in front of each line. So when you rebuild it equals force close. Instead of going in and make sure I remove the "\" in each xml, I just remove them from the xmls I am working with. Then I replace only ones I edit. That way I am sure the other xml are okay without having to check, because they were original. I guess that is the real difference.