Apktool version: 2.0.3
Sample.apk is obfuscated by Dexguard and multidex enabled.
Error output while decompiling (source or resource only doesn't make any difference)
C:\>apktool d Sample.apk -s
I: Using Apktool 2.0.3 on Sample.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\devrimtu\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Copying raw classes.dex file...
I: Copying assets and libs...
I: Copying unknown files...
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.Direc
toryException: Error copying file: ♂? .xml
at brut.androlib.Androlib.decodeUnknownFiles(Androlib.java:214)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:158)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
Caused by: brut.directory.DirectoryException: Error copying file: ♂? .xml
at brut.directory.DirUtil.copyToDir(DirUtil.java:88)
at brut.directory.AbstractDirectory.copyToDir(AbstractDirectory.java:207
)
at brut.androlib.Androlib.decodeUnknownFiles(Androlib.java:207)
... 3 more
Caused by: java.io.FileNotFoundException: C:\Users\devrimtu\Documents\Programs\A
pkTool\b\unknown\♂? .xml (The filename, directory name, or volume label synt
ax is incorrect)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at brut.directory.DirUtil.copyToDir(DirUtil.java:84)
... 5 more
so, is it decrypted?
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: Error copying file: .xml
at brut.androlib.Androlib.decodeUnknownFiles(Androlib.java:214)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:158)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
Caused by: brut.directory.DirectoryException: Error copying file: .xml
at brut.directory.DirUtil.copyToDir(DirUtil.java:88)
at brut.directory.AbstractDirectory.copyToDir(AbstractDirectory.java:207)
at brut.androlib.Androlib.decodeUnknownFiles(Androlib.java:207)
... 3 more
Caused by: java.io.FileNotFoundException: C:\APK Tools v3.50\Projects\com.nostratech.gojek.driver_1.0.86.apk\unknown\.xml (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at brut.directory.DirUtil.copyToDir(DirUtil.java:84)
... 5 more
I have the same problem but only on Windows system. On Linux works perfect.
This file
https://drive.google.com/file/d/0B0hFfYwwa3TfR051bXFkVWFsbE0/view?usp=sharing
apktool is decoded with no issues on Ubuntu.
People are mixing issues here. One is that dexguard introduces non-standard characters into XML files that stock aapt cannot handle, thus crash.
There is a separate issue where host computers don't have the proper charsets to support UTF8 characters, thus errors.
The second issue is not apktool's fault. Granted, either is the first one, but apktool embeds aapt so we must find the patch in that.
I got the same error yesterday when I tried to use apktool 2.1.1 to decompile an apk file.
`Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: Error copying file: assets
at brut.androlib.Androlib.decodeRawFiles(Androlib.java:151)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:157)
at brut.apktool.Main.cmdDecode(Main.java:163)
at brut.apktool.Main.main(Main.java:81)
Caused by: brut.directory.DirectoryException: Error copying file: assets
at brut.directory.DirUtil.copyToDir(DirUtil.java:91)
at brut.directory.AbstractDirectory.copyToDir(AbstractDirectory.java:207)
at brut.androlib.Androlib.decodeRawFiles(Androlib.java:142)
... 3 more
Caused by: brut.directory.DirectoryException: Error copying file: atlas/3|5/480x800/spine/general/coin-big.atlas
at brut.directory.DirUtil.copyToDir(DirUtil.java:88)
at brut.directory.DirUtil.copyToDir(DirUtil.java:61)
at brut.directory.AbstractDirectory.copyToDir(AbstractDirectory.java:197)
at brut.directory.DirUtil.copyToDir(DirUtil.java:77)
... 5 more
Caused by: java.io.FileNotFoundException: output\assets\atlas\3|5\480x800\spine\general\coin-big.atlas (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at brut.directory.DirUtil.copyToDir(DirUtil.java:84)
... 8 more`
The file path is ...\assets\atlas\3_5\480x800\spine\general\coin-big.atlas and I didn't see special character in coin-big.atlas.
@zachary-jomedia can you open a new bug with that apk attached and reference this issue? That seems to be a bug unrelated to Dexguard.
i need help with
[9] Rebuilding aaa.apk with meterpreter injection as aaa_backdoored.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.io.FileNotFoundException: /home/ss/Desktop/test/tmp/MQ7EEX/aaa_backdoored.apk (No such file or directory)
at brut.androlib.Androlib.readMetaFile(Androlib.java:256)
at brut.androlib.Androlib.build(Androlib.java:268)
at brut.androlib.Androlib.build(Androlib.java:261)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.directory.DirectoryException: java.io.FileNotFoundException: /home/ss/Desktop/test/tmp/MQ7EEX/aaa_backdoored.apk (No such file or directory)
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.Androlib.readMetaFile(Androlib.java:251)
... 4 more
Caused by: java.io.FileNotFoundException: /home/ss/Desktop/test/tmp/MQ7EEX/aaa_backdoored.apk (No such file or directory)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:53)
... 7 more
[-] Error creating injection APK,If you haven't Android-SDK please install it.
-pc:~/Desktop/test$
➜ Bug1129 apktool d com.nostratech.gojek.driver_1.0.86.apk
I: Using Apktool 2.2.2-31d015-SNAPSHOT on com.nostratech.gojek.driver_1.0.86.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /Users/connortumbleson/Library/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
➜ Bug1129 apktool b com.nostratech.gojek.driver_1.0.86
I: Using Apktool 2.2.2-31d015-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/lib)
I: Building apk file...
I: Copying unknown files/dir...
➜ Bug1129
This was fixed with the recent patches to aapt. Will be in the 2.2.2 release.
Hi,
Please help me,
I have face the same issue also in the apktool version 2.2.2.
C:\Windows>apktool d ab.apk
I: Using Apktool 2.2.2 on ab.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: file must be a directory: ab
at brut.androlib.res.AndrolibResources.decodeManifestWithResources(AndrolibResources.java:225)
at brut.androlib.Androlib.decodeManifestWithResources(Androlib.java:136)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:106)
at brut.apktool.Main.cmdDecode(Main.java:166)
at brut.apktool.Main.main(Main.java:81)
Caused by: brut.directory.DirectoryException: file must be a directory: app-release
at brut.directory.FileDirectory.
at brut.androlib.res.AndrolibResources.decodeManifestWithResources(AndrolibResources.java:205)
... 4 more
@kirit12 This is not the same issue. You don't have permission to create the folder app-release. Apktool by default decodes from app-release.apk to app-release folder. You can override this folder by using -o folder.
Hello @iBotPeaches
thanks for the answer. Actually, my computer has no permission to create any folder in C:\windows\ directory. so I just put into the other directory and then now it's work fine.
Thank you again.
Seems same exception on windows with apktool-2.2.3:
I: Using Apktool 2.2.3 on original.apk
I: Copying raw resources...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Copying assets and libs...
I: Copying unknown files...
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: Error copying file: ?? .xml
at brut.androlib.Androlib.decodeUnknownFiles(Androlib.java:218)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:165)
at brut.apktool.Main.cmdDecode(Main.java:166)
at brut.apktool.Main.main(Main.java:81)
Caused by: brut.directory.DirectoryException: Error copying file: ?? .xml
at brut.directory.DirUtil.copyToDir(DirUtil.java:88)
at brut.directory.AbstractDirectory.copyToDir(AbstractDirectory.java:208)
at brut.androlib.Androlib.decodeUnknownFiles(Androlib.java:211)
... 3 more
Caused by: java.io.FileNotFoundException: original\unknown\?? .xml (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at brut.directory.DirUtil.copyToDir(DirUtil.java:84)
... 5 more
the problem was resolved?! :(
It occurs on Windows boxes only. On my Linux box works okay.
SOLVED (Linux)
I hade the same prbolem with 2.3.1 version :
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: file must be a directory: app-debug
at brut.androlib.res.AndrolibResources.decodeManifestWithResources(AndrolibResources.java:227)
at brut.androlib.Androlib.decodeManifestWithResources(Androlib.java:137)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:122)
at brut.apktool.Main.cmdDecode(Main.java:163)
at brut.apktool.Main.main(Main.java:72)
Caused by: brut.directory.DirectoryException: file must be a directory: app-debug
at brut.directory.FileDirectory.<init>(FileDirectory.java:38)
at brut.androlib.res.AndrolibResources.decodeManifestWithResources(AndrolibResources.java:207)
... 4 more
i put jar file at /usr/local/bin/ as structure Install Instructions.
As i run jar file with root privilege , problem solved and deCompile folder created at /usr/local/bin/{APK_NAME}/
or you can locate jar file at apk path and run it with relative path
as @iBotPeaches commented the problem was for creating the result folder
I solved my problem by copying apktool.jar and apktool.bat to another directory except Windows folder
I had same issue with Mac and Windows
I: Using Apktool 2.3.2
brut.directory.DirectoryException: java.io.FileNotFoundException: build (ϵͳ�Ҳ���ָ�����ļ���)
Please help me, I rebuild apk from a folder and the folder is exist, I am sure the folder exist and can read & write , but i have this issue
In window:
apktool build C:\Users\xxx\desktop\ApktoolDex\apktool2.3.2\xxxx -o C:\Users\xxx\desktop\ApktoolDex\apktool2.3.2\xxxx.apk
The xxxx folder is decod xxxx.apk folder, then i want rebuild back, but failure
Firstly I used mac for recompiling, I solved filenotfound error just removing tilda sign infront of path. I explicitly wrote java -jar apktool.jar b path to decompiledFolder -o nameofoutput.apk
i facing this issue while decompiling
I: Using Apktool 2.4.0 on package.apk
I: Copying raw resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: Error copying file: res
at brut.androlib.Androlib.decodeResourcesRaw(Androlib.java:125)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:106)
at brut.apktool.Main.cmdDecode(Main.java:167)
at brut.apktool.Main.main(Main.java:76)
Caused by: brut.directory.DirectoryException: Error copying file: res
at brut.directory.DirUtil.copyToDir(DirUtil.java:91)
at brut.directory.DirUtil.copyToDir(DirUtil.java:68)
at brut.directory.AbstractDirectory.copyToDir(AbstractDirectory.java:203)
at brut.androlib.Androlib.decodeResourcesRaw(Androlib.java:123)
... 3 more
Caused by: brut.directory.DirectoryException: Error copying file: ? ?.xml
at brut.directory.DirUtil.copyToDir(DirUtil.java:88)
at brut.directory.DirUtil.copyToDir(DirUtil.java:61)
at brut.directory.AbstractDirectory.copyToDir(AbstractDirectory.java:198)
at brut.directory.DirUtil.copyToDir(DirUtil.java:77)
... 6 more
Caused by: java.io.FileNotFoundException: package\res\? ?.xml (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(Unknown Source)
at java.io.FileOutputStream.
at java.io.FileOutputStream.
at brut.directory.DirUtil.copyToDir(DirUtil.java:84)
... 9 more
Most helpful comment
@kirit12 This is not the same issue. You don't have permission to create the folder
app-release. Apktool by default decodes fromapp-release.apktoapp-releasefolder. You can override this folder by using-o folder.