yashsingh1/xdaforums huggingface dataset:
[Android Software Development] jakTomas:
thx man ,, it did work now ,, but the new Phone.apk is half the size of the original apk ,, and when i push it to my phone , the contact.apk is forced close and i cant make calls
[Android Software Development] plegdroid:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

take the outputted files from the build folder and replace within the original unmodified apk.

ⓐⓝⓓⓡⓞⓢⓘⓓⓔ ⓘⓢ ⓝⓞⓣ ⓐ ⓢⓘⓝ
[Android Software Development] theAPANT:
I know this isn't how you are supposed to fix this problem, but I just use an archive manager such as 7zip or roller or winzip/rar and then I open both apks and drag and drop just the changed portion over to the original and then the apk works fine.
[Android Software Development] ben.marks:
Been fiddling around with the apktool for a while now and just finally finished setting it up, and got caught with this error,

root@debian:/home/ben# apktool d mytestapp.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.util.zip.ZipException: error in opening zip file
at brut.androlib.ApkDecoder.hasSources(ApkDecoder.java:184)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:79)
at brut.apktool.Main.cmdDecode(Main.java:141)
at brut.apktool.Main.main(Main.java:72)
Caused by: brut.directory.DirectoryException: java.util.zip.ZipException: error in opening zip file
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:55)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:38)
at brut.androlib.res.util.ExtFile.getDirectory(ExtFile.java:55)
at brut.androlib.ApkDecoder.hasSources(ApkDecoder.java:182)
... 3 more
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:214)
at java.util.zip.ZipFile.<init>(ZipFile.java:144)
at java.util.zip.ZipFile.<init>(ZipFile.java:158)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:53)
... 6 more

Did a bit of digging but couldn't find much, if anything. Anyone able to interpret these errors and let me know where I'm going wrong please?
[Android Software Development] plegdroid:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

this is no way a guaranteed fix, but try unzipping the apk and rezipping and then try to decompile the rezipped apk. :)

ⓐⓝⓓⓡⓞⓢⓘⓓⓔ ⓘⓢ ⓝⓞⓣ ⓐ ⓢⓘⓝ
[Android Software Development] theAPANT:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Check your java version, i think that is the problem

java -version and javac -version

I always use jdk 6 although I'm not sure if that is a prerequisite
[Android Software Development] georgiecasey:
Playing around with apktool, cheers for the great app.

Have a problem with an app I'm playing with that uses the Android Paypal library though. I coded it in Eclipse myself and have the source. I added the Paypal library in the build path and it shows up as an 'Android Dependency' in Eclipse. It's a very basic example app that comes with the Paypal Android SDK. It works fine when I compile with Eclipse.

When I decompile and recompile with no changes with apktool, it crashes with a NullPointerException when it's calling the external Paypal library method for initialisation. When I compare the working APK with apktool's de-compiled APK, apktoool seems to be missing a folder in the root:

com\paypal\android\utils\data

Which has 2 files:

data.bin

locale.bin

I'm wondering is this a known problem of apktool and external libraries like the paypal SDK JAR?

Thanks for any help.
[Android Software Development] iBotPeaches:
http://code.google.com/p/android-ap...tus Priority Milestone Owner Summary Modified
[Android Software Development] georgiecasey:
wow, it works now! sorry for my n00b question, i'm living up to my post count. I swear I Googled for ages and read the first page of issues but only for 2013.

must read all the issues now, I can see there's some valuable info in there
[Android Software Development] ben.marks:
no such luck, still same error as page 146

root@debian:/home/ben# java -version

java version "1.7.0_11"

Java(TM) SE Runtime Environment (build 1.7.0_11-b21)

Java HotSpot(TM) Client VM (build 23.6-b04, mixed mode)

root@debian:/home/ben#

root@debian:/home/ben# javac -version

javac 1.6.0_26

also changed to a lower version with update-alternatives --config java

root@debian:/home/ben# java -version

java version "1.6.0_26"

Java(TM) SE Runtime Environment (build 1.6.0_26-b03)

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

root@debian:/home/ben#

root@debian:/home/ben# javac -version

javac 1.6.0_26

still no ball.
[Android Software Development] Sam Solomon:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Really useful Tool....
[Android Software Development] plegdroid:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

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

ⓐⓝⓓⓡⓞⓢⓘⓓⓔ ⓘⓢ ⓝⓞⓣ ⓐ ⓢⓘⓝ
[Android Software Development] ben.marks:
Reverted back to a snaphot of my VM just after installation of java and it now seems to work fine.

That was before I saw your posted link lol, cheers anyway.
[Android Software Development] iBotPeaches:
http://code.google.com/p/android-apktool/issues/detail?id=260

Its only real weird apks. Most of it has been fixed, but writing code to identity all types of positional variables vs non-positional without breaking any other forms is posing to be very difficult.
[Android Software Development] agritux:
thanks. your work excellent. everyone know this.

edit:

http://xdaforums.com/showpost.php?p=36486175&postcount=1279

this works for fixing my bug
[Android Software Development] Dunc001:
Are we still not able to decompile com.htc.resources.apk? I am trying with 1.5.2 (in VTS) but getting fail every time - http://pastebin.com/EkDAH9Dd
[Android Software Development] RomWiz:
Sv: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

I can :confused:

Cheers

Daniel
[Android Software Development] bgcngm:
Sure? :confused: I can't either...
[Android Software Development] RomWiz:
Sv: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

I succesfully decompiled it this weekend so i don't know why you can't :confused:

Cheers

Daniel
[Android Software Development] bgcngm:
Check this out: here and here.
[Android Software Development] RomWiz:
Sv: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Maby it wasnt the recource apk thrn, but it was a apk in the framework folder (not framework-res) :o

Cheers

Daniel
[Android Software Development] bgcngm:
No, it is indeed com.htc.resources.apk. Can you recompile that apk without any issue?
[Android Software Development] RomWiz:
Sv: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Will try when i have access to my pc!

Cheers

Daniel
[Android Software Development] Dunc001:
Which device though? I am talking about the com.htc.resources for the One X. I have all 7 frameworks from the ROM installed. I don't believe we have been able to decompile fully any com.htc.resources for the One X since it was launched. The one I am trying is from the latest JB Sense base.
[Android Software Development] RomWiz:
Sv: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Sensation ICS

Cheers

Daniel
[Android Software Development] steveh_131:
I did a search, but I can't find any answers yet. Please forgive my n00b questions, this is my very first foray into android development and I am having a blast so far!

It seems like most of the issues similar to mine have to do with decompiling proprietary ROM apk's, but this is just a regular app, so I just installed the framework-res.apk before decompiling (I also tried my com.HTC.resources.apk from my One XL, but same problem and I don't even know if that was an appropriate step to take).

I'm not sure why it won't work. If I delete the framework files from my user folder, it will decompile with no errors, but that leaves out important portions of code, right?

Using apktool 1.5.2 on Win7 X64 (Tried on Ubuntu x64 as well, same result).

Here is the log. Thank you in advance for any advice!
[Android Software Development] joeyfettucine:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Steveh, perhaps this might have some answers for you.

http://xdaforums.com/showthread.php?t=1642224

I don't have your phone, so its hard to give a concrete answer, but that may lead you in the right direction. Also, for future reference, for long pastes, try www.pastebin.com.

Sent from my LTEVO running Operation Jelly Bean
[Android Software Development] vegeta1:
Sorted big thanks to *bgcngm :)
[Android Software Development] bgcngm:
C:\Users\LENOVO\Desktop\Xda\S3\apktool\SecSettings\res\xml\lockscreen_settings.xml:6: error: Error: No resource found that matches the given name (at 'title' with value '@string/enable_lockscreen_torch').
C:\Users\LENOVO\Desktop\Xda\S3\apktool\SecSettings\res\xml\lockscreen_settings.xml:6: error: Error: No resource found that matches the given name (at 'summary' with value '@string/enable_lockscreen_torch_text').

That's you problem... have you added those two strings to strings.xml and updated public.xml?
[Android Software Development] steveh_131:
Thank you for the tips. I did read through that link, but I am a bit confused about how this works.

This is just a regular play store application...should I need to download the framework from my phone in order to decompile that? Or do you only do that when you're decompiling a proprietary app that came preinstalled on a certain manufacturer's phone?
[Android Software Development] joeyfettucine:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

For certain apps, yes. If it calls on the framework, apktool will be much happier if you provide it. Also, some won't cooperate of you do. Try different methods to get it to work before giving up. That's at least been my experience.

Sent from my LTEVO running Operation Jelly Bean
[Android Software Development] steveh_131:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Thanks for the help. I found a com.htc.framework.apk file online and installed it and I think it decompiled just fine. Got it all into eclipse, trying to figure out how to get it to recompile and run now. This stuff is really fun.
[Android Software Development] DeNitE:
Compiling question...

I'm trying to compile a theme chooser theme... and one of xml's has to have some caps in it...

"org_kman_AquaMail.xml" - due to this being what is specified in the original APP as the install directory...

APKtool tells me it has to be a-z.... (All lower case)

This was discussed a while back but I didn't see that it was resolved...

Yes, I have all of the latest files...

Any updates?
[Android Software Development] joeyfettucine:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

I haven't run into this personally, but wouldn't you simply be able to change the name? Change the xml, public ID and any other occurrence of that particular name? Perhaps grep the decomped apk to ensure that all references to the xml are edited. Just a thought.

Sent from my LTEVO running Operation Jelly Bean
[Android Software Development] DeNitE:
Meaning change every reference to lower case?

I, unfortunately, can't do that due to the original app being installed with caps in it...

If I change my xml to lower case the theme won't apply to that app; it only works if it's exactly the same as the original install directory.

I need to find a way to make APKtool compile without giving me that error...
[Android Software Development] plegdroid:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

its a magic apk if its using capitals, which goes against normal android coding, the dev who made it may have made it this way to stop you decompiling/recompiling it.

ⓐⓝⓓⓡⓞⓢⓘⓓⓔ ⓘⓢ ⓝⓞⓣ ⓐ ⓢⓘⓝ
[Android Software Development] djdarkknight96:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Someone just posted a version that will build capital letters in Windows for the theme chooser themes in the theme chooser thread. Search it out! "Theme Chooser for the faint at heart"

[GUIDE] T-mobile theme engine for the faint at heart (non-linux users) - http://xdaforums.com/showthread.php?t=964391
[Android Software Development] DeNitE:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Thanx! I actually just found it this morning ;)
[Android Software Development] raziel23x:
I am having a issue with a Certain unnamed apk files trying to decompile it to see how they did it

Here is the error message and what i typed to get it

D:\apkmultitool\other>java -Xmx1024m -jar apktool.jar d ../place-apk-here-for-modding/Problemfile.apk ../projects/Problemfile
I: Baksmaling...
Exception in thread "main" org.jf.dexlib.Util.ExceptionWithContext: Index: 27491, Size: 4776
at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithContext.java:54)
at org.jf.dexlib.IndexedSection.getItemByIndex(IndexedSection.java:77)
at org.jf.dexlib.Code.InstructionWithReference.lookupReferencedItem(InstructionWithReference.java:79)
at org.jf.dexlib.Code.InstructionWithReference.<init>(InstructionWithReference.java:57)
at org.jf.dexlib.Code.Format.Instruction21c.<init>(Instruction21c.java:63)
at org.jf.dexlib.Code.Format.Instruction21c.<init>(Instruction21c.java:40)
at org.jf.dexlib.Code.Format.Instruction21c$Factory.makeInstruction(Instruction21c.java:112)
at org.jf.dexlib.Code.InstructionIterator.IterateInstructions(InstructionIterator.java:82)
at org.jf.dexlib.CodeItem.readItem(CodeItem.java:154)
at org.jf.dexlib.Item.readFrom(Item.java:77)
at org.jf.dexlib.OffsettedSection.readItems(OffsettedSection.java:48)
at org.jf.dexlib.Section.readFrom(Section.java:143)
at org.jf.dexlib.DexFile.<init>(DexFile.java:431)
at org.jf.dexlib.DexFile.<init>(DexFile.java:267)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:45)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:32)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:72)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:89)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
Caused by: java.lang.IndexOutOfBoundsException: Index: 27491, Size: 4776
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at org.jf.dexlib.IndexedSection.getItemByIndex(IndexedSection.java:75)
... 18 more
Error occured while retrieving the field_id_item item at index 27491
Error occured at code address 12
code_item @0x28c34

Could there just be a issue with protection in some case or is this a magic apk file

I was able to just decompile the xml files and Such so it is just the Smali editing that cannot be done so I suppling the resources I decompiled as well
[Android Software Development] shockwaverider:
Encountering bootloops when flashing a recompiled (otherwise unmodified) framework-res.apk on Xperia V. Tried with apktool versions 1.5.1 and 1.5.2. I'm using 4.0.4, apparently also an issue on JB. Seems to be issue with Xperia T as well. When pushed with ADB, the device reboots into bootloops as soon as the push command is executed. Flashing in recovery with a known working .zip file flashes without errors, but bootloops just after the boot logo. Compiling throws a few translation warnings, but no errors. I'm using the META-INF and AndroidManifest.xml from the original apk file. Framework files are properly in place in apktool.

I'll happily provide any more info that can help resolve this problem.
[Android Software Development] raziel23x:
Even with just decompiling resources only and changing a few string names does not work with the above apk file I even tried signing it with a test key and even re-injecting the resource.dex file into the original apk file and installing it the app will launch but will not take the changes as well not launch at all if I purely recompile and install it will act like it will launch but crash without error
[Android Software Development] Alcolawl:
APKtool was literally working 24 hours ago, I themed my whole MMS.apk just fine yesterday. Then I apparently made the mistake of restarting my computer and now this:

Decompiles apks just fine, but when trying to build / compile it (even immediately after being decompiled - for testing purposes) it spits out this ridiculous error. This is the most frustrating thing I've ever encountered, I don't understand why this is happening all of a sudden when I changed literally nothing.
[Android Software Development] plegdroid:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

b contacts newcontacts.apk. ?

ⓐⓝⓓⓡⓞⓢⓘⓓⓔ ⓘⓢ ⓝⓞⓣ ⓐ ⓢⓘⓝ
[Android Software Development] RomWiz:
Sv: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

You need too type apktool b contacts "newname".apk

Cheers

Daniel
[Android Software Development] iBotPeaches:
Looked into it. It couldn't find that style, as it said. Which I found strange, so I went and looked into styles.xml/themes.xml and found that apktool couldn't decode some of the styles, which I almost guarantee is those styles.

<item type="style" name="APKTOOL_DUMMY_0045">false</item>
<item type="style" name="APKTOOL_DUMMY_0046">false</item>
<item type="style" name="APKTOOL_DUMMY_0048">false</item>
<item type="style" name="APKTOOL_DUMMY_0049">false</item>
<item type="style" name="APKTOOL_DUMMY_004a">false</item>
<item type="style" name="APKTOOL_DUMMY_004b">false</item>
<item type="style" name="APKTOOL_DUMMY_004c">false</item>
<item type="style" name="APKTOOL_DUMMY_004d">false</item>
<item type="style" name="APKTOOL_DUMMY_004e">false</item>
<item type="style" name="APKTOOL_DUMMY_004f">false</item>
<item type="style" name="APKTOOL_DUMMY_0050">false</item>
<item type="style" name="APKTOOL_DUMMY_0051">false</item>
<item type="style" name="APKTOOL_DUMMY_0052">false</item>
<item type="style" name="APKTOOL_DUMMY_0053">false</item>
<item type="style" name="APKTOOL_DUMMY_0054">false</item>
<item type="style" name="APKTOOL_DUMMY_0055">false</item>
<item type="style" name="APKTOOL_DUMMY_0056">false</item>
<item type="style" name="APKTOOL_DUMMY_0057">false</item>
<item type="style" name="APKTOOL_DUMMY_0058">false</item>
<item type="style" name="APKTOOL_DUMMY_0059">false</item>
<item type="style" name="APKTOOL_DUMMY_005a">false</item>

So went digging why this was.

spec resource 0x7f0c0044 com.sec.android.app.clockpackage:style/Briefing_LineSeperator: flags=0x00000100
INVALID TYPE CONFIG FOR RESOURCE 0x7f0c0045
INVALID TYPE CONFIG FOR RESOURCE 0x7f0c0046
spec resource 0x7f0c0047 com.sec.android.app.clockpackage:style/TextStyle_TimePicker_Number: flags=0x00000180
INVALID TYPE CONFIG FOR RESOURCE 0x7f0c0048

Well, AAPT couldn't figure it out either. So maybe this is a case of newer vs older AAPTs, or even maybe Samsung has their own. I'll continue to look into it, but theres not really much I can do when not even AAPT can read the file.
[Android Software Development] mateorod:
I hadn't seen the 1.5.2 release... I had wondered if tweaking ProGuard might not make a difference, but never got around to trying it. Love the smaller size!

Well done, peaches. (Thanks paul.)
[Android Software Development] vegeta1:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

i am trying to replace images in decompiled 4.2.1 systemui

can any of the good mates take a look st the error i am getting

http://pastebin.com/4VD5aStJ
[Android Software Development] Evewon:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Try deleting res/values/public.xml then try recomiple, it will get rebuilt when compiling.
[Android Software Development] CosmicDan:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Compile and sign it with the same key as the ROM it came from.

Sent from Xperia Play (R800a) running Turbo UI Classic with Tapatalk
[Android Software Development] kingston951:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

I dont know how to use apktool, that's why i asked for instructions.
[Android Software Development] djdarkknight96:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Might wanna try Google or YouTube. "Just saying"
[Android Software Development] kingston951:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

I tried it's not workin for me
[Android Software Development] Jamin13:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

Here it is: http://www.google.com/search?q=how+to+use+apktool&hl=en&newwindow=1&nomo=1&biw=360&bih=615

The first post has tons of helpful information.
[Android Software Development] vegeta1:
i am facing same issues with latest 4.2.1 , if you changed png's then do one thing

correctly make changes to xmls

then recompile it , once done sucessfully , change the pngs via any zip manager like winrar or 7zip
[Android Software Development] iBotPeaches:
SecPhone error has been reported 100 times. The error is telling you what to do. Temporarily you can insert formatted="false" as an attribute to those malformed strings. The non-positional xml reading is not perfect in the current version, but changing it breaks more than it helps. I need to create unit tests for all possible strings. EX, someone could even help me and create a list of strings that take advantage of every possible method of variables in strings.

EX

<string name="test">This is %d string</string>
<string name="test2">This is 2 strings $1%d and $2%s</string>
<string name="test3">"This is quoted string w/ one positional var $1%s"</string>
<string name="test4">"This is quoted string with 1 non-positional var %s"</string>

Currently my focus is being moved to a bug that tons of APKs are exploiting that prevent app decompilation.
[Android Software Development] jackq:
But i dont change any pngs. Only smali and xml editing without interact of any images path.

Systemui taken from CM10.1 for GS2.
[Android Software Development] kingston951:
i can't edit the AndroidManifest.xml

the notepad++ shows everything except what i need :
[Android Software Development] plegdroid:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

did you install all framework apk's, dependent on your phone, it may require you to install more than just the framework-res apk.

ⓐⓝⓓⓡⓞⓢⓘⓓⓔ ⓘⓢ ⓝⓞⓣ ⓐ ⓢⓘⓝ
[Android Software Development] devabhishek:
what exactly are you trying to do ??

did u decompile it ? or u just extracted it ?
[Android Software Development] kingston951:
i extracted it
[Android Software Development] devabhishek:
buddy ,

(in simple language) u need to decompile it , to be able to make any changes , extracting is not decompiling

just google " how to decompile " or you can also search for videos on youtube

---------- Post added at 09:18 PM ---------- Previous post was at 08:40 PM ----------

yes , it went fine

D:\OMEGA V 44 THEMES\anastasia framework>cmd
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

D:\OMEGA V 44 THEMES\anastasia framework>apktool b "D:\OMEGA V 44 THEMES\anastas
ia framework\SecPhone"
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...

thanks a lot for your help buddy ,
[Android Software Development] jackq:
Yup, installed framework and systemui. I searched in franework-res. This missed pngs who give error when recompile systemui and them doesnt exist...

I think that if in systemui path for them is @android/drawable so them must be in framework-res or im wrong?
[Android Software Development] plegdroid:
Re: [UTIL][Feb 02 2013] Apktool v1.5.2 - a tool for reverse engineering apk files

if your pulling from galaxy s2, have you installed the twframework res also?

ⓐⓝⓓⓡⓞⓢⓘⓓⓔ ⓘⓢ ⓝⓞⓣ ⓐ ⓢⓘⓝ