yashsingh1/xdaforums huggingface dataset:
[Android Software Development] laura almeida:
I am getting this error while trying to build apktool

org.jf.dexlib2.AccessorTest > testAccessors FAILED
java.io.FileNotFoundException: C:\Users\Laura\Desktop\Apktool-master\brut.apktool.smali\dexlib2\build\resources\test\accessorTest.dex (The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at org.jf.dexlib2.DexFileFactory.loadDexFile(DexFileFactory.java:104)
at org.jf.dexlib2.DexFileFactory.loadDexFile(DexFileFactory.java:50)
at org.jf.dexlib2.AccessorTest.testAccessors(AccessorTest.java:82)

105 tests completed, 1 failed
:brut.apktool.smali:dexlib2:test FAILED

FAILURE: Build failed with an exception.

Can anyone help me with this ?

It says that the File does not exists.

But it does

C:\Users\Laura\Desktop\Apktool-master\brut.apktool.smali\dexlib2\build\resources\test>dir
Volume in drive C is Win 10
Volume Serial Number is 1229-7AD9

Directory of C:\Users\Laura\Desktop\Apktool-master\brut.apktool.smali\dexlib2\build\resources\test

05-09-2015 10:57 PM <DIR> .
05-09-2015 10:57 PM <DIR> ..
05-09-2015 10:57 PM 28,940 accessorTest.dex
1 File(s) 28,940 bytes
2 Dir(s) 25,982,169,088 bytes free

EDIT : Fixed it !
[Android Software Development] bovirus:
[MENTION=5331708]laura almeida[/MENTION]

If you fixed it please how to fixed it.
[Android Software Development] laura almeida:
I thought the path to that requied file was way too long.

So, I moved the working directiory (Apktool-master) to C:\

that seems to fix it !
[Android Software Development] prdog1:
Yes. Need direct access or environmental path. :cool:
[Android Software Development] _Sofos_:
I wanted to theme SystemUI.apk from my 5.1.1 Note 4 stock deodexed TouchWiz Rom and I found out that even with decompiling/recompiling the apk with zero changes it gives me the glitch you'll see in the image below.

I have no idea how to debug this.. any ideas?

Thank you in advance.
[Android Software Development] iBotPeaches:
This is an ongoing issue of SystemUI elements "moving" around the screen to places they shouldn't. I've been doing research (thanks to tip from a Github user), and it appears that our version of aapt (thanks again new aapt :/ ) switches the attributes in some places.

This becomes apparent with the example of "android:layout_gravity". It may be stored as "top|center", but aapt compiles it as "center|top". I would hope this doesn't affect anything, but alas it does according to reports. I've been trying to build a test application that experiences this via a basic LinearLayout with gravity floated TextView. Unfortunately, I can't duplicate this bug from my own apks so far. This means I either haven't found the real problem or it's more related to the workings of an OEM layout file.
[Android Software Development] :
Isn't a temp fix to use old layout files going to work unless they was modified by the user?
[Android Software Development] vrwmiaris1:
I'd suggest you to theme Swype for start, then system Ui

Στάλθηκε από το LG-D802 μου
[Android Software Development] DUHAsianSKILLZ:
That should work. What i do is right click original apk with winrar, navigate to layouts folder, then copy super_status _bar.xml status_bar_expanded and status_bar_expanded_header.xml to somewhere. Now then i go to my newly compiled systemUI apk and open that with winrar, then I go to layouts folder and drag in the 3 xmls i just copied. That usually fixes pulldown problems but that means you cant mod those 3 xmls.
[Android Software Development] :
Not even with a hex tool
[Android Software Development] _Sofos_:
Thank you very much for the detailed answer, well at least now me and the rest know why and pretty much how to fix it so we're half way there! :p

Thanks to [MENTION=5978945]DUHAsianSKILLZ[/MENTION] posts here, here and here I've actually made it (Samsung TouchWiz SystemUI) so for now no harm no foul, will wait for the new aapt or for Samsung to fix it in future releases in case it's OEM's fw fault.

By decompiling it actually changes indeed android:layout_gravity to

android:layout_gravity="[B][U]bottom|clip_horizontal[/U][/B]"

which should be

android:layout_gravity="center_horizontal"

Yes, but if i want to edit some of those files that's not a real solution. :<

hahaha no comments :p Text me on hangouts
[Android Software Development] :
Well I thought you weren't going to touch thus but you're correct. If you want to it won't work. luckily this issue doesn't affect G3 :)
[Android Software Development] dugeriss:
Check your private msg bro:o
[Android Software Development] DUHAsianSKILLZ:
Would you perhaps know what I would need to change for the rest of mine? I fixed the header but the rest is not centered. (Probably because I own a tablet)

I have tried fixing/changing the layout_gravity to "center" and such on status_bar_expanded.xml and the issue still happens. The only way to center it is to use the original layouts from the original apk. But I really need to be able to edit status_bar_expanded.xml in order to add mods and such to it. I am willing to try any ideas anyone has
[Android Software Development] _Sofos_:
Maybe edit status_bar.xml as well?

In echoes forum [MENTION=4401403]friedrich420[/MENTION] advised me to change all those 3 files in order to make it work (in my case I didn't have to but maybe that's what happens in yours).

Upload your SystemUI btw, 2 minds are better than one anyway :)
[Android Software Development] DUHAsianSKILLZ:
Maybe I should take a look at that and a few others related to status_bar. Thanks for the tip!

My systemUI apks as requested https://www.androidfilehost.com/?fid=24052804347810699
[Android Software Development] Al Arsyadi:
Yes, i already used -b command, but still get .param strings (only .param) like this

# virtual methods
.method protected executor(Lcom/google/common/util/concurrent/Service$State;)Ljava/util/concurrent/Executor;
.locals 1
[B][COLOR="Red"].param p1 # Lcom/google/common/util/concurrent/Service$State;[/COLOR][/B]

new-instance v0, Lcom/google/common/util/concurrent/AbstractIdleService$2;

invoke-direct {v0, p0, p1}, Lcom/google/common/util/concurrent/AbstractIdleService$2;-><init>(Lcom/google/common/util/concurrent/AbstractIdleService;Lcom/google/common/util/concurrent/Service$State;)V

return-object v0
.end method

Please fix if its possible because i dont want decompile twice. :D

Yes i hope so. SO we can do the job easily. :good:
[Android Software Development] iBotPeaches:
I don't think there is a bug or problem here at all.

.param now has an argument (in 2.0) to allow you to specify the register associated with that parameter. In debug mode you get more context to this.

Regular

# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.registers 6
.param p1 # Landroid/content/Context;
.param p2 # Landroid/util/AttributeSet;

Debug

# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.registers 6
.param p1, "context" # Landroid/content/Context;
.param p2, "attrs" # Landroid/util/AttributeSet;

If you have no .param (I assume it follows sequentially), but I don't think .param can be removed.
[Android Software Development] Al Arsyadi:
But why if i'm decompile apk/jar twice (like this) .param were removed? It's weird. :confused:
[Android Software Development] bovirus:
[MENTION=3924617]iBotPeaches[/MENTION]

Latest changes to build - error during compilation

This the log

:brut.j.dir:compileJava

D:\GIT\Apktool-iBotPeaches\brut.j.dir\src\main\java\brut\directory\ZipExtFile.java:18: error: package org.apache.commons.compress.ar

chivers.zip does not exist

import org.apache.commons.compress.archivers.zip.*;

^

D:\GIT\Apktool-iBotPeaches\brut.j.dir\src\main\java\brut\directory\ZipExtFile.java:25: error: cannot find symbol

public class ZipExtFile extends ZipFile {

^

symbol: class ZipFile

D:\GIT\Apktool-iBotPeaches\brut.j.dir\src\main\java\brut\directory\ZipExtFile.java:48: error: cannot find symbol

public InputStream getInputStream(ZipArchiveEntry ze)

^

symbol: class ZipArchiveEntry

location: class ZipExtFile

D:\GIT\Apktool-iBotPeaches\brut.j.dir\src\main\java\brut\directory\ZipExtFile.java:55: error: cannot find symbol

public ZipArchiveEntry getEntry(String name) {

^

symbol: class ZipArchiveEntry

location: class ZipExtFile

D:\GIT\Apktool-iBotPeaches\brut.j.dir\src\main\java\brut\directory\ZipExtFile.java:51: error: cannot find symbol

return super.getInputStream(ze);

^

symbol: variable super

location: class ZipExtFile

D:\GIT\Apktool-iBotPeaches\brut.j.dir\src\main\java\brut\directory\ZipExtFile.java:47: error: method does not override or implement

a method from a supertype

[MENTION=439709]override[/MENTION]

^

D:\GIT\Apktool-iBotPeaches\brut.j.dir\src\main\java\brut\directory\ZipExtFile.java:56: error: cannot find symbol

return super.getEntry(name);

^

symbol: variable super

location: class ZipExtFile

D:\GIT\Apktool-iBotPeaches\brut.j.dir\src\main\java\brut\directory\ZipExtFile.java:54: error: method does not override or implement

a method from a supertype

[MENTION=439709]override[/MENTION]

^

8 errors

:brut.j.dir:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':brut.j.dir:compileJava'.

> Compilation failed; see the compiler error output for details.

* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 9.594 secs

****** Solved

I solved re-download entire github repoository, Strange....
[Android Software Development] saginesht:
Can u give me apktool v2.0.2?
[Android Software Development] Ticklefish:
Have you tried building it yourself? It's surprisingly simple to do..

Just remember that it won't be the official v2.0.2. That won't be realised until the dev is sure it works properly.
[Android Software Development] DaOldMan:
Sure man just do it via pm.
[Android Software Development] exodius48:
[MENTION=3924617]iBotPeaches[/MENTION] I have built Apktool 2.0.2 from github source, and i test it with MIUI7 global edition. Its work when decompile apk. But if i compile apk, i get these errors

D:\MASTER\Android\TOOLS\APKTool>apktool b ThemeManager
I: Using Apktool 2.0.2-027e13-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
E/ResourceType( 4948): Failed resolving ResTable_map name at 3252 with ident 0x1
00b000b
warning: string 'basic_info' has no default translation.
warning: string 'resource_get_auth_missing' has no default translation.
warning: string 'resource_tip_select_ringtone' has no default translation.
warning: string 'resource_unable_to_access' has no default translation.
warning: string 'theme_batch_has_update_text' has no default translation.
warning: Package not found for resource #1001004f
I: Building apk file...

I'm using this rom http://bigota.d.miui.com/5.8.28/miui_HMNoteWGlobal_5.8.28_e890213057_4.4.zip

Can it be solved?
[Android Software Development] Al Arsyadi:
Hi all, is there a way to keep original signature from apk/jar?

Because after compiling, signature always gone.
[Android Software Development] DaOldMan:
There is a switch for that and also if you want just copy manifest.xml + meta-inf dir from original apk like I do :)
[Android Software Development] Al Arsyadi:
Can you share to me what is switch did you men? / is there a command line for it?
[Android Software Development] laura almeida:
-c
[Android Software Development] Al Arsyadi:
Wow..it's work :D

I get this error while compiling

I: Checking whether sources has changed...
[Fatal Error] AndroidManifest.xml:1:1: Content is not allowed in prolog.

But it works, meta inf folder form original apk is in the modified apk.

Btw what is the error code above mean?
[Android Software Development] :
Blame MIUI it's their fault from sticking out :p

Nothing huge and can be info with apps itself not apktool it is at it says prologue not allowed in manifest but there usually isn't any in there
[Android Software Development] Gundabolu SC:
Just need a little help guys! Trying to Translate a Chinese Smartband android app, but having problems recompiling it, throws up errors with public.xml which i never changed! :( Any help is appreciated! Uploading the apk along with the translated files.... :) Thanks in advance!
[Android Software Development] Morningstar:
Without the frameworks to go with it, you probably won't get any help. What's the error message look like?
[Android Software Development] Gundabolu SC:
Frameworks? its an app off a Chinese playstore... Issue was that the app works fine and all when i put my system language to Chinese but crashes when changed to English, decompiling the apk i found loads of untranslated stuff in arrays.xml and styles.xml guessing that was the problem for the crash.....
[Android Software Development] Morningstar:
Ah. I thought you meant it was an app from a Chinese ROM, so never mind what I said about frameworks lol.

You can ignore all the stuff in the error log about public symbols not being defined; None of that is the problem. The real problem is all of the deformed 9patch errors at the top of the log. Fix those 11 9patch images, and it should work.
[Android Software Development] chas123:
I am receiving this error when trying to decompile Settings.apk from the latest HTC M9 update:

I: Loading resource table...

Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f100000 bool/config_allow_edit_

carrier_enabled, config=[DEFAULT]

at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:63)

at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:56)

at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:223)

at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:191)

at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:159)

at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:116)

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

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

at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:544)

at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:63)

at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:55)

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

at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:197)

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

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

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

I have tried 2.0, 2.0.1 and a fresh build from the repository.

Any help would be appreciated
[Android Software Development] ineedone:
As far as I know, nobody has been able to decompile latest htc settings. Hexedit is your only option or use previous settings apk
[Android Software Development] Hen Ry:
Can not be decompile, wanted to translate this app?

Log For : LBESecV6_Elite-A1-release-v1.0.1878.apk -> https://play.google.com/store/apps/details?id=com.lbe.security.prime

Log Type : Decompiling

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

Exception in thread "main" brut.androlib.AndrolibException: Multiple res specs: attr/?

at brut.androlib.res.data.ResType.addResSpec(ResType.java:62)

at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:219)

at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:191)

at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:159)

at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:116)

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

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

at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:538)

at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:63)

at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:55)

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

at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:209)

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

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

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

Where is the general problem?
[Android Software Development] andy_light:
Hi. How can I get version 2.0.2 (alpha or beta, no matter). I can't compile any apk with 2.0.1 because of this issue - https://github.com/iBotPeaches/Apktool/issues/1005. It fixed in 2.0.2.
[Android Software Development] iBotPeaches:
This build page should give you the details on how to compile a source build yourself. - http://ibotpeaches.github.io/Apktool/build/

Assuming you have git installed and a JDK of at least 1.7+, it will work.
[Android Software Development] edzamber:
Works fine.

I have compile build source myself :)

Sorry i don't share without [MENTION=3924617]iBotPeaches[/MENTION] consentement...

Tagged with my name ;)
[Android Software Development] Ban Dan:
Anyone successful in building it using AIDE (Android IDE) on the phone itself (build and run without a PC )?

That would be GOOD news! :)
[Android Software Development] user2k10:
+1

----
[Android Software Development] iBotPeaches:
I don't even want to think of the incompatibilities in building apktool on an Android host, in addition to actually running it. Just wait for a binary :p

Building aapt binaries for 2.0.2 now, Linux is done. Windows is cross compiling now, and my mac host is still downloading AOSP android-6.0.0_r1 :/
[Android Software Development] Ban Dan:
You sure know how to have fun! ;)

---------- Post added at 00:59 ---------- Previous post was at 00:55 ----------

A binary will be good!

Can happily wait :)

As for the incompatibilities in building apktool on an Android, have you taken a close look a AIDE yet?

It's a real marvel!

Has aapt already included (need to check version).

Wishing you a nice day.

Have fun!
[Android Software Development] iBotPeaches:
Need some testing on a new binary.

AAPT as of 6.0 has a new dependency on `libc++.so` vs `libstdc++.so`. This proved to cause me some problems until I manually linked it. Usually my `ia32-libs` had me covered, but did not in the case of 6.0. Android SDK ships with the a `/lib` folder than contains these dependencies so the average user would never encounter these errors, but apktool leverages build tools outside of the Android SDK, so I encountered some errors, which I hope to rectify one way or another.

If you have Linux, please help me out. (Sorry Mac/Windows, I'm not sure how shared object linking works on your systems and haven't even tested if this is a problem for you)

Download this aapt - http://connortumbleson.com/apktool/aapt/10_7_2015-test/aapt

Run `ldd aapt` on it.

Grab results and PM them to me / Email them to me (ibotpeaches (at) gmail (dot) com).

They should look like this.

ibotpeaches@raganok:/home/ibotpeaches$ ldd aapt
linux-gate.so.1 => (0xf76e6000)
libc++.so => /usr/local/android-sdk/build-tools/23.0.0/./lib/libc++.so (0xf752d000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf74cf000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf74c9000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf74ac000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf7491000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7444000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7427000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf726b000)
/lib/ld-linux.so.2 (0xf76e8000)

As you can see. `libc++.so` is linked to an object that was downloaded in the android-sdk, not something that was available on my system. My hope is to determine if the `libc++.so` object is available on your system (IE `/lib`) or located elsewhere or possibly not found.

Thanks for any help!
[Android Software Development] fhem:
http://hastebin.com/eqiyukesim.coffee it is in my sdk tools http://hastebin.com/esiyijexim.avrasm

edit: I changed my bashrc export path to point directly at libc++.so and still doesn't find it. I have been decompiling/recompiling M apps w/o issues. Using dirty apktool build.
[Android Software Development] iBotPeaches:
Thanks, this is what I feared. `libc++` isn't widely available on distributions (This Stack post explains it way better than I can - http://stackoverflow.com/a/20937525/455008). Though, there has to be a reason why AOSP moved towards `libc++` leaving `libstdc++` behind, including switching the entire frameworks/base project and libskia over to it.

Requiring users of Apktool to have the entire Android SDK downloaded is insane, in addition to that, adding help docs to add a new dependency (in this case `libc++.so`) is also insane. I am removing the dependency. I have no idea what this will cause, but since my purpose with AOSP is one item (building AAPT). We should be okay. I will keep you guys updated.
[Android Software Development] citymen34:
Hi, i found a bug. i decompile my SecSettings.apk file (SM-G850F Android 5.0.2) nothing any change and recompile file. succesfully recompiled but added layout-v22 and values-v22 file. flash new settings file my phone but i don't using some options in new secsettings file.

please fix this bug. Original secsettings file not have layout-v22 and values-v22
[Android Software Development] citymen34:
Apktool 2.0.1 auto added layout-v22 and values-v22 folder in recompiled apk. Please fix this issue. i try recompile secsettings.apk and systemui.apk same issue. i using apktool 2.0.0 rc3 no any issue.
[Android Software Development] PerfectSlayer:
You got a new PM ;)
[Android Software Development] iBotPeaches:
Update

After learning that AAPT 6.0 introduced a new shared object dependency I set off to fix it. (https://plus.google.com/+ConnorTumbleson/posts/NzP4UFefZkF). Basically, removing libc++ in favor of libstdc++ is a no no. They switched to it a reason and reverting to libstdc++ is not an option. Downgrading to 5.1 AAPT is a temporary solution and will only get harder to support as 6.1/7.0 come out.

Dees Troy of TWRP offered some assistant here and let me know about static compiling the libc++ dependency. This builds the dependency into the binary itself (increasing the size, but preventing the need to have it already installed). After messing with the AOSP build system a bit, we got an aapt binary with static libc++ dependency. It was 12.3MB for the linux binary. So we are looking at a larger apktool size for the release of 2.0.2. Though, you only download apktool like once every few months so this shouldn't matter.

I'd much rather have a larger binary than deal with the support question of "how to install libc++". Then bad luck struck (https://plus.google.com/+ConnorTumbleson/posts/ZHQvksFo81K). My hard drive died during an AOSP build. I tried for a few hours to salvage data using the freezer trick. I got my SSH keys and a few important files off and let the drive die in peace. Long story short, had to buy new drive and setup new laptop.

So now AOSP is downloading again on a new laptop drive in hopes to re-build AAPT again for these required changes. I then will have a test AAPT post for all 3 platforms as a final test to make sure they all work, then we are looking at a release of 2.0.2.