yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] huggs:
You are amazing. Seriously, big thanks!! I thought I was gonna have another couple hours worth of work ahead of me this morning to figure out how to deodex the rom. Thank you x1000!!

Edit: I can see one thing where I was messing up, in between the jar file names in the bootclass path line , I was using ; instead of : .

I'm still going to try to learn this stuff though even though you did it for me. I hate not knowing how to do something, and I think I pretty much understand how it works now. But now I feel like I can take my time and learn it because I'm not just trying to modify some file on my phone, I'm learning how to do this on any rom on any phone I end up getting.
[Desire Android Development] 1982Strand:
No problem :-) I also realized I misguided you by writing "semicolon", where I just meant : so no wonder you kept getting errors, hehe! :-)

Sent from my Commodore 64
[Desire Android Development] 1982Strand:
@qaysedcftgb:

When you have recompiled your apk after editing the file, copy the file from the "build" folder into the _custom_res folder.

Examples of the copy_files.txt and copy_folders.txt:

copy_files.txt:

framework-res\build\apk\res\layout\date_picker.xml||framework-res\res\layout\date_picker.xml

copy_folders.txt:

framework-res\build\apk\res\anim||framework-res\res\anim

It's first the source, then the destination, seperated by the ||

-It's also explained in the xdaAutoTool help/documentation..

:D
[Desire Android Development] qaysedcftgb:
What the ****?

I searched and searched for a documentation but didnt find any.

And then... I opened my eyes!

The first posting!

Calling me blind is too charming, calling me a dumb nut comes closer.

Theres explained what to do with the files. I really have to say SORRY for all that circumstances, really didnt realise the whole (!) first posting, just saw the command line automatation tool, was happy that this is the first tool/gui which enabled framework-res.apk modding.

This Windows GUI (1st posting) opens new options/possibilities to me. Will try it these days. I think that all my questions/problems may be solved with that tool.

Keep you all updated the next days.

Until then I will try it.

THANKS a x1000 for you guys for helping and opening my eyes.

Cheers

qaysed
[Desire Android Development] xavierjohn22:
Version 4.0.2

9:30 PM 3/7/2012

====================================

- Move apktool choose settings to combobox

- Fixed theming folder creation runtime error

- Speed up reading columns and lines on multiple apk to display in listview
[Desire Android Development] qaysedcftgb:
on the finishing line

OK guys, heres a little (?) impression from my side to the Windows GUI (1st posting)

Just to test, I took:

stock framework-res, stock tw-framework and stock DialerTabActivity (later only dialer called)

Installed framework-res and addtionally tw-framework.

decompiled dialer, changed nothing, recompiled dialer

and... well

regardless of the compression level, I didnt manage to create a new working apk out of it

The apk is created, but it isnt usable.

If I push it to the phone, the phone app itself on the phone is gone, not available.

Deleting cache, dalvik or even wipe reset didnt resolve the situation.

Pushing the original dialer app to the phone, it´s back again.

This process is just to check if the whole compilation process works.

Doing this in the automated commandline tool, this runs like a charme!

What me wonders in the complete XML process... I think I am on a wrong thought and therefore I was on a complete wrong way.

Everything in XML editing leads to the point to edit an XML, recompile it and put this edited into the building process, here with the textfile (and so on) defining which files should be taken.

But I have one root problem...

Check the screenshot attached to thos posting...

On the left side you see the directories of the decompiled dialer, on the right side the recompiled structure.

Where are the whole Value directories comming from?

I wanted to change the colour code in /res/values/colors.xml but... after recompiling... there is no values directory.

So it was very consequent, that it was useless and all my efforts were for nothing.

BUT:

the other directories contained XML files on the left and right!

And this was the key to my success!

With the help of decompiled /res/values/colors.xml an /res/values/style.xml I found the needed colours to be exchanged.

In my special example it was

tw_color003 #ff81bee1

and

tw_color005 #ff666666

But as already read right now... changes are useless.

So I searched the XMLs in the other directories for these values and... tada!

I found one (for testing)

/res/color-finger/color_text_blue.xml

Changed the value to my desired colour... saved it

Just recompiled the XML, thats it.

Now I am doing it manually... I just take out the recompiled /res/color-finger/color_text_blue.xml file an put it right into the original dialer.APK file and exhange it with the original one.

Pushed the modified apk back to phone and another tada comes up...

The colour in the picture is now #ffeeeeee

the next will be to exchange the right one #ff666666 also to #ffeeeeee

Searching the corresponding /res/color-finger/xxxxxx.xml file.

It´s a bit complicated but it works fine for me.

Hellofa thanks again for the commandline tool (posting #2).

Cheers

qaysed
[Desire Android Development] 1982Strand:
qaysed,

did you put the recompiled .xml, from the build folder, into the _custom_res folder and added the line to copy_files.txt?

Seems to me that this is the part that isn't done right :)
[Desire Android Development] qaysedcftgb:
1982Strand,

I have tried it once with the Windows gui with all compression levels.

But as written, also the recompile try without any change wasnt succesfull.

Wherever I made another mistake? I dont know.

But I am sure that this tool is great, otherwise much more users would have problems with the usage and the general function.

[Hope to have some more time for testings this weekend, then I will try this again.

I know that the manual way is working, so why not the automated way, too?

you are right!]

...

So I didnt try the TXT file action in the command line tool. For me (personally) it took more time to copy the file to the directory and edit the TXT file than to put the needed XML file directly into the original source apk file.

This manual way has the other benefit, that I dont run into troubles with directories and file names.

I am a "lazy guy" and always editing the TXT files isnt really funny for me.

Cheers

qaysed

----------------------

BTW:

in my last posting I wrote that I will search for the ##ff666666 value for the right one, but I wasn´t sucessful at all. I changed *all* file in /res/color-finger to ##ffeeeeee but none was the keyfile.

Does anyone have a clue where to find the value to edit?

Hopefully not in framework?
[Desire Android Development] xavierjohn22:
You dont have to copy and edit that copy_files.txt everytime. Just enter the xml path you need to copy

No need to copy the xml.

The copy txt file is the config file.

Whatever is there it gets from build folder and put to custom res folder. It does all this during build apk. So you can leave that copy_files.txt as many lines as you need.

It checks whether input apk has a build folder, checks whether apk is present, checks whether filesexist + file matching names. So in reality it would not harm other apks leaving that there.

What you are doing manually (this copy the xml to original apk) is what copy_files.txt is doing. When overwrite using custom res oprtion is enabled.

If you do color editing in values

Turn on copy resource.arsc

Turn on copy classes.dex if you do smali editing

And if you domt want to go into so much of these. Use the apk dist options. it works very well now even not a 100 percent on image retaining colors. But there is no need to define copy text files, custom res images xan be directly put in input. That means everything you do in input apk folder will reflect in apk. This option below was not use heavily since it bootloops the phone. Lately with new apktool version, many themers are thankful that it works flawlessly for them.

Just below the options with the line

Check copy generated apk (dist)

Check zipalign,

check custom res (dist), i just added this in case users do repeated jobs everytime so they dont forget to overwrite image

Dont sign if its a system apk

Do your edits then build

Your apk is in output_apk_dist_zipalign.

Use that

Sent from my HTC Desire
[Desire Android Development] xavierjohn22:
Mostly xml files in the values folder are compiled to resource.arsc

So you would not see any or only a few in values. And if you dont have values folder in the build, it means its all in the resource.arsc

I mentioned many times to newbies

resource.arsc = mostly contains translation made in values folder and xmls in values folder edited, when compiled is build into reaource.arsc

Classes.dex = file which when you deal with most smali codings

Sent from my HTC Desire
[Desire Android Development] 1982Strand:
Ah, yes of course, hehe! Just confusing myself here actually, sorry.. By copying the recompiled binary into _custom_res AND having the line in copy_files.txt is like double-doing it :) No need to do both and by using the copy_files.txt we maintain the newest file including our edits, so that if a file is changed in a release, other than what we edit, we don't overwrite it with an "old" one..
[Desire Android Development] xavierjohn22:
Yup bro, you've been very helpful with users in this thread man, splendid. I started doing the docs and hopefully by next week there would be a lot in there if users want to view docs via "F1".

Its a massive doc to build so i think i need to start now. Lol

Sent from my HTC Desire
[Desire Android Development] qaysedcftgb:
AH! That sound very good!

very good information

So... to be on "safe side", the all in one swiss knife TXT would be to edit the

_CUSTOM_RES\Copy_Folders.txt

file.

Having for example edited the DialerTabActivity.apk and the MMS.apk the content of the file would be:

---

DialerTabActivity\build\apk\res||DialerTabActivity\res

MMS\build\apk\res||MMS\res

---

-> in res folder there are the XMLs in the different directories

Well I am aware that this file copies *all* files to the new build APK, regardless if they work or not, right?

May I come back to the

resource.arsc

?

Please correct me if I am wrong...

The whole "control" file for colours is in res\value\color.xml

This is the "master table" for colours seen in XML files in the syntax

android:textColor="@color/tw_color001"

if the master table is not taken, the colour value in the XML looks like

android:textColor="#ff33ff00"

so far so good.

So the easiest way would be, to change the res\value\color.xml (assuming that most of the coulours are taken in reference to the res\value\color.xml)

Doing that and recompiling the whole apk would result in a new resource.arsc?

And here comes my question for deeper understanding:

the conclusion of that would be, just to take the new resource.arsc to the new apk?

Cheers

qaysed
[Desire Android Development] 1982Strand:
Uhm, yes, basically. But it's not necessary to do the ENTIRE res folder as you only modify a single file..???

And it also depends on which files you edit, as XJ explained..

And yes, a new resources.arsc are made, because you change the files within. And by "build usable apk", you are making a new apk with your new resources.arsc. It's because when you recompile, you encode the files. When you build an apk, you compress your encoded files and make the apk "usable"..

:D
[Desire Android Development] qaysedcftgb:
I hit the thanks button to all the answers, cause they were very helpful for me.

The explanation/hint with the /res/values subdirectories which are recompiled to the resource.arsc file was very helpful and maybe a sentence in the upcoming doc/faq worth?

I will try that way this weekend.

In the next paragraph I will explain why I only use the decompile/recompile way for XML.

The task is:

I have an old ROM with modded/themed files

Now I am cooking a new ROM, based on a new firmware.

The framework has completely changed in structure, so a simple copy and paste of the framework*.apk files was not successful.

So... I take the actual *.apk and the older already themed *.apk

Since *.apk is only a packing format, I extract both apks to a separate folder.

Open the *.mdpi directory in both extracted directories and check the preview of the files.

All PNG which I think maybe necessary for exchanging are directly copied in a third Window, which consists of the opened apk via totalcommander.

Having exchanged the PNGs of all necessary directories I just close the TotalCommander Window and put the modded apk to the phone.

This is easy, works and is fast.

But...

some apps are in, let´s say, not so optimal colouring of text... so there is a need of change.

Thats why I need the decompiling and recompiling of the apk -> changing colours in XML files. I tried so many ways and applications, until I found this thread and tool and now it works.

Some things were not clear to me (e.g. resource.arsc and res/values directory, had a slight assumption but not the real knowledge of it) but with your neverending patience and you excellent explanations, I am on the right way and it looks like that I have to try and try... but the basics are working and thats important to me.

The next things are fine tuning and optimising the process for me.

Cheers

qaysed
[Desire Android Development] 1982Strand:
Glad you got it going for ya! :D

Btw, @XJ:

I got this well.. miniguide for ics you might call it, thought you could use it in the docs for the autotool. Unless of course you already wrote the stuff in it ;)

It's more or less MIUI related, but some of the stuff in it can be widely used i think..

At some point i'll also do one for the most common apktool errors, so people have a chance to know what to look for when getting them.. Well, you could say that in my time with android i learned everything by trial and error and now i just want to share it to make things easier for other newbies ;)
[Desire Android Development] xavierjohn22:
Wow, thanks man. I havent written any ics yet. But now users can do it faster in other roms since we have decompile with... and recompile with... now.

Sent from my HTC Desire
[Desire Android Development] 1982Strand:
Btw, I am a little in doubt about that aapt.exe.. Right now I'm switching between versions when working with GB and ICS, but is it necessary? Won't the latest aapt work with GB (apktool 1.3.2)??

Can't test myself right now, I'm away from home this weekend :-D

Sent from my Commodore 64
[Desire Android Development] xavierjohn22:
No need.

Im using sdk 16 for ics and gb,

When working with gb using v16 aapt you may have errors in recompiling all. Or it maybe me since i have so many installed. Lol

In case you have the error "muliple blah blah"

heres what i do with gb, only in miui:

Aapt - latest

Apktool - 1.3.2

Install framework

Decompile all

Edits

Change apktool to 1.4.2 - this fixes substitution error when working with lastest aapt.

Recompile all

Viola!

Future, brut will release 1.4.3 and hope it fixes all only one apktool for all versions. He he, hoping
[Desire Android Development] 1982Strand:
ok, thanks :)

But, there's already a apktool 1.4.3, did you mean .."Change apktool to 1.4.3 - this fixes...."

And that hopefully the 1.4.4 will be able to do it without switching versions?
[Desire Android Development] xavierjohn22:
A yeah 1.4.4 or whatever will come next to 1.4.3
[Desire Android Development] Ibsonic:
Hi there.. This is an amazing tool !

but im stuck, im getting a exception bij decompiling Contacts.apk. I want to change the language.

http://i42.tinypic.com/mwuvpw.png

what is the reason.. could someone help me ?
[Desire Android Development] 1982Strand:
Hi :)

Are you using the latest aapt.exe and what version of apktool.jar are you using?

If it's Gingerbread you work on, you can youse apktool 1.3.2, if it's ICS, you should use 1.4.3.

And did you install the framework-res.apk correctly?
[Desire Android Development] gh.rohit:
help

I got this error, what to do?

-----------------------------------------------------
[*] framework-res.apk
-----------------------------------------------------
Recompiling framework-res.apk folder...
W: Could not find sources
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Rohit\AppData\Local\Temp\APKTOOL8358381188205754579.tmp, -x, -S, C:\Users\Rohit\Desktop\xdaAutoTool\_INPUT_APK\framework-res\res, -M, C:\Users\Rohit\Desktop\xdaAutoTool\_INPUT_APK\framework-res\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
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.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Rohit\AppData\Local\Temp\APKTOOL8358381188205754579.tmp, -x, -S, C:\Users\Rohit\Desktop\xdaAutoTool\_INPUT_APK\framework-res\res, -M, C:\Users\Rohit\Desktop\xdaAutoTool\_INPUT_APK\framework-res\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:87)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:78)
... 7 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more
[Desire Android Development] qaysedcftgb:
did you install framework with option "1"?
[Desire Android Development] gh.rohit:
yes

[10char]
[Desire Android Development] 1982Strand:
Have you setup the right PATH in environment variables?
[Desire Android Development] gh.rohit:
Oops nop, will set it and try. Thanks.
[Desire Android Development] LSD DREAMER:
can some1 please help maybe im just to dumb . how do u install this . how do u put something where the is no space and wat is white space

\
[Desire Android Development] xavierjohn22:
C:/xdaautotool

in programming, whitespace = character which occupies space which does not have a visual mark, e.g. space, tab,
[Desire Android Development] sihag:
Download link is blocked

@xavierjohn22

Please provide a cloud based download link as OpenDNS is blocking the site saying it is a phishing site :confused:

http://htcfanboys.com/download/xavierjohn22/?action=browse&folder=132

Waiting desperately :p
[Desire Android Development] shoman94:
I was just getting the same error.

I'm looking for autoapktool to get updated for ICS support.
[Desire Android Development] 1982Strand:
What do you mean? I'm working with ics and it works just fine :-) Only thing that needs an update is brut.all's apktool to make the process easier..

Sent from my Commodore 64
[Desire Android Development] shoman94:
Well I am getting errors such as this no matter which apktool i use.
[Desire Android Development] sihag:
Can you post a download link to file?
[Desire Android Development] thermax04:
Hi All

I Tried AutoAPKTool both v 1.0.7 and 2.0.0 on my windows Vista pc with latest Java version and installed latest SDK Package, but still each time I try to drag the APK from _INPUT_APK folder to the AutoAPKTool screen , I get this error file:

decompiling ...

Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.io.FileNotFoundException: TEMP\_INPUT_APK-\.apk (The system cannot find the path specified)

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.io.FileNotFoundException: TEMP\_INPUT_APK-\.apk (The system cannot find the path specified)

at brut.directory.ZipRODirectory.<init>(Unknown Source)

at brut.directory.ZipRODirectory.<init>(Unknown Source)

at brut.androlib.res.util.ExtFile.getDirectory(Unknow n Source)

... 4 more

Caused by: java.io.FileNotFoundException: TEMP\_INPUT_APK-\.apk (The system cannot find the path specified)

at java.util.zip.ZipFile.open(Native Method)

at java.util.zip.ZipFile.<init>(Unknown Source)

at java.util.zip.ZipFile.<init>(Unknown Source)

... 7 more
​

What is reason?
[Desire Android Development] shoman94:
SO I found a modified apktool.jar that fixed the decompiling error that I posted above but when I recompile I get this error:
[Desire Android Development] 1982Strand:
What file?

Sent from my Commodore 64
[Desire Android Development] 1982Strand:
If you have installed the latest sdk (aapt.exe r16) and have setup the right PATH for apktool, then try to follow the guide in my signature. Also, sometimes it helps if you use the modded (1. 4.2.31??) apktool and recompile with 1.4.3 again. You also have to make sure you installed the right framework, maybe several, otherwise it can't compile right.. :-)

Sent from my Commodore 64
[Desire Android Development] sihag:
Auto apk tool download link, other than one stated in post no.1 as open DNS is not leting the site to open.

Hit thanks if I helped.
[Desire Android Development] 1982Strand:
Here you go:

xdaAutoTool4.0.2
[Desire Android Development] shoman94:
I finally was able to decompile and recompile using modded apktool and aapt but it doesn't work on the phone. Its not seen by the phone after pushing it and setting permissions when infact it is there.

Tried autoapktool and the windows version also.
[Desire Android Development] 1982Strand:
If you can decompile/recompile without errors, it seems to be something in the build process.

What are you trying to modify in your apk?

What options are ON in the windows autotool?

For me, the following works:

Overwrite resources.arsc - ON (For when you edit stuff in VALUES folder)

Overwrite Classes.dex - ON (For when you edit SMALI)

Overwrite AndroidManifest.xml - OFF

Copy added resources (drawable-en..) - ON (For when editing images)

Overwrite using "_CUSTOM_RES" - ON (To make process of copying edited images + other stuff easier)

Generate Zipaligned APK (OUT) - ON

All the DIST options are set to OFF.

(And i'm still not entirely sure what the DIST options do and how they work, i've never used them myself..)

And if you edit binary xml's (such as colors.xml, or whatever) you can add it to either the Copy_files.txt or Copy_folders.txt in custom_res folder to make the copy process automated.
[Desire Android Development] qaysedcftgb:
try compression rate set to 0

6 is default afaik
[Desire Android Development] nguyenhonganh:
Excellent !

Toolkit is useful. I'm using them to discover android
[Desire Android Development] itsmikeramsay:
Can anyone tell me what this means when trying to compile ANY ICS apk? I've tried XDA AutoTool as well as APK Multitool and get the same error. What am I missing?

Here's my setup:

iMac (10.7.3 Lion) w/Parallels running 64-bit Win7, which is where AutoTool is running....

I got Android SDK, Java etc installed correctly. It decompiles with absolutely NO issues, but compiling is the main issue. I don't want to be redundant or repetitive in this post, I just need to find a solution....

Decompiling and compiling works fine on my Samsung laptop with no issues. The set up is pretty much identical....
[Desire Android Development] 1982Strand:
Can you attach the apk and frameworks you work on?

Possibly its the apktool breaking the sources. Try using the modded version, 1.4.2.31, to decompile, then recompile with 1.4.3, this sometimes help..

Sent from my Commodore 64