yashsingh1/xdaforums huggingface dataset:
[Android Software Development] fhem:
I believe samsung has two framework apks - did you "apktool if xxxxx.apk" both of them framework-res.apk and twframework-res.apk
[Android Software Development] zelendel:
There are tech 3 framework apks. The base frameworks-res and the systemui apks. Then add on any that the OEM has added like twframeworks or HTC custom frameworks. Best bet to make sure to install all frameworks before you do anything or you will be hunting ghost errors.
[Android Software Development] :
I'm trying to decompile an apk, i have done this before with success however whenever i try to decompile an apk that i've pulled from /system/app I get this error, it seems that any apk that starts with com.example.apk i run into errors, even if i rename the file to example.apk is there something i need to do to a com.example.apk before i can decompile it? any help would be great as i've searched for a fix for this issue for a long time, giving up and then trying again multiple times. Thanks in advanced!

java version "1.8.0_31"

Java(TM) SE Runtime Environment (build 1.8.0_31-b13)

Java HotSpot(TM) Client VM (build 25.31-b07, mixed mode, sharing)

I: Baksmaling...

I: Loading resource table...

Exception in thread "main" brut.androlib.AndrolibException: Could not decode ars

c file

at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)

at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibRes

ources.java:491)

at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.jav

a:74)

at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.jav

a:66)

at brut.androlib.Androlib.getResTable(Androlib.java:50)

at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)

at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)

at brut.apktool.Main.cmdDecode(Main.java:146)

at brut.apktool.Main.main(Main.java:77)

Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000

at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)

at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:44)

at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10

2)

at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)

at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)

... 8 more
[Android Software Development] _alex74_:
But this is not main issue highlighted......

parsing error will come even if you are not touching manifest at all.....

just simple recompiling as it is, will make seccontacts disappear

.... hope [MENTION=3924617]iBotPeaches[/MENTION] will figure it out :)
[Android Software Development] Thebear j koss:
Looks as if you are missing resources or have the wrong ones installed to apktool. Did you if all the proper framework and system files? Some apps may need a different framework installed. For imstance if you are on 4.4 kit kat and editing phone or contacts you would need the 4.4 frameworks but if you are trying say com.google.quicksearchbox.apk and it is a newer google now, it would need the updated 5.0 lollipop framework installed to apktool.

Thebe@r'$ G@L@XY

---------- Post added at 10:14 AM ---------- Previous post was at 09:57 AM ----------

http://xdaforums.com/showthread.php?p=59845407. Apparently a workaround has been found for tw secContacts.apk, sprint galaxy s5 has some amazing devs like [MENTION=1949695]jrkruse[/MENTION], [MENTION=1042140]tdunham[/MENTION], and [MENTION=1167171]rompnit[/MENTION] and I'm sure others I'm forgetting. But given some time, I know from galaxy s3 these guys know samsung devices better than samsung does.

Thebe@r'$ G@L@XY
[Android Software Development] iBotPeaches:
Assuming that issue is the described in this report - https://github.com/iBotPeaches/Apktool/issues/636#issuecomment-88919952 then yes I'm working on it now. Basically I just automate the literal value change for the [MENTION=936943]string[/MENTION] reference. Tried to research "^attr-private" in Lollipop, but then realized it might not be able to be used for older apks. So just working on this implementation .
[Android Software Development] DaOldMan:
Weird bug with latest build (posted by [MENTION=3924617]iBotPeaches[/MENTION] as a snapshot and the same with a newer build compiled from sources by me):

I have compiled SecSettings (Lollipop 5.0 on n9005) and got a weird result! The points in the Pattern unlock settings became white on white :( (I can still see the dots as they are completely white). Since this was a heavy mod I was sure this was my mod. In the end after debugging thoroughly I found out it was the latest apktool :(. The same app compiled with 2.0rc4 everything is fine - the dots are black again :).

Nothing special in the log, just warnings.

I can recompile again and show pictures if needed. This is a weird bug, but is very problematic as it shows apktool compiles some resources wrong. I can test if the problem lies with decompiling or recompiling if needed.

Happy hollidays,

Thomas
[Android Software Development] iBotPeaches:
Very strange. Maybe regression occurred. You can do this. Decode apk into "control" folder. Build "control" to "dirty.apk". Decode "dirty.apk" to "dirty". Compare in a diff program "control" and "dirty" folder. Looks at the /res directory in particular for changes that may of occurred. I looked at the changes since RC4 and nothing touched the resources except this one - https://github.com/iBotPeaches/Apktool/commit/5076612c873460e8cfe7580db49873ed47269a7a

So you can do the above mentioned steps and try building apktool without that commit and see if it works.
[Android Software Development] Thebear j koss:
It's just the way I was taught from my brother. He was on TW and I think it needs to be installed or you wind up with a lot of apktool Dummy resources. I'm sure it really can't hurt anything by having it installed. I haven't run into any issues. I know there are a lot of guys and gals that are waaaay smarter than I am when it comes to this stuff, he'll 99% of Ibotpeaches posts make little to know sense to me. Lol

Thebe@r'$ G@L@XY
[Android Software Development] djdarkknight96:
I have GOogled some things from his posts myself lol
[Android Software Development] Ticklefish:
You don't need to install SystemUI.apk as a framework. It won't cause any harm, you can install as many non-framework files as you like, but it won't actually help any when you de/recompile. No apk uses those resources.

I'm pretty sure that all framework files are kept in system/framework only and, although I may be wrong here, they'll have 'res' in the filename.

I might be wrong about that filename part but I haven't ever encountered any framework files that don't have it.
[Android Software Development] :
Ok guys I think it may have been the framework.apk causing the error, i couldn't install newer kk or lp framework with the version i had as it was old, i have updated and installed 5.0 framework but now i recieve this error, doi i just need to update java?

Thanks for all your guys help so far :)

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

|04/04/2015 -- 10:53:35.46|

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

java version "1.8.0_31"

Java(TM) SE Runtime Environment (build 1.8.0_31-b13)

Java HotSpot(TM) Client VM (build 25.31-b07, mixed mode, sharing)

Input file (Kim\Desktop\APK-Multi-Tool\projects/com.nokia.app.mixradio.client-2.

2.1910-1910-minAPI16.apk) was not found or was not readable.

Press any key to continue . . .
[Android Software Development] nodz13:
Its work and succesfully. Just need drag original Manifest and meta from original folder to xxxxx.apk in dist folder
[Android Software Development] Avina Kefin:
Gak kenek digae neng miui v6 om , pie iki :( lek gae 2.0.0 RC 4 install framework-res iso , tapi lek gae seng anyar iku ngebrut ngene iki

iki gae seng 2.0.0RC4 isok dcompile , tapi wayae recompile eror

sorry. my english is bad and I do not speak English at the core MIUI v6 , the latest apktool Can NOT install framework :(

I use google translate sorry :D

apktool v2.0.0RC4

apktool latest
[Android Software Development] nodz13:
Ada dari jawa nih [emoji4]

---------- Post added at 11:28 AM ---------- Previous post was at 11:22 AM ----------

Use english om, nnt disemprot sma admin forum if we are not using english mah
[Android Software Development] bovirus:
What does it mean

ProGuard, version 5.2

Reading program jar [D:\Apktool-iBotPeaches\brut.apktool.smali\baksmali\build\libs\baksmali-2.0.5-dev.jar]

Reading library jar [C:\Programmi\Java\jdk1.7.0_76\jre\lib\rt.jar]

Note: org.jf.dexlib2.analysis.reflection.ReflectionField calls 'Field.getType'

Note: there were 1 classes trying to access generic signatures using reflection.

You should consider keeping the signature attributes

(using '-keepattributes Signature').

(http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)

Preparing output jar [D:\Apktool-iBotPeaches\brut.apktool.smali\baksmali\build\libs\baksmali-2.0.5-dev-small.jar]

Copying resources from program jar [D:\Apktool-iBotPeaches\brut.apktool.smali\baksmali\build\libs\baksmali-2.0.5-dev.jar]

:brut.apktool.smali:smali:proguard

ProGuard, version 5.2

Reading program jar [D:\Apktool-iBotPeaches\brut.apktool.smali\smali\build\libs\smali-2.0.5-dev.jar] (filtered)

Reading library jar [C:\Programmi\Java\jdk1.7.0_76\jre\lib\rt.jar]

Note: org.jf.dexlib2.analysis.reflection.ReflectionField calls 'Field.getType'

Note: there were 1 classes trying to access generic signatures using reflection.

You should consider keeping the signature attributes

(using '-keepattributes Signature').

(http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)

Preparing output jar [D:\Apktool-iBotPeaches\brut.apktool.smali\smali\build\libs\smali-2.0.5-dev-small.jar]

Copying resources from program jar [D:\Apktool-iBotPeaches\brut.apktool.smali\smali\build\libs\smali-2.0.5-dev.jar] (filtered)

:brut.apktool:apktool-cli:cleanOutputDirectory

:brut.apktool:apktool-cli:proguard

ProGuard, version 5.2

Reading program jar [D:\Apktool-iBotPeaches\brut.apktool\apktool-cli\build\libs\apktool-cli.jar] (filtered)

Reading library jar [C:\Programmi\Java\jdk1.7.0_76\jre\lib\rt.jar]

Preparing output jar [D:\Apktool-iBotPeaches\brut.apktool\apktool-cli\build\libs\apktool-2.0.0-7f487d-SNAPSHOT-small.jar]

Copying resources from program jar [D:\Apktool-iBotPeaches\brut.apktool\apktool-cli\build\libs\apktool-cli.jar] (filtered)

Compiled with latest changes about sources.
[Android Software Development] DSA:
There's no errors in that log...what's the problem?
[Android Software Development] bovirus:
Is just a request if it's normal....

Note: there were 1 classes trying to access generic signatures using reflection.

You should consider keeping the signature attributes

(using '-keepattributes Signature').
[Android Software Development] DSA:
Its just advice, shouldn't cause any issues
[Android Software Development] Avina Kefin:
Gak iso blas e yowislah suwun om :D
[Android Software Development] zelendel:
All posts have to be in English or with an English translation
[Android Software Development] Avina Kefin:
ok sorry om :D
[Android Software Development] jekagan:
Unable to disassemble/reassemble Firefox

Has anyone tried using apktool on the latest version of Firefox (v37) that's available from the Play Store? It doesn't appear to reassemble due to some squawking about invalid resource directory names, which at further inspection appear to have filenames containing Unicode characters.

Any thoughts on this?
[Android Software Development] Morningstar:
I don't have Firefox, and I don't really want to download it to look, but by chance, is there a values folder with odd characters in the name (likely the last of the values folders)? I've seen that in one or two other apps ...Assuming it is just a values folder, only containing translations (and nothing unique), all you have to do is delete it, and it should recompile fine.
[Android Software Development] jekagan:
Yeah, I thought about that, but unfortunately in my case that's not an option. We have a lengthy script to do the whole thing automatically. Oddly, it works fine on an older version of Firefox (v33). Strange, indeed.
[Android Software Development] iBotPeaches:
I dumped the configurations (aapt d configurations firefox.apk) and spotted 3 BCP47 tags.

mai
dsb
hsb

That means the "unicode" char you saw was just an improper reading of the above 3 qualifiers. I added support for BCP47 tags here - https://github.com/iBotPeaches/Apktool/pull/100 . This was released in a snapshot build here - http://xdaforums.com/showpost.php?p=59436776&postcount=2812

As you can imagine what I'm about to say. I don't duplicate this problem on v37 of Firefox, thus it was already fixed :)
[Android Software Development] jekagan:
STUPENDOUS! That snapshot build did the trick. Thanks so much for the quick reply. You're a great asset to the community, and we're lucky to have you on our side.
[Android Software Development] DoctorStrange96:
I'm having trouble decompiling / compiling 5.1 apk's with the latest apktool version (2.0.0-RC4). I use a modified version of apk-multi-tool as my main tool for that purpose. What I did was:

1. Trying to decompile AOSP 5.1's Settings.apk using the 5.1 framework -- failed

2. Trying to decompile the same app using 5.0.2 framework -- success

3. Compiling the app using 5.1 framework -- failed

4. Compiling the app using 5.0.2 framework -- half-success; the app compiled but my changes didn't stick

Here's a log if its of any help (if you can understand it, that thing is kinda messy).

http://pastebin.com/raw.php?i=eZbcvUNX
[Android Software Development] Thebear j koss:
Look up 2 posts. I believe your question is answered.

Thebe@r'$ G@L@XY
[Android Software Development] JazonX:
Lollipop 5.0.1 (BOC6)

1. SecSettings.apk decompiled, changed 2 xml files in res/xml/ folder (Enable Appops / Torch)

2. compiled without error (deleted resource.arsc files as instructed)

3. Pushed the new compiled apk (over 30MB larger than the original file) to phone - works / nothing changed

4. Pushed original apk with newly compiled apk's resource.arsc file - FC

5. Pushed new apk with original files resource.arsc/manifest/meta-inf - works / nothing changed

Any Advice?
[Android Software Development] Thebear j koss:
Need to update and install the framework res.

Thebe@r'$ G@L@XY

---------- Post added at 06:05 PM ---------- Previous post was at 06:02 PM ----------

Put new resources from compiled apk into original apk. Then push into system.

Thebe@r'$ G@L@XY
[Android Software Development] DoctorStrange96:
Yeah, the snapshot build. I downloaded it, renamed it to apktool.jar, set up apk-multi-tool and it worked perfectly! Now I can compile / decompile 5.1 apk's without any issue.
[Android Software Development] JazonX:
Works! Thanks Mate!
[Android Software Development] maanz "L":
Hi Bros...

I thought I could share my experience and hope to find answers.

C:\Users\maanzosburn79\Desktop\c>java -jar apktool.jar b LegacyInCallUI
I: Using Apktool 2.0.0-RC4
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building apk file...
I: Copying unknown files/dir...
Exception in thread "main" brut.androlib.AndrolibException: java.nio.file.FileAlreadyExistsException: C:\Users\maanzosburn79\Desktop\c\LegacyInCallUI\dist\zipfstmp4308464012918347667.tmp -> C:\Users\maanzosburn79\Desktop\c\LegacyInCallUI\dist\LegacyInCallUI.apk
at brut.androlib.Androlib.buildUnknownFiles(Androlib.java:576)
at brut.androlib.Androlib.build(Androlib.java:289)
at brut.androlib.Androlib.build(Androlib.java:255)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
Caused by: java.nio.file.FileAlreadyExistsException: C:\Users\maanzosburn79\Desktop\c\LegacyInCallUI\dist\zipfstmp4308464012918347667.tmp -> C:\Users\maanzosburn79\Desktop\c\LegacyInCallUI\dist\LegacyInCallUI.apk
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileCopy.move(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.move(Unknown Source)
at java.nio.file.Files.move(Unknown Source)
at com.sun.nio.zipfs.ZipFileSystem.sync(ZipFileSystem.java:1297)
at com.sun.nio.zipfs.ZipFileSystem.close(ZipFileSystem.java:277)
at brut.androlib.Androlib.insertFile(Androlib.java:595)
at brut.androlib.Androlib.buildUnknownFiles(Androlib.java:571)
... 4 more

I'm trying to make some mods and after recompiling this error, I got a .tmp file in dist folder.

But I'm able to copy files from that .tmp file over to the original apks and flash without errors.

So, what does this recompiling errors mean?

Cheers....
[Android Software Development] iBotPeaches:
Java7 NIO library is removed in the next version due to being incredibly buggy. We fallback to Java6 compatible IO libraries as they proved to be stable and not lacking features. There is one pull request pending, that cleans up some of the post change stuff: https://github.com/iBotPeaches/Apktool/pull/898

So basically hold tight. The final version is almost here and you shouldn't have that problem.
[Android Software Development] maanz "L":
Good to hear that, mate. :good:
[Android Software Development] arunsai123:
I can't decompile cm12.1 settings.apk

tried to modify cm12.1 .

D:\lol>java -jar a.jar d Settings.apk
I: Using Apktool 2.0.0-RC4 on Settings.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Arun.ARUN-DESKTOP\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x00000016
I: Loading resource table from file: C:\Users\Arun.ARUN-DESKTOP\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x00000034
I: Loading resource table from file: C:\Users\Arun.ARUN-DESKTOP\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=sharedUserId, value=0x00000033
Exception in thread "main" java.lang.NullPointerException
at java.io.Writer.write(Unknown Source)
at brut.androlib.res.util.ExtMXSerializer.writeAttributeValue(ExtMXSerializer.java:38)
at org.xmlpull.mxp1_serializer.MXSerializer.attribute(MXSerializer.java:673)
at org.xmlpull.v1.wrapper.classic.XmlSerializerDelegate.attribute(XmlSerializerDelegate.java:106)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamDecoder.java:83)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:141)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPullStreamDecoder.java:153)
at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecoder.java:134)
at brut.androlib.res.AndrolibResources.decodeManifestWithResources(AndrolibResources.java:294)
at brut.androlib.Androlib.decodeManifestWithResources(Androlib.java:138)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
[Android Software Development] Spannaa:
Try again with this ;)
[Android Software Development] mikereidis:
Is Multidex well supported by apktool ?

I'm rev-e-ing the Android Auto APK and it's Android 5.0+ API 21+ only so I guess it's using the native Multidex support.

Many of the Smali classes I'm interested in have the obfuscated class/.java file names: a.java, b.java,...z,java, aa.java...

But when I run dex2jar on classes.dex many of the class names show up in jd-gui, but some classes are missing altogether.

Also, at some point I was able to create a classes.dex (bigger than when extracted from APK), classes2.dex, classes3.dex, but I have no recollection of what tool I used to do that, LOL.

Thanks for any help and thanks for apktool ! :)
[Android Software Development] Dauntless:
If I use "apktool d myapk.apk", it successfully decompiles, but some files are in an "unknown" folder.

If I then use "apktool b myapk", those "unknown" resources are no longer compiled into the .apk and the app crashes.

How can I tell apktool to add those files? The files in question are timezone files of Joda Timezone library:

http://joda-time.sourceforge.net/timezones.html
[Android Software Development] iBotPeaches:
There are unit-tests for this and they are not failing. Which means unknown files are correctly inserted into final built apktool. Please provide Operating System, Java version, apktool version used, and apk itself.
[Android Software Development] _alex74_:
Confirmed, never had issue like this with all apktool versions..... it even says on command prompt just after has builded resources, copying unknown files, which takes a while....:good::good::good:
[Android Software Development] sheva_xan:
Sorry wrong thread

<deleted>
[Android Software Development] Phone_Guru:
I don't have this problem with this file. Must be an error with your setup.
[Android Software Development] _alex74_:
Neither on Galaxy S4 & S5 :D

please which device? upload your apk, we can test it
[Android Software Development] Master_T:
I'm trying to decompile a very simple APK I built myself, and I don't understand why it fails. Here is the output:

C:\SWAMP\TesiAndroidLoger\Code\tools>java -jar apktool.jar d -f -no-src testapk.
apk
I: Using Apktool 2.0.0-RC4 on testapk.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Elia\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=
touchscreenBlocksFocus, value=0xffffffff
I: Decoding values */* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec:
0x01010462
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:59)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:57)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:53)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferen
ceValue.java:57)
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(Re
sStyleValue.java:54)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResour
ces.java:581)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:344
)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:133)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:104)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)

I'm attaching the test APK to this post, hope someone can figure it out (I'm on Win 8.1 btw)
[Android Software Development] Phone_Guru:
On s4, stock uhoc1 apk but had no issue with any s4 stock ROM file.
[Android Software Development] _alex74_:
no issue here.... decompiled, modified a value, recompiled....

bingo:D

which framework device u install?

Use S5 LL one
[Android Software Development] Master_T:
Can you please link me the version of ApkTool you're using? And maybe the exact command line you used to decompile? Because on my machine it doesn't work using the 2.0rc4.
[Android Software Development] prdog1:
If had been reading and keeping up you would have seen the snapshot that fixed most Samsung Apks. :cool:

Others have decompiled and recompiled so it is using wrong ApkTool or your setup is bad.

http://xdaforums.com/showpost.php?p=59436776&postcount=2812