yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Daneshm90:
Ok and when u manually extract them using say 7zip, change, rezip with w/e compression they work ? Im really confused by this lol.
[G1 Android Development] igor_anta:
You and me both :D I use store, for these 3 and for the framework-re.apk it only works with store, The other apps can take a bigger compression, but not these. I have NO idea why...
[G1 Android Development] Daneshm90:
Honestly the only event i can relate to is when i was trying to theme SWYPE, only 0 compression worked, otherwise the apk kept fc. K w/e ur free 2moro, see if u can setup teamviewer, then pm me the id/password it gives and i'll come take a look.
[G1 Android Development] Zezozose:
For the edited framework-res APKs: Am I correct in thinking this will work:

Open APK and copy the image folders to a temp folder

Copy the image folders from the stock APK to the APK I wish to edit

Decompile, edit, and recompile the APK

Sign the APK

Replace the image folders and rename the APK

Edit: It works, but I guess it's probably simpler to add the new image files to the stock theme after recompiling.
[G1 Android Development] tnpapadakos:
just a note:

i've been replacing framework-res.apk's res/drawable mdpi files without having to use any re-signing or anything

if you open framework-res.apk with winrar, and just drop in the ones you want, as long as they have same names as original files, they will replace the old ones with yours, then winrar will ask if you want to save the changes, say yes, and youre done, no real need to use decompile, etc

its a system app so it retains original signing, just make sure same number of files are in there after editing with yours, and that none of the names have changed
[G1 Android Development] Daneshm90:
For this script to properly work u must follow the steps in either the complex/basic category.

So if ur just signing, ud just place the apk in the directory place-apk-here

run 1 to extract, 2(optional),3(select regular apk so it removes the meta-inf folder),4,5(optional).

bkmo, yea ill clean it up later, i just wanted to cover all grounds.
[G1 Android Development] hurtem:
So what im trying to do is edit image files in the launcher pro app

this is what im doing, please tell me what im messing up.

so I place the apk file (LauncherPro-0.4.4.apk) in the place-apk-here folder

i double click script.bat

I press 1 to extract

I replace an icon image file

I press 3 and select regular apk

I get a second file in the place-apk-here (unpackaged unsigned or whatever)

I press 4 to resign and the file dissapears.

does it just replace the original file or is there supposed to be a new apk as the output file?
[G1 Android Development] Daneshm90:
Thats very wierd, its suppose to replace unpackaged-unsigned with unpackaged-signed. Oh i think i know why, do u have java in ur classpath ?

go start -> run -> cmd

type java, do u get "not found" or a bunch of *crap* ???
[G1 Android Development] hurtem:
I get a Java is not recognized as an internal or external command operable program or batch file..

Im assuming im missing something lol.
[G1 Android Development] hurtem:
do i need the jdk?
[G1 Android Development] Daneshm90:
Em just the regular java should work fine. so on java.com that download now button on their front page.
[G1 Android Development] hurtem:
damn this sucks, says i have the latest on the site, even downloaded and installed the jdk just to try. still get nothing by typing Java in the command prompt. I guess its not meant to be or maybe windows 7 is weirding out.
[G1 Android Development] Daneshm90:
No lol i have windows 7, java is just not in ur path.

Right click my computer, click properties, advanced settings, environment variables, in bottom window scroll to PATH click and edit it, at the end add ;<path to ur bin folder of java>

so mine looks like

c:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Droid Explorer\SDK\tools;C:\Program Files (x86)\Java\jre6\bin;C:\Program Files (x86)\QuickTime\QTSystem\
[G1 Android Development] hurtem:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Adobe\AGL;C:\Program Files (x86)\Calibre2\;c:\Program Files (x86)\Common Files\Ulead Systems\MPEG;C:\Program Files (x86)\Java\jre6\bin

so i added the path to java by finding it and copying the address to text and adding it to the end, does that look somewhat correct?
[G1 Android Development] Daneshm90:
Re: Apk Manager 2.0 - Makes Modifying Ur Apk A Breeze

yup, now try typing java in a NEW cmd window.
[G1 Android Development] hurtem:
sweet looks like stuff!!! im going to retry everything now and report back
[G1 Android Development] Daneshm90:
Lol wht happened ? im assuming it works.

I've added a modded version of apkopt. So now u can drop a load of system apps and it'll batch zipalign/compress pngs for u.

Apk Manager 3.0 features :

- Pull apk from phone into modding environment.

- Batch optimize apk

- Quick sign an apk
[G1 Android Development] xaueious:
This is awesome. Thanks.
[G1 Android Development] xaueious:
Sorry for the bump, but Brut just updated his apk tool. It's supposed to do .9s now.

http://code.google.com/p/android-apktool/downloads/list
[G1 Android Development] Brut.all:
@Daneshm90

When you will be updating to apktool 1.3.0, keep in mind that it doesn't build apps to dist/out.apk as earlier versions did.
[G1 Android Development] Daneshm90:
Thanks for the news guys. So i updated it with newest apktool.jar. i've also added a zip/sign/install option. And a clean current projects at startup option. And i added the newest signapk.jar.

Main post is updated with apk manager 4.0
[G1 Android Development] oMszKikiIzWavyo:
Yes This Is Really Amazing, I Just Have One Question Is There A Way To Remove Google Ads From An Apk?
[G1 Android Development] Daneshm90:
Re: Apk Manager 4.0 - Makes Modifying Ur Apk A Breeze

just get ad free from market or edit the appropriate xml and make the ad height zero.
[G1 Android Development] farmatito:
Attached a linux version of Script.bat.

Copy it to apk manager folder.

To run it:

cd Apk\ Manager\ 4.0
chmod 755 Script.sh
./Script.sh

To work it needs a functional apktool setup,

basically aapt (linux version) and a compatible

version of apktool.jar.

It also needs optipng, 7za, java, sudo and adb,

but checks and warns if one of them is missing.

It needs a little more testing but the basics are there.

BTW: Daneshm90, spaces in dir names like 'Apk Manager 4.0'

usually are a pain in the ass. Please use underscores

instead. :D
[G1 Android Development] Daneshm90:
Thank u so much :) Ill include the necessary files and upload it in the main post with credit ofcourse. As for the spaces in folder names, in windows doesnt matter cuz im doing things like "cd other" or "%~dp0" in quotes so spacing isnt a issue, something apkopt by the original dev had trouble with.
[G1 Android Development] Zezozose:
That's a great point. I suppose I should have mentioned that I had to decompile to edit some XML files. I'm glad you pointed out that it's not necessary to go through all that just to edit some images, so people aren't taking 10 minutes to do what they could in 2, haha.
[G1 Android Development] s_dimaio:
editing Settings.apk

I've tried to edit the file settings.apk (I made some changes to the file string.xml in values folder).

I decompiled (9)...made the changes...compiled (11)... signed (12)...pushed into system/app...ma doesn't work!

when I enter in my settings there's a FC (break android.process.acore).

ah...nothing zipaling... I read that settings.apk not like it!

someone can help me???

I enclose the logcat
[G1 Android Development] Daneshm90:
Step 9 : Good

Step 11 : Good

Step 12 : Not Good

Don't sign the apk. Instead, take the meta-inf folder from the original settings.apk, and place in inside ur modified settings.apk. Then push it to ur phone. Yea i gotta add a system decompile/compile option for apk manager lol.

Heres ur clue thats the issue :

Package com.android.settings has no signatures that mat
ch those in shared user android.uid.system; ignoring!
[G1 Android Development] s_dimaio:
uhm...same problem...after compiled I've open the orignal file with 7-zip...copy the original meta-inf folder...opened the new file with 7-zip...paste the original meta-inf folder...but same problem! FC! here the logcat!

But I've noticed one thing! the new file is much smaller than the original! 900kb vs 2Mb of the original!
[G1 Android Development] Daneshm90:
K i just modified mine and this is wht i did.

After compiling ur modified one. Copy everything from the original apk over except the res folder. Let me know.
[G1 Android Development] s_dimaio:
now it works!!! but I've copied everything from the original apk except the res folder and the resources.arsc. copying the resources.arsc file I lose any changes made to string.xml.

thanks!
[G1 Android Development] Daneshm90:
True lol my bad. yea ne

.9.png and xml changes u need the arsc file. Cool.
[G1 Android Development] MapleBacon:
Have you tested on your XP machine at work yet?
[G1 Android Development] Daneshm90:
Oh hey, nah didn't get a chance today, was busy.

Are u free during the day time ? if so hit me up with a pm and we can setup teamviewer or something ;)
[G1 Android Development] MapleBacon:
Idk. I might be. Not sure what teamview is though. I'll look it up.
[G1 Android Development] wayferer:
first of all thanks for such a cool script!!

i'm having some issues decompiling htcsearchwidgets.apk

i have put it into the folder place-apk-here-for-modding then run option 9 (tried option 10 but it wont work) and i get this error

Can't find framework resources for package of id: 2. You must install proper framework files, see project website for more info.

"An Error Occured, Please Check The Log (option 21)"

log file says

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

|Wed 11/08/2010 -- 17:53:37.92|

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

The system cannot find the file specified.

java version "1.6.0_21"

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

Java HotSpot(TM) 64-Bit Server VM (build 17.0-b17, mixed mode)

Could Not Find C:\Users\USERNAME\Downloads\Apk_Manager_4\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged.apk

Could Not Find C:\Users\USERNAME\Downloads\Apk_Manager_4\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-signed.apk

Could Not Find C:\Users\USERNAME\Downloads\Apk_Manager_4\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-unsigned.apk

The system cannot find the file specified.

I: Baksmaling...

I: Loading resource table...

I: Decoding resources...

I: Loading resource table from file: C:\Users\USERNAME\apktool\framework\1.apk

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

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

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

any thoughts on what i am doing wrong?

thanks again :)
[G1 Android Development] ATZ-007:
can I use this App Manager to port app from 1.5rom to 2.2?

I really like Phone.apk from Roger's Rom

Thank you,
[G1 Android Development] Daneshm90:
You need to select the 2nd decompiling option (with dependencies, that one)

Then when it asks u to drag in an apk, drag in com.htc.resources.apk from ur /system/framework folder of ur rom. Then press enter.
[G1 Android Development] Daneshm90:
The script won't do it for u if thats wht ur referring to :rolleyes:

Depending on the app, u'll have to not only modify the manifest but add ton's of code.
[G1 Android Development] wayferer:
Great! Thanks again for such a useful tool!

Just in case someone else runs into this issue, here is what I did:

1. Copied htcsearchwidgets.apk from the ROM and put it into the place-apk-here-for-modding folder (I assume you could just adb pull?)

2. Copied com.htc.resources.apk from the same ROM and placed it next to Script.bat (I assume you could just adb pull?)

3. Ran option 10

4. Dragged the com.htc.resources.apk into the screen when asked for dependencies, hit enter

5. Made my changes in the out folder

6. Ran option 11

7. Opened up both the htcsearchwidgets.apk and the newly created repackaged-unsigned.apk using 7zip (winzip or winrar would work too)

8. Dragged the META-INF folder + AndroidManifest.xml + classes.dex from htcsearchwidgets.apk to repackaged-unsigned.apk

9. Ran option 8 (Should I have done an adb pull to remove the existing one first?)

10. Re-added the widget and done.

Thanks again :)
[G1 Android Development] Daneshm90:
Np. Ill make sure the next update has a system option when recompiling so it preserves the signatures.
[G1 Android Development] wayferer:
that would be great thanks! also is it possible to have an option which does a clean up? same as what you get when you first launch.
[G1 Android Development] pehkblui:
Thanks for the script.

Just a warning, when I followed the window download link Norton informed it blocked an attack from the site. Not sure what attack it was though.
[G1 Android Development] Daneshm90:
By any chance are u trying to decompile a themed framework-res.apk ?

If so those errors are expected especially since the themer must've not decompiled/recompiled before uploading his theme. The .9.png information is stored inside the .arsc file and when u decompile it decodes according to the information stored within it, but when the .9.png has changed and the arsc hasn't been updated, then u get the "cant decode" errors. Try decompiling/recompiling a stock framework-res.apk and see if u get these errors.
[G1 Android Development] s_dimaio:
a suggestion

I love this script and I have a suggestion to improve it!

when you start script.bat you can chose if you want to delete the project you're working on. If you choose "yes" you start working on a new blank project.

But it would be nice pressing "no" to be able to choose the folder with the files to edit.

For example I have different folders and each folder referring to a particular apk decompiled.

Whenever I have to work on a folder I have to rename it "out" and, after the changes, rename it with the original name.

according to me would be more comfortable when you launch script.bat and press"no", to tell at the program to work directly on a specific folder.

bye!
[G1 Android Development] Daneshm90:
Don't worry that has been on my list for a long time ;) Will definitely add it. Currently at beginning when u type "y" it clears all folders, i see ur point that it should only clear "out" folder if u want to start from scratch. So perhaps when u say yes, it will delete the out folder and any "repackaged-signed/unsigned" u have in the "modding" folder.
[G1 Android Development] s_dimaio:
I have a question: to modify a system file I just compile without signing. After I take the original META-INF folder and the original androidmanifest.xml...copy in the edited file...push on the cell...and everything works.

but if I want to make some changes to the androidmanifest.xml what I have to do? I can't work with the original androidmanifest file without decompile it!
[G1 Android Development] Daneshm90:
if u want to modify the manifest u must push the apk in recovery (update.zip) or

adb shell stop

adb push apk

adb shell start
[G1 Android Development] s_dimaio:
no, it's not this the problem

for example if I edit Launcher.apk I have to:

- decompile

- edit

- compile

- copy into the new file the original meta-inf and the original androidmanifest

- push the new apk

but this way I am forced to always use the original androidmanifest.xml!

if I copy in my apk only the originale meta-inf folder...the apk doesn't work!
[G1 Android Development] Daneshm90:
When u modify the manifest

xml (dont copy from original apk) u must push it when core is not running. i.e using the methods i prescribed above otherwise ull get fc.
[G1 Android Development] kevdog:
Thanks for input -- I was attempting with a themed framework-res.apk. Ill try again!!!
[G1 Android Development] rori~:
"Save Project" would be cool. :-)

..or imagine a prog with an UI :-)

But that's futurama... it's an awesome script as it is.
[G1 Android Development] kevdog:
Quick question -- I changed one file (eri.xml -- actually made it smaller), but the recompiled framework-res.apk (thanks for tip about using stock framework-res.apk) was roughly twice as large. I chose to optimize the resultant framwork, but the resultant file was only 1kb and was empty. Any insight into this would be great.
[G1 Android Development] s_dimaio:
the problem is that if I use a manifest.xml modified...the file Launcher.apk (system/app/Launcher.apk) doesn't work!

I've tried with your method...I haven't FC...but after the reboot the Launcher doesn't start!

Now I'll try to copy the Launcher.apk with manifest modified directly in the ROM and I'll try to flash the ROM
[G1 Android Development] Daneshm90:
Check the log, see wht it complains about.
[G1 Android Development] Kermode:
Is there a manual to this?

I thought I could place an apk in the place-apk-here-for-signing dir and then enter 12 - but that doesn't work at all, just spews errors about not finding files. But it lists the modding dir?

In fact just about everything gives odd errors about files not found (except java and adb)
[G1 Android Development] s_dimaio:
this is the logcat if I push the Launcher.apk with original meta-inf folder and modified manifest.xml (file not signed).

to push I've used the method:

adb shell stop

adb push file

adb shell start

P.S. do you use a particular editor to read the logcat??? I use the instruction adb logcat...but the output is not very clear to read!
[G1 Android Development] Daneshm90:
Interesting, can u see whether u get errors in the apkmanager log.txt when u just decompile the apk ? (the original apk). If u do its cuz it might need dependencies. Also i need a bit of the previous stuff of ur log. Wht i do is create a .bat file with

adb logcat >> log.txt

Run the .bat and after say a few seconds u'll find a file log.txt in that directory with ur log. Upload that.
[G1 Android Development] s_dimaio:
I attach the log.txt of apkmanager...and the logcat.txt complete!

thanks!
[G1 Android Development] Daneshm90:
Hmm apkmanager's log looks fine, as for the other log still insufficient.

Can u pm me whenever ur online and i'll setup a chat or something and we'll get this solved faster lol.
[G1 Android Development] scuccia:
I'm having problems with any of the batch functionality. It will optimize or sign the first apk then fail.

I keep getting this error: "GOTO was unexpected at this time."

Any help would be greatly appreciated.
[G1 Android Development] Daneshm90:
yea somethibgs not right im getting samething. ill take a look n get back to u.
[G1 Android Development] microsnook:
Im trying to make my contacts.apk transparent (new at this) and I cannot get the apk to recompile.

Im on CM6 RC-3 for the D1.

Any help would be much appreciated : )

Here is my log:
[G1 Android Development] Daneshm90:
Im 99.9% sure ur trying to decompile a themed apk. So u shud get the stock apk for ur rom, decompile that, modify w/e u want, then recompile. Good luck.
[G1 Android Development] Daneshm90:
UI will come in future, once im done with features lol.

K so the way that made sense for "Multiple Projects" was wht im doing as of now :

At the top (status bar) of the script u have a "Current-App" status that tells u wht app/project ur working on. I'll have to rework a lot of the script but i think its worth it ;) Basically u'll have an extra option where u select which project to work on, when u select this option, ur presented with a list of apks currently in ur "modding" folder with a number beside them. You choose a number, and its corresponding app is selected as ur current project. Everything from extracting/unpacking is done to a folder matching the apk's name (which means apps must not have spaces in their filename).

Suggestions are always welcomed for alternative ways.
[G1 Android Development] TJDuckett:
Ok, I'm just trying to decompile my apk so that I can edit xml. I've tried decompiling before extracting/optimizing/zipping/signing, and after. If it matters it's the facebook.katana apk (the latest one).

I've attached my log.txt ~ Any help would be appreciated.
[G1 Android Development] Daneshm90:
This

The process cannot access the file because it is being used by another process.

Seems to be your problem. If u have any of the extracted apk files inside a text editor/searching program, exit those before recompiling.

For u the steps would be :

Decompile apk

Edit ur files

Close any editors that u used to edit those files.

Recompile

Zip

Sign

Install
[G1 Android Development] TJDuckett:
I don't have any other programs or anything liek that open at all.
[G1 Android Development] Daneshm90:
K comeone here

I'll assist u much quicker tht way ;)
[G1 Android Development] TJDuckett:
Hey, sorry, I went to work right after I sent that last post. I am home on break now and in the chat if ur available.

If not, my gmail is tjduckett96, and u can jsut add me on gtalk.
[G1 Android Development] TJDuckett:
Hey Danesh, thansk a lot for your help earlier. If available, could you help me a bit with some of these XML files? The ones in the facebook apk are weird when decompiled.
[G1 Android Development] Daneshm90:
Not today. i'll pm u tomoro when im at work.
[G1 Android Development] rori~:
This sounds very, very,very good !!!
[G1 Android Development] sneaky_zekey:
just wanted to say i finally got this to work on linux,lol not exacty sure what finally got it,as i tryed everything, side not i kinda have the OP back up manager script working on linux, now im trying to figure out how to port the theme porter script to linux,lol sorry to OP if this is off topic
[G1 Android Development] Daneshm90:
Hehe nice. If u get theme porter ported, let me know n i'll add it to OP. A lot of ppl asked for linux version ;)
[G1 Android Development] g00ndu:
Daneshm90,

Thank you for your Apk Manager. I'm new to Android, and new to Linux. But with your program, I am able to change my framework-res. apk for the battery mod. I must admit I have a lot of fun, amid having a lot of problems along the way, at one stage I couldn't even get pass the opening screen. Had to do a reflash. :D

But through perserverance (a much nicer way of saying having sleepless nights), I finally managed to do it! The sense of achievement especially for a super noob like me, is most gratifying.

Thank you, and also special thanks to brut.all for your apktool. :D You guys have made my day!
[G1 Android Development] Daneshm90:
Cool, glad u like/use it.

Alright heres a beta for 4.9

A lot has been redone lol. All functions work, its just id like some testers before finalizing it. If u get lost in the new menu options let me know ;)

Plz comment on the "project selecting" and "system app decompiling/compiling" methods. Likes/dislikes.

Errors so far : Build/sign/install option has glitch. Ignore it.
[G1 Android Development] scuccia:
Working great here. I love the project selecting and I'm glad to see batch functions working. Thanks!