yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Daneshm90:
Two reasons :

1. Not dependant on apktool keeping up to date with jf's sources.

2. If i want to edit non xml stuff....ie classes.dex then why decompile its xml sources etc... fewer chances of getting a non functional apk (also faster).

I just put it out there, wondering what people think of it and if itd be usefull to them.

Edit : Scratch that. Apktool allows non resources decompilation. Awesome Brut ;)
[G1 Android Development] fernando sor:
Do you know that command?

Badseeds custom y'all
[G1 Android Development] Daneshm90:
Yup its -s -r

So status update :

Fixed zip align issue as per error report.

Implemented decompile mode. So at the top u'll see

Decompile : Resources

or Decompile : Resources and Sources

or Decompile : Sources

U can switch amongst them.

I have a dropbox account where i made a .zip file available to script. When u select "Update tools" it downloads that and replaces the files in other with w/e i have on there. I also include a check for a newer version of script, if it finds one it updates apkmanager itself. So yea gonna keep bug hunting n then release 5.0
[G1 Android Development] fernando sor:
Cool. So your adding that to script.bat in 5.0. Great tool man.owe you and Brut a lot. Done a lot with it

Badseeds custom y'all
[G1 Android Development] fernando sor:
So if I was using apktool by itself what would the command be to just decompile resources and not classes.dex?

Badseeds custom y'all
[G1 Android Development] Daneshm90:
It'd b -r believe.

Neway gotta crash. Talk 2mor
[G1 Android Development] Frank2807:
Cool! A New version.

Perhaps I have a little (very little) enhancement.

After pushing a system app I miss the reboot via apkmanager. Now I have to do it manually or with a second console via adb.

Great work!

Frank
[G1 Android Development] maverickzero:
Yes i always sign my apks before installing. Thx for the tips. Ill see if I can get it working :). Thx again, your help is very much appreciated.

EDIT: I got apktool 1.3.1 as you said and it now works like a charm! Thank you very much!
[G1 Android Development] Mko979:
What about. .jar files I'm not sure if it already dies that or not and also does it do smali/baksmali, and if so how do you use it,maybe maybe make the tool easier to do stuff like that I didn't see any options for that. But again in new to this so j don't know much. Thanks again.
[G1 Android Development] Mko979:
Also, maybe have an option that defines what certain errors mean or what they could be cause by. So like when the log gives you information about why something failed maybe have like something that further tries to explain what the log means. Hope this males sense.
[G1 Android Development] Daneshm90:
Good idea. May have to change the name to apk/jar manager though then :p
[G1 Android Development] fernando sor:
Thanks bro

Badseeds custom y'all
[G1 Android Development] nitsuj17:
hi..having a problem working with gmail...ive tried a bunch of different version (im using apktool 1.3.1) and it always decompiles fine..but recompiling even with no changes i get this everytime on several different unthemed and stock deodexed gmails:

C:\Users\Justin and Elena\Desktop\apk manager\other\..\projects\Gmail.apk\smali\com\google\common\base\Functions.smali[0,0] null

Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: java.io.FileInputStream@19fef7b

at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)

at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)

at brut.androlib.src.SmaliBuilder.buildFile(Unknown Source)

at brut.androlib.src.SmaliBuilder.build(Unknown Source)

at brut.androlib.src.SmaliBuilder.build(Unknown Source)

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

at brut.androlib.Androlib.buildSources(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)
[G1 Android Development] fernando sor:
Yes apparently 1.3.1 can't smali gmail

Badseeds custom y'all
[G1 Android Development] fernando sor:
It does explain it. Just not in laymens terms

Badseeds custom y'all
[G1 Android Development] Daneshm90:
Yea not sure what i can do at my end about that.

Perhaps in about section add common errors and what they mean :S

Anyway i'll put that as my last priority. Right now decompiling/compiling jar's is next on my list
[G1 Android Development] nitsuj17:
i tried it with 1.3.2 as well (gmail) and it will build fine but even with no edits it will fc
[G1 Android Development] Daneshm90:
One thing to note, decompiling -> compiling with no changes does not guarantee that the apk will work. Mistranslations can always occur, that is why i introduced this "keep" method, the fewer recompiled files, the higher the chances of an apk working. Also when compiling, check log, apk manager does not report if resources or .9 pngs were translated incorrectly.
[G1 Android Development] nitsuj17:
thanks, ill give it a shot.
[G1 Android Development] Daneshm90:
Although i appreciate reporting bugs on that form, please limit it to script functionality issues, not personal "can't decompile" issues.

Ok .jar compilation/decompilation seems to work fine. Wht i did was make use of apktool's source only decompilation and when it recompiles, it just includes the original meta-inf folder back into the jar :)
[G1 Android Development] fernando sor:
yeah its a lose lose with gmail. most edits you do in straight apktool 1.3.2 end in fcs. actually your better off using apkmanager because of the keep folder. i have managed to mod a passible transparent gmail using apkmanager with apktool 1.3.2
[G1 Android Development] nitsuj17:
yeah ive been trying to make a blackgmail and its been one headache after another
[G1 Android Development] fernando sor:
i have one where the inbox and labels page is inverted if you want it.
[G1 Android Development] fernando sor:
daneshm thanks for pointing me in the right direction. i hope this isnt off topic but to just decode resources apktool d -s <apk> ./out
[G1 Android Development] wdl1908:
Any idea when the linux version will reach 4.9 I'm trying to change the framework-res.apk and I can't seem to get it. A lot of force closes or not booting at all.
[G1 Android Development] awia:
Hi all!

I have a problem that I don´t understand... I´m modifying the framework-res.apk with apkmanager 4.9. (windows) Ok, all is working perfect but, I have a problem editing the /res/values/styles.xml

I make the changes with notepad (to customize some font colors), ok, after that, I SAVE the file and I recompile the project. When the app ask me if this apk is a system apk, y answer YES... after, I answer YES to the create the "keep" folder and I remove the mod files... The /res/values folder, doesn´t appear in the "keep" folder, and I doesn´t do anything about the /res/values/styles.xml... ok. I try to push the new framework, and works well... the mods in the pictures appears BUT all the changes that I made in the /res/values/styles.xml doesn´t appear... ¿?¿?¿? If I try to decompile the framework-res.apk generated and I look this style.xml file... the changes are removed!! :eek: appears like the stock file..

I´m doing something wrong? What is the problem?

I´m trying to change the font color in this style:

the bold text is the new value......
[G1 Android Development] fernando sor:
the styles which is in values is part of what recompiles into resources.arsc you need to delete that. values does not show when recompiled unless you want to hex edit
[G1 Android Development] awia:
hey mate!! many many thanks!!!!! now works all PERFECT!!! :D:D:D:D
[G1 Android Development] fernando sor:
Cool

Badseeds custom y'all
[G1 Android Development] awia:
an example :)
[G1 Android Development] Mko979:
@Daneshm90

I was just wondering if you will be updating the OP with the new version 5.0 apk/jar manager or if it is or will be found in your dropbox? Also, how do I connect to your dropbox?

Thanks again for your work and help.
[G1 Android Development] Daneshm90:
Hey i will release it today only. It will be added to OP and i will post as well that OP has been updated.

Im still testing to see if any bugs come up. In meantime if you guys find any let me know. Only features added are :

1. Zip align fixed

2. Added script/tools update feature

3. Added jar decompilation/compilation

4. Added decompilation choose mode

Fyi i thought id make use of my github account so i just put the changes i make to the script on there. Yea i know its just a batch script but meh, easier to keep track of changes ;)

You could also just download it and run and let me know if you come across any bugs.

Github
[G1 Android Development] nitsuj17:
That's what I'm looking for...but since I want to invert many apps id like to be able to do it myself....do you personally hex edit to invert or do you use apk manager with apktool 1.3.2?

Personally I edit frameworks usually with apkm and 1.3.1 replacing 1.3.2
[G1 Android Development] fernando sor:
Actually I love apktool 1.3.1 but it wont smali gmail. I've been editing the classes.dex with bajsmali smali and the rest with apktool 1.3.1. The text inversion is done in classes.dex with gmail

Badseeds custom y'all
[G1 Android Development] fernando sor:
Donation coming your way bro

Badseeds custom y'all
[G1 Android Development] fernando sor:
nice work .
[G1 Android Development] fernando sor:
have it downloaded. still unclear on just zipaligning and not optimizing. in batch the mode the apk disapears. the auto sync is cool! also when choosing decompile mode i dont see any change

also dont see a donate paypal link anywhere
[G1 Android Development] Daneshm90:
When u press 15, it asks you

zipalign only is z

zipalign + png optimize is zp

png optimize is p

Seems to work for me. I'll further test it or trace it steps.

Glad u like the update tool. For choosing decompilation mode, option 25 was added. Try it out.
[G1 Android Development] fernando sor:
yeah when i press z the apk disapears.
[G1 Android Development] Daneshm90:
Hmm, does the apk have spaces in its name ? What apk is it ?

Also whats ur path for apk manager ?
[G1 Android Development] fernando sor:
no. so what appears when you just zipalign? also i downloaded from your github but it has apktool 1.3.1. your script says its 1.3.2 so maybe im not operating with all the new tools
[G1 Android Development] Daneshm90:
Ah yea im still in process of setting things up.

Well it just zipaligns them and shows which one its currently doing.

Can u ensure file has no spaces and ur path doesnt either ? thnx
[G1 Android Development] fernando sor:
i will double check but i doubt it

yeah path is good no spaces. the apk just vanishes
[G1 Android Development] Daneshm90:
Hmmm ok. I will double look at it then. Does it vanish if u do just zipalign in the first set of options ? The non batch mode one.

Also i updated github. Added 1.3.2 apktool, and added script update functionality. So at each boot it checks if new version of script is out, if it is, it prompts you and updates it for you.
[G1 Android Development] fernando sor:
no. im assuming i just leave it in the place here for modding folder for option 5 but ive tried it in other folders. it just doesnt do anything
[G1 Android Development] Daneshm90:
I cannot reproduce it. Can you gimme clearly what steps from start to finish you are taking to reproduce the problem.

When u press 5 it looks for unsigned current project apk in modding folder.

When u press 15, it cycles through all apks in batch folder and does it to them.
[G1 Android Development] fernando sor:
well it isnt always labeled unsigned when ive tried to use it. i just run the script. i usually select zp for optimizing and zipaligning as i couldnt get it to work. if i select z only it vanishes. when batch optimizing are you supposed to have the apks in both modded and batch folders?
[G1 Android Development] Daneshm90:
Nope only in the batch folder.
[G1 Android Development] fernando sor:
yes tried that also. ill wait for the official release.maybe im missing something
[G1 Android Development] Daneshm90:
Ok need a few people to test it for a few days and tell me if they come across anything.

Goto here

And click download (top right)

For bug reports go to here

Try and tell me exact steps that produced the problem. Also tell me the path apk manager is located and the file name of the apk if possible. Thanks
[G1 Android Development] fernando sor:
ok got it to work finally! awesome
[G1 Android Development] Mko979:
I keep getting an error when trying to compile vending.apk and i'm not sure why. I have never decompiled an apk before so i'm not sure if i am missing something or if there is something i'm suppose to delete before compiling. can anyone give basic steps to decompile and compile. I am in decompile mode source and resources mode fyi. Also just wondering how do I decompile a .jar file I dont see any options for it.

Log is attached.

Thanks again for all your help.
[G1 Android Development] Mko979:
I forgot to mention I did not modify the vending.apk at all just decompile and them immediately after tried to compile to see if if would work. It just said error: check log.
[G1 Android Development] xkape:
ok.. banging my head on the wall here.. been trying to figure this one out since about noon today. Recompiling an app, any app.. it recompiles with no errors and all is well. However some install fine and some Force Close (FC). So today, i decided to check the error log anyway. and I got this....

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

|Mon 03/07/2011 -- 20:57:52.16|

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

java version "1.6.0_22"

Java(TM) SE Runtime Environment (build 1.6.0_22-b04)

Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)

I: Checking whether sources has changed...

I: Smaling...

I: Checking whether resources has changed...

I: Building resources...

I: Building apk file...

The system cannot find the file specified.

Press any key to continue . . .

What file is this thing not finding for Pete's sake? lol and how do I make it find it?
[G1 Android Development] Mko979:
Ok, I tried framework.jar and everything worked fine. But the problem is when after I have decompiled any apk it wont compile back. Ive narrowed down the problem to resources decompile mode, this is where I get stuck. In source mode everything works fine. Ive changed the heap size to 512 and no go. Now I'm trying to figure out what it could be, there was no .dex file in the original framwork-res.apk, could that be the problem, im not sure. I know the rom I pulled it from said it was de-odexed.

When I check the log I keep getting a huge list of this stuff.

C:\Danesh-ApkManager-482b45a\other\..\projects\framework-res.apk\res\values\publ

ic.xml:3245: error: Public symbol drawable/sym_keyboard_num2 declared here is no

t defined.

C:\Danesh-ApkManager-482b45a\other\..\projects\framework-res.apk\res\values\publ

ic.xml:3246: error: Public symbol drawable/sym_keyboard_num3 declared here is no

t defined.

Followed by this,

C:\Danesh-ApkManager-482b45a\other\..\projects\framework-res.apk\res\values\public.xml:3243: error: Public symbol drawable/sym_keyboard_num0_no_plus declared here iException in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\DOCUME~1\ASHLEY~1\LOCALS~1\Temp\APKTOOL1283904726569224141.tmp, -x, -0, arsc, -S, C:\Danesh-ApkManager-482b45a\other\..\projects\framework-res.apk\res, -M, C:\Danesh-ApkManager-482b45a\other\..\projects\framework-res.apk\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, C:\DOCUME~1\ASHLEY~1\LOCALS~1\Temp\APKTOOL1283904726569224141.tmp, -x, -0, arsc, -S, C:\Danesh-ApkManager-482b45a\other\..\projects\framework-res.apk\res, -M, C:\Danesh-ApkManager-482b45a\other\..\projects\framework-res.apk\AndroidManifest.xml]

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

... 7 more

s not defined.
[G1 Android Development] draco_ag:
I modified few XMLs to change the color codes. I compiled framework-res.apk again. I also replaced few pngs inside drawable directories.

When install file via Xrecovery my boot lasts around 10 minutes.

What is wrong? Should i do something more with framework-res.apk file to make te boot time short?

Thanks in advance.
[G1 Android Development] Daneshm90:
Is it only ur first boot ?

Only ur first boot after a modified framework should take long.

On a side note, is anyone using the version on github ? I put out a few updates that the script should point u to.

Just wondering how that worked out for others.
[G1 Android Development] draco_ag:
Yeah, first boot take that long time.

I also noticed that some menu option in settings causes crash...

Could You help me to make it work? Maybe i do something wrong?
[G1 Android Development] Daneshm90:
Did u use the "keep" option ?

If not id suggest u do.
[G1 Android Development] draco_ag:
To be clear i describe step by step what i do:

1. Decompile framework-res.apk using script.

2. I edit XML files inside project directory.

3. I compile framework using script.

4. When script asks if it is system apk i chose Y

5. When system ask if i want to add something to files in "keep" direcotry i chose N.

6. After script finish i find unsingedframework-res.apk file inside place-apk-here-for-modding directory

7. i extract resources.arsc file from this file

8. I use 7zip to compress resources.arsc file into unsingedframework-res.apk file with "store" compression level

9. I open unsingedframework-res.apk and replace custom PNG files in framework.

10. I change file name for mentioned file and push file to phone using Xrecovery.

Any additional step needed or i do something wrong?

I also noticed that for some menu settings option system is going to crash.
[G1 Android Development] Daneshm90:
Too many unecessary steps :)

I think u misunderstood the keep option. Its purpose is so that any file u have not modified is to be restored from the original apk.

So decompile,make changes, then say yes twice, look inside keep folder and delete any file that you HAVE modified. Then return to script. Now push this file to your phone n let me know.
[G1 Android Development] draco_ag:
Weird behaviour becausde for now system doesnt crash but battery icon is missing ;)

I will try to do everything once again and let you know tomorrow.
[G1 Android Development] xkape:
ok let me try another question.. see if anyone knows the answer...

I have tried using 4.7, 4.8 and 4.9 and on 2 different computers. I cannot edit anything in the layout folder without the app force closing on me. values folder, drawable folder, drawable-hdpi folder etc... i can edit them to my hearts delight. This only happens on certain apps. Other dont have this issue.

I have tried them signed, unsigned, as system app and not as a system app. Nothing works.

ANy ideas?
[G1 Android Development] Daneshm90:
It compiles fine ?

In that case press 23 with ur phone connected.

Then run the app let it force close n then close script.

Post adb log txt file on here.
[G1 Android Development] xkape:
I should also mention that by doing that, I can no longer open the 4.9 script. it opens and has words in there but it closes so fast I cant see it
[G1 Android Development] Daneshm90:
OPen task manager and end task adb.exe

Ok so what exactly are the changes you are making ?

Are you familiar with the syntax....etc ?
[G1 Android Development] xkape:
I am not familair at all but upon looking at that log, there are things in there ive never even had on my phone. I saw the yahoo messenger thing and thats what im editing so i figured that was it.. then i saw that line about the layout/share_sctivity_header not being vaid or whatever... I never edited that file. I did edit 31 images and 37 xmls but that was not one of them...lol

As for changes, I am inverting the app. Thats what I do.. invert apps. I edited all my images, 9pngs and all, no sweat.. i edited the values folder, no sweat.. now i touch a layout folder xml im done. Example.. I edit settigns.xml.... install app, open it up fine, then i go to settings and FC. Same with any xml.. i edit it, it dies.

Also.. by sytax, I assumed you meant of the log file.. which I am not familair. If you mean the xmls then yes i am familiar.
[G1 Android Development] Mko979:
@Daneshm90

Sorry to keep bugging you, I know I'm kind of new at all this but in a couple of posts up I reported getting an error compiling framework-res.apk. I posted a log and gave a little bit of the end of the log in the next post. I've narrowed it down to resources being the issue. So I went looking through this thread and found another person who was having the same issue and receiving the same errors and in your response to him you asked if it was a themed framework and how apktool would not decompile the .9 png files correctly. So I tried a couple of different frameworks from various roms that were stock or close to it and I still get the same error. Again though, I don't get any errors when decompiling only when I try to compile it back again. Is there a way to tell if it is a themed apk. you mention something about the original dev or themer not compiling the resources.arcs is there a way to tell that.

Thanks for your help
[G1 Android Development] Daneshm90:
When decompiled. Check the log to see if any problems occured.
[G1 Android Development] xkape:
You could also go into androidsdk/platform/android-9/data/res and copy the actual stock images into your ROM's drawable-hdpi and drawable-land-hdpi folders. Then decompile, edit, recompile and then merge your themes images back in after the fact.
[G1 Android Development] xkape:
Dane.. no pressure but, I'm counting on you. If you don't know the answer I am completely toast...lol
[G1 Android Development] Mko979:
Yea, this is what it says right after I decompile, but again it did not throw any errors in the script but I do see something about a .9png

.

|Tue 03/08/2011 -- 23:18:59.53|

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

--2011-03-08 23:19:03-- http://dl.dropbox.com/u/14513610/apkver.txt

Resolving dl.dropbox.com... 184.72.223.78

Connecting to dl.dropbox.com|184.72.223.78|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 1 [text/plain]

Saving to: `apkver.txt'

0K 100% 18.5K=0s

2011-03-08 23:19:03 (18.5 KB/s) - `apkver.txt' saved [1/1]

A subdirectory or file projects already exists.

A subdirectory or file place-apk-here-for-modding already exists.

A subdirectory or file place-ogg-here already exists.

A subdirectory or file place-apk-here-to-batch-optimize already exists.

A subdirectory or file place-apk-here-for-signing already exists.

A subdirectory or file projects already exists.

java version "1.6.0_24"

Java(TM) SE Runtime Environment (build 1.6.0_24-b07)

Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)

The system cannot find the file specified.

The system cannot find the file specified.

The system cannot find the path specified.

The system cannot find the path specified.

Could Not Find C:\Danesh-ApkManager-482b45a\place-apk-here-for-modding\../place-

apk-here-for-modding/signedframework-res.apk

Could Not Find C:\Danesh-ApkManager-482b45a\place-apk-here-for-modding\../place-

apk-here-for-modding/unsignedframework-res.apk

I: Loading resource table...

I: Decoding resources...

S: Could not decode file "drawable-hdpi-v4/status_bar_close_on.9.png" to "drawab

le-hdpi-v4/status_bar_close_on.9.png"

I: Copying assets and libs...

Press any key to continue . . .