yashsingh1/xdaforums huggingface dataset:
[Desire Android Development] itsmikeramsay:
Thanks for the tip. Where can I find it?

EDIT: Found it and decompiled with (1.4.2.31) no issues, but still getting that same particular error when trying to compile with 1.4.3. Anymore ideas? Anyone?
[Desire Android Development] lyon21:
I am using version 2.0.3 and cannot get an ICS Framework-res.apk to recompile. Any suggestions? I get "could not find sources"
[Desire Android Development] 1982Strand:
That's perfectly normal with frameworks, it's not an error ;-)

Sent from my Commodore 64
[Desire Android Development] 1982Strand:
btw, take a look at the directory names.. it looks weird, it has both / and \ in the name. This suggest you're using an older aapt and/or your PATH has duplicate/wrong entries..

There's a new aapt.exe (r17), try to update the sdk and check your PATH again. :)
[Desire Android Development] itsmikeramsay:
Well I fixed it!!! I had to add these two things to Path...."C:\android-sdk\platform-tools\" which is where SDK is located with aapt.exe. I also added "C:\apktool" which is an additional folder I created with apktool 1.4.2 and 1.4.3 in it. Fixed and compiled with NO issues. And that's ICS SystemUI and Framework-res!
[Desire Android Development] 1982Strand:
Nice, glad i could help ;)
[Desire Android Development] qaysedcftgb:
v1r0x

the errors look very similar to

http://xdaforums.com/showpost.php?p=24070416&postcount=739

?!

I have the slight feeling that the followed up steps described by itsmikeramsay may help you, too...
[Desire Android Development] v1r0x:
yeah, I think the apktool1.4.2 was the problem.

Found another with different file size and everything works fine.

Think I've missed that solution after a long night and a lot of searching :D
[Desire Android Development] 123.xxx:
can you share me your apktool? I also have that bug like you :(
[Desire Android Development] InMyBedNow:
Works great! Finally a tool worth using. Thanks.
[Desire Android Development] v1r0x:
sure :)

i think it's the modded 1.4.2 (1.4.2.31), but I attach it.
[Desire Android Development] xavierjohn22:
He he, hope these workarounds and other issues can be handled by 1.4.4 apktool when it is release.
[Desire Android Development] jbbandos:
:D

Hopefully - but the worst part is not getting any error message and thinking everything is right, so lets hope that 1.4.4 will also have more error reporting...
[Desire Android Development] 1982Strand:
A little feedback/feature request wish:

It would be nice to have the tool refresh (either automatically or manually), so that if one creates new _INPUT_APK_... folders while the tool is opened, they will appear on the drop-down list :)

It would also be cool, if there was an option to decompile/recompile .jar files (such as framework.jar, etc.) (Maybe this is already possible, but i'm just missing it?)

And don't know how to troubleshoot this one, as i'm not able to re-create the issue actually, it seems rather random. But sometimes i get the error 380: invalid property value when i try to open the tool and i have to delete the .ini file for it to be able to open it again. No biggie at all, but just thought i'd mention it :)
[Desire Android Development] xavierjohn22:
K, will add in wishlist

.jars i just yet most of the dex and put it in framework.apk, anyways will see what i can do.

Yeah the 380 error comes up when i introduce the saving of the app position on exit and reading it in startup. Ill try to debug why, if you dont want to delete the whole ini just delete the sections with form, left, top, width, height ir the whole section inside the ini.
[Desire Android Development] ezeygtr40:
hello guys...i'm a newbie here..i need ur guide...i decompiled framework-res.apk & settings.apk from Miui ROM for x8..after i edited the strings for translation, i recompiled and build usable apk n i got this warning in log.

WARNINGS for files:

H:\Android\xdaAutoTool\_INPUT_APK\framework-res\build\apk\classes.dex : The system cannot find the file specified.

----------------
WARNING: Cannot find 1 file

7-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18

what is this warning means n will it effect my rom if i ignore it? what r the solutions to solve it?

thanx in advance :)
[Desire Android Development] xavierjohn22:
that is fine, because framework-res in miui does not have classes.dex, ignore error. If error occurs on apk with classes.dex that's the issue
[Desire Android Development] xavierjohn22:
AUTO DEODEX TOOL

Version 1.0.3

sggua @ xda

2:08 AM 4/10/2012

- New smali/backsmali version 1.3.2

- API number for right deodex
[Desire Android Development] jjdoctor:
This is an awesome tool but I never got it to work on my Sony ROM... it always gives me errors..

the Window version gives me System 306 error when I open it...

Has these been resolved.. i searched in this thread but couldnt find a solution...

Would be very helpful in my ROM development if i got this to work...
[Desire Android Development] xavierjohn22:
Windows version error 306 delete the old ini file
[Desire Android Development] Southern_mind:
no matter what TABCTL32 will not register or the other ocx . Fairly brand new computer also not sure what else to try. i tried manually doing it with a google search for help and nothing wont do anything in the Run app thing tried looking for a installer in microsoft, but didnt find anything. Hope you can help.
[Desire Android Development] steal25:
just went through this on my new laptop, what you need to try is

1. place all the .ocx files in c:/windows/sysWOW64

2. start> run> cmd

3. open as admin

4. for each .ocx type regsvr32 richtx.ocx {enter} obiously replace {richtx} with each .ocx file
[Desire Android Development] Southern_mind:
Thanks I'll try that tonight when I get home.
[Desire Android Development] jjdoctor:
thanks that helped opening the app...

Close to a fix now.. I am getting this error decompiling Conversations.apk which is a stock messaging app on Sony ROMS... This is an example, it occurs with ALL Apks...

EDIT Found solution to that in Search... what abt this while decompiling?...:o
[Desire Android Development] 1982Strand:
Did you install the framework file(s)?

is it gb or ics you're using?

Anyways, checkout the guide in my sig, you might find it helpful :)
[Desire Android Development] qaysedcftgb:
an assumption

maybe my answer helps a bit...

I remember that I also received such mesages

What did I do?

A simple thing...

(froyo) Framework files installed 100% correctly

Took this stock framework-res.apk and wanted to add 1% battery mod (the used kernel supports it).

What did I do...

Since I have done that once correct I wanted to save time.

So I just took this framework-res.apk, put

-all the battery symbols in the correct folder

-and the already compiled *.xml files which are responsible for showing the whole symbols

with totalcommander into the framework-res.apk.

So the theory, should work.

Then I installed the framework.apk via the CWM and an update.zip.

But what happend?

No battery symbols are shown?!

Only the 10% symbols when the value reached.

So I took the incorrect modded framework-res.apk file and decompiled it...

et voilà

I assume that all (!) the battery symbols got mentioned in such messages seen in jjdoctors entry.

Having done the correct way...

-decompiled the framework

-inserted clear text XML for battery mod

-inserted battery symbols

-recompiled the package

works right now.

Decompiling this package works fine.

So... my assumption is, that some graphics are not declared correct in the installed framework.

It would be a try worth.

Are you sure that the installed framework files are stock?

Can you just try to decompile and recompile the framework-res.apk?

Same result?

Oh...

maybe the space in the user name is the key to success?

---

C:\Users\Majid Khan\apktool\framework\1.apk

---

Cheers

qaysed
[Desire Android Development] m.alkhalel:
sorry if this was asked be4 but i didnt find a clear anwser...

so im trying to recompile systemui and im getting this error "The system cannot find the drive specified", how do i fix that?

THX!
[Desire Android Development] Southern_mind:
didn't work either.
[Desire Android Development] Razer(x):
Nice tool! gonna test it now :)
[Desire Android Development] m.alkhalel:
up!!
[Desire Android Development] 1982Strand:
Not sure why i suddenly get this, but when i try to "build usable", no matter which approach i use, it starts building and then it says: System error 9: Subscript out of range. Doesn't matter if i right click the file and "build usable", or "recompile and build" or use the checkboxes..

Then i click ok, and it says: System error 62: input past end of file.

If i then try to do any action with the file, iget: System error 55: file already open.

Got to restart the tool to continue.

I'm not sure why this is happening, i didn't change anything in my setup, didn't install any new software.. ??

It seems to be still processing the file(s) though, but i'm unsure if the process actually completes and i get a working file.. (It doesn't work to delete the xdaautotool.ini file)
[Desire Android Development] KBizzle:
Looking for a little assistance. I have been reading and searching, reading and searching, for the last 2 weeks. I apparently just have no clue what I am doing. All I am looking to do is port a theme. Now, you can flame me or you can help me. I am not here to harass or have someone do it for me, I am just trying to figure out what I am doing wrong. So let me give you my theory on how to port a theme and you can tell me if I am wrong.

I figure there are two main files that need to be altered in order for the important items to be themed. Framework-res.apk and Settings.apk. Now, my thoughts were to decompile the the apk from the rom I am trying to theme, move the files out of the input_apk folder then proceed to do the same to the similar apk from the theme. From there, move the files from the theme apk to the rom apk and then recompile. Even that sounds to easy to me but here is why I thought it would work. The theme is from a different phone but is known to flash and work just fine on my device. If that is the case, why couldnt the files just be replaced in the appropriate apks?? But here is the weird part. I cant get the apk to recompile. I even tried decompiling an apk and then immediately recompile. Even then it still failed.

So if you dont mind to help me, I promise not to waste your time or bug the isht out of you, just want a push in the right direction. I dont want to clutter the OPs thread, so if you are willing to give a dev noob a point in the right direction, PM me and we can find another means to talk back and forth to keep the thread clean. TIA!
[Desire Android Development] firefds:
If these are png files, and named the same, you dont even need to decompile and recompile...

Using 7zip just take out the filed you want from your themed apk and put them in to your new apk.

Anyway, when you ask for help - we are not prophets. We cannot know what your problem is without you giving us the error messege..

This applies to everyone in this thread - supply the full error messege!
[Desire Android Development] 1982Strand:
What you want to do is decompile the apks from both the theme (source) and the ones you want to modify (destination).

Example: make a _INPUT_APK_source and a _INPUT_APK_destination.

Start in the source dir, install the framework-res and decompile the files.

Then switch to the destination dir, install framework-res and decompile this.

Then you do your edits (i.e. copy the wanted pngs/xmls from source to destination) and recompile/build.

Copy the pngs you are replacing to the _custom_res folder, in the right directory path, ex: framework-res/res/drawable-hdpi/ - this way you are "saving" your edits for next time you edit the file and don't have to do the whole copy/paste again :)

And if you edit xmls (other than strings.xml for translations), remember to add a line in Copy_Files.txt (or Copy_folders.txt if its an entire folder) Refer to the documentation of how to work with the copy_files.txt

The options box should be checked as follows:

[*] Overwrite resources.arsc

[*] Overwrite Classes.dex

[ ] Overwrite AndroidManifest.xml

[*] Copy added resources (drawable-en..)

[*] Overwrite using "_CUSTOM_RES"

[*] Generate Zipaligned APK (OUT)

All the DIST options below these could be unchecked.

Depending on the ROM you're working on (sense, GB, ICS), this SHOULD work

(There's also some Theme APKS options in the tool, but i've never used those, so i'm not sure how it works..)

Hope it was helpful :)
[Desire Android Development] botellito:
DELETED
[Desire Android Development] qaysedcftgb:
If this is true, you are on the correct way of thought:

just copy the APKs to your phone

-> keep always a flashable backup for CWM flash in case that you are wrong and the APKs wont work with your phone

try and error is the best teacher

BTW:

framework-res.apk

tw-framework.apk

settings.apk

settingsUI.apk

are only for the main "look and feel" responsible, mostly every APK (dialertab, MMS and so on) brings its onw PNGs and resources.arsc with it.

Cheers

qaysed

@strand

Just a thought for you:

how about installing a quick and dirty windows XP in a VM and use only that VM for APK modding?

-> no risk of Windows/software updates which may disturb your installation

-> no wrong pathes/updates or whatelse may disrupt your work
[Desire Android Development] KBizzle:
Fantastic information. With the help of v1r0x last night, I was able to decompile and recompile without errors. Unfortunately I had to do it without the auto_apktool. I just have the apktool files on my c: drive.

Once I was able to decompile/recompile, this is what I did. Decompiled the themed framework apk, moved the folder and framework apk off the c drive onto my desktop. Then I decompiled the stock framework apk. From there is where I just kind of winged it. I opened the both res folders and just dragged the themed folders over to the stock folders, replacing any that had matching file names. Once transferred, I moved the new framework file folder back to the c drive and recompiled.

Great, no errors. I used 7zip to move the modified framework apk back into the rom it was pulled it from. I fresh flashed the rom, bootloop.

Did I go wrong by replacing by folders rather than individual files?? Thanks you.
[Desire Android Development] qaysedcftgb:
@kbizzle

it all reads fine as far as I see

I think you have two options to begin:

a) decompile and recompile an apk

Just take an apk decompile and right after that, recompile it.

Dont make any changes, nothing, just use the fresh recompiled apk.

If this works, you are ready to begin the first moddings/changes.

b) step by step modding

Regardless of a) you should try the way described before by firefds.

Take the source apk (this is the apk out of which you will take and use the PNGs), rename it simply to *.zip and extract it with the complete folder structure.

Open a simple windows explorer with large icons in preview mode to view the pngs of the extracted folders. Select one (!) PNG which you may find relatively fast again in the apk when it runs on your fone.

Now it´s getting thrilling...

Using 7zip, Winrar or my favorite TotalCommander in the next step!

Be sure to have the compression level set to 0 (!) in the packing programm of your choice.

Just open your destination APK with the packing program. Search for the applicable folder which corresponds to the source folder. In best case you should see the same PNG name there.

Just drag and drop this PNG into the opened destination APK and et it overwrite.

Now you´re done.

Close the packing program, save your result, put the modded APK to your phone and restart it or use CWM to copy it with an update.zip archive to the correct path.

If a) and b) are working, you are ready to combine the manual steps with this very cool tool of this thread.

You are on safe side that:

-simple decompiling/recompiling works

-a correct PNG is used

I have to admit that if only changing normal PNG (and *.9.png), the packing program way is the much easier way.

If you want to modify *.9.pngs you have to go the way of decompiling and recompiling.

Long time ago I found this nice video that explains the background and the function of *.9.png

http://www.youtube.com/watch?v=IfrXE2R2nqM&feature=related

strand has also given very valuable hints. Keep them in mind.

Hope this helped a bit.

Cheers

qaysed
[Desire Android Development] xavierjohn22:
Yeah, no problem at all. I still have to add that *.9.png though

I have it on my workstation in 1.0.4 release maybe, *.9.png is our method for selective pngs optimization

the one i experimented and upoaded, I tested *.png with my latest miui multi lang update to see if it changes anything, so far it's okay though.
[Desire Android Development] xavierjohn22:
Thanks to both, Cheers!
[Desire Android Development] affmalg:
Thanks for the update!

What does image optimizing mean? Does this just matter the size of the image?

Some feedback:

I am using the out-of-box settings.

Decompile and recompile works very nice - no errors yet

The changes i made in the value folder, which get compiled to the resources.arsc work.

But every other change i made in the xmls does not.

I do as you said:

-recompile

-copy the (recompiled) xmls from the build folder to _CUSTOM_RES into the appropriate folder.

Example:

\_INPUT_APK\framework-res\build\apk\res\drawable\progress_horizontal.xml

to

_CUSTOM_RES\framework-res\build\apk\res\drawable\progress_horizontal.xml.

-build apk

I have decompiled the apk to check if the changes are applied but they aren't.

So there must be some problem with the overwriting form

_CUSTOM_RES/"apk"/build folder because overwriting images from _CUSTOM_RES/"apk"/res/drawable-hpdi works.

Another question is the build.prop needed? I just deleted it inside the Flashable_Update.zip and it works. Otherwise it says in "About" in the Settings that i've MIUI installed :D (have Redux)

And for what are the options 14 and 15 needed?

Best Regards
[Desire Android Development] xavierjohn22:
yeah as the text imply, optimize pngs, it reduce file size as well

that overwriting xml should be solve now in 1.0.4,

It should do the overwriting when it detects a change in the xml, previously it was detecting date modified differences in a file.

I change the "u" to "a". meaning instead of "update" do an "add" to overwrite the files. Works well here, that has been there since 1.0.3, it is in the changelog

14 and 15, that is apk tool feature, because if you decompile or recompile with folders already existing it will not overwrite files (-f) stands for force delete directory or overwrite dir, see apktool help in bruts thread.

If you font do -f chances are you have an old recompile or old decompiled files

yes you can delete build.prop, that is my build.prop, it was in the op that you could delete that and create your own script, i just provide a template, it's not something fix.

Usual modders and rom cookers know what to do with those files, i just gave newbies something to play with
[Desire Android Development] tonymontezuma:
hoho

Its better an better ... AutoAPKTool1.0.4

Yesterday I try to make a Milestone 1 translation and installed, 2 different ways.

Used: MIUI M1 XDA Lalit79 - 4/30

Opened the package, copy freamework/freamework-res.apk and all apks from the original app folder to _INPUT_APK

Choose 1 - OK

Choose 2 - OK

Copied my MIUI N1 translation (I used in N1 installation successfully) to the _INPUT_APK folder

Only translation folders like "framework-res\res\values-pt" with XML files

Untill step 3 - OK

- Copied APKs from _OUT_APK to original folders (miui_Milestone-1.4.29Engv1.0\system\framework) and (miui_Milestone-1.4.29Engv1.0\system\app)

- zip the contents of the folder,

- changed the original zip name to "MIUI-BR-1.4.29-FULL.zip"

- and try to install (Full wipe).

- Stuck after moto logo, seems the system was in loop.

try untill step 4 - OK

- changed the zip file name in the folder _FLASHABLES to "MIUI-BR-1.4.29-PACK1.0.zip"

First I install the Package (Lalit79) with only one FC but boot ok (full wipe), after that I try to install the translation pack, Installation went well, but occurred the same when try to boot.

I did something wrong?

I did exactly the same on the N1 and everything worked well.

Tks
[Desire Android Development] xavierjohn22:
Step 3 and 4 is the step that could have gone wrong.

You should reach upto step 4 in order to have a usable apk in the _OUT_APK, thise are the apks that can be use

Then,

It is not just zipping the contents and installing, sometimes your zipping will left files or you may not have the meta-inf

I suggest you make a Flashable Template for each Language Pack

and use that as your zip file,

Ypu just have to use winrar to drag the apk files over your zip file, no unzipping and zipping required.

Or you can do like what i do.

I have 4 templates of ZIP

I have use the Flashable_Template.zip

Copied it four times

I then edit each update script inside, i only use winrar and drag over "store" the edited files.

i also edited the build.prop

I do these edits if i wanted to change something in the build.prop

(Also delete my build.prop in system folders of the _Flashables folder

The system and framework folders does not have anything on it.

Now when i want to compile and decompile then use for example an EN ZH updater,

I just rename one of my template to Flashable_Update.zip

With it in the _FLASHABLES folder i dont have to worry about making a zip file.
[Desire Android Development] Devildog8791:
I have tried it with 1.3.1 and 1.3.2, but couldn't get past the errors. I have tried different frameworks, but still had no luck. Could you post the 1.apk file that your apktool uses? That way I could see if it was the framework or something else causing me problems.

I will try the decompiled files that you posted and see if it recompiles. Thanks
[Desire Android Development] affmalg:
Thanks for the information!

I think i have found the bug.

While building the apk just the content of the _COSTOM_RES/"apk name"/res folder get copied. The _COSTOM_RES/"apk name"/build/apk/res/"folder name" folder where my xmls are doesn't get copied.

In the rebuildusableAPK.bat is the tool doing this (line 36):

:: this overwrites any files in the resources using the CUSTOM folder
if %overwrite_custom%==0 goto END
if not exist "%~dp0_CUSTOM_RES\%~n1" goto END
7za a -tzip "%~dp0_OUT_APK\%~n1.apk" "%~dp0_CUSTOM_RES\%~n1\res" -mx3

It copies just the folders inside _COSTOM_RES/"apk name"/res/.

I added this line:

7za a -tzip "%~dp0_OUT_APK\%~n1.apk" "%~dp0_CUSTOM_RES\%~n1\build\apk\res" -mx3

And it adds the folders inside _COSTOM_RES/"apk name"/build/apk/res/ too.
[Desire Android Development] JUGmobile:
Great work!

Thanks for that, it's easy as 1,2,3 =) now I am making language pack for my Slovenian language :)
[Desire Android Development] 1982Strand:
Ok, here's the framework-file it used :)

Hope you get some more luck with this one, let me know..

Oh, i'm running windows 7 - 32bit and are fully updated, also the .net -files..
[Desire Android Development] tonymontezuma:
Tks Xavier

Let me see, I have to make now two files Flashable_Update.zip N1 - M1 and later one for each ROM I want to translate?

And not zip my files, just open Flashable_Update.zip with 7-zip and drag the new APKs in this package.

I could drag APKs to the original zip updating existing files? or I need to use always then Flashable_Update.zip?

Sorry bother you with these questions, thank you for your help.
[Desire Android Development] MvSt:
Two thinks:

If you change in commandprompt.bat the line:

cmd

with:

call AutoAPKToolMain.bat

it will open first the cmd-editor and than open your tool.

You can place this bat to your desktop and run your tool from there with a dubleclick

So you don't need 2 (or more) steps to run your tool.

Second: It's only an idea.... but is it able to build this tool multilang?

Like the values in your great ROM?