bytecode-viewer icon indicating copy to clipboard operation
bytecode-viewer copied to clipboard

#77 Still happens

Open CallMeAlexO opened this issue 5 years ago • 19 comments

I opened an APK file, and everything worked well. Then I closed the app, tried to open recent - and this happened.

Bytecode Viewer Version: 2.9.16, Preview Copy: false, Fat Jar: true, OS: Windows 10, Java: 11.0.2

java.io.FileNotFoundException: C:\Users\XXXXXX.Bytecode-Viewer\bcv_temp\IaedBFpJFZQCpllSKCgOXlYiI.jar (The system cannot find the file specified) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:219) at java.base/java.io.FileInputStream.(FileInputStream.java:157) at the.bytecode.club.bytecodeviewer.util.JarUtils.loadClasses(JarUtils.java:98) at the.bytecode.club.bytecodeviewer.BytecodeViewer$6.run(BytecodeViewer.java:899)

CallMeAlexO avatar Apr 25 '19 10:04 CallMeAlexO

Thanks for the report! Could you tell me the exact name of the APK file?

Konloch avatar Apr 25 '19 15:04 Konloch

WeChat_v7.0.3_apkpure.com.apk

CallMeAlexO avatar Apr 25 '19 19:04 CallMeAlexO

This seems to be fixed in v2.9.18, would you be able to try out that version and let me know if it's fixed? (You'll most likely need to re-download that APK since that location is probably deleted)

Konloch avatar Apr 25 '19 21:04 Konloch

I have the same problem with the Huawei Health app in v2.9.17 and v2.9.18

Bytecode Viewer Version: 2.9.18, Preview Copy: false, Fat Jar: true, OS: Linux, Java: 1.8.0_171

java.io.FileNotFoundException: /home/fedora/.Bytecode-Viewer/bcv_temp/mQqyLsOtNLnqJvjnWzfvdDPGZ.jar (Datei oder Verzeichnis nicht gefunden)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at the.bytecode.club.bytecodeviewer.util.JarUtils.loadClasses(JarUtils.java:167)
	at the.bytecode.club.bytecodeviewer.BytecodeViewer$8.run(BytecodeViewer.java:940)

ckudera avatar Apr 25 '19 21:04 ckudera

I'll play around with the settings a bit more and see if I can trigger that error on my end, thanks for the report!

Konloch avatar Apr 25 '19 21:04 Konloch

Thank you for your fast replay and the effort :)

I can provide the apk if this helps with troubleshooting.

ckudera avatar Apr 25 '19 22:04 ckudera

That would definitely help if you could, cheers!

Konloch avatar Apr 25 '19 22:04 Konloch

It also happens with the current version on APK Mirror, therefore no upload is required: https://www.apkmirror.com/apk/huawei-internet-service/health/health-9-0-4-387-release/huawei-health-9-0-4-387-android-apk-download/

ckudera avatar Apr 25 '19 22:04 ckudera

Is your APK conversion currently set to Enjarify?

Konloch avatar Apr 25 '19 22:04 Konloch

No, dex2jar

ckudera avatar Apr 25 '19 22:04 ckudera

I've come across this issue as well. I basically can't import any APK file. I've tried with four distinct APKs, the same error message always shows up, none of them has been successfully loaded.

Here's the output I got from your program:

I: Using Apktool 2.3.0 on FEebUQBjXzUVSgBXuiWaMBbWgtazMfNt.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/user/.Bytecode-Viewer/bcv_temp/tWtejHiadCgc/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Copying raw classes.dex file...
I: Copying raw classes2.dex file...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
dex2jar /home/user/.Bytecode-Viewer/bcv_temp/FEebUQBjXzUVSgBXuiWaMBbWgtazMfNt.apk -> ./FEebUQBjXzUVSgBXuiWaMBbWgtazMfNt-dex2jar.jar
java.io.FileNotFoundException: /home/user/.Bytecode-Viewer/bcv_temp/vFTLbxOYXLdaZdtmeIKEfXdsZ.jar (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at the.bytecode.club.bytecodeviewer.util.JarUtils.loadClasses(JarUtils.java:156)
	at the.bytecode.club.bytecodeviewer.BytecodeViewer$6.run(BytecodeViewer.java:906)

apktool stage works properly however when it comes to dex2jar, it seems like you're opening a JAR file which doesn't actually exist on filesystem — not the one outputted by dex2jar.

I'm running the latest version (2.9.18) on Arch Linux. I hope it would be useful for bug fixing.

bla5r avatar May 03 '19 16:05 bla5r

same problem on windows x64 too

0x410c avatar Mar 20 '20 10:03 0x410c

I also get this error when opening the apk from the third challenge of FLARE-ON challenge 6 on Windows 7:

Bytecode Viewer Version: 2.9.22, Preview Copy: false, Fat Jar: true, OS: Windows 7, Java: 1.8.0_251

java.io.FileNotFoundException: C:\Users\user\.Bytecode-Viewer\bcv_temp\NVDnkKznBGOfzfRzaoZiLCKoE.jar (The system cannot find the file specified)
     at java.io.FileInputStream.open0(Native Method)
     at java.io.FileInputStream.open(Unknown Source)
     at java.io.FileInputStream.<init>(Unknown Source)
     at the.bytecode.club.bytecodeviewer.util.JarUtils.loadClasses(JarUtils.java:168)
     at the.bytecode.club.bytecodeviewer.BytecodeViewer$8.run(BytecodeViewer.java:961)

Opening Bytecode Viewer from a cmd run as administrator I was able to open the apk:

java -j pat-to-Bytecode-Viewer-2.9.22.jar

The solution to run it as administrator was proposed in this issue (which seems to be a duplicate): https://github.com/Konloch/bytecode-viewer/issues/234#issuecomment-583807184

Ana06 avatar May 26 '20 08:05 Ana06

I have not looked in more detail into this issue but it seems to be related to the working directory (cf. #267).

At least in Kali Linux bytecode-viewer is started by the following script:

#!/bin/sh

set -e

cd /usr/share/bytecode-viewer/
exec java -jar Bytecode-Viewer-2.9.22.jar "$@"

Since this sets the working directory to /usr/share/bytecode-viewer/ bytecode-viewer probably tries to store files in this directory which is only allowed by root. Instead starting bytecode-viewer from the home directory with java -jar /usr/share/bytecode-viewer/Bytecode-Viewer-2.9.22.jar worked for me.

ddast avatar Jun 18 '20 08:06 ddast

2.9.22 and 2.9.20

Bytecode Viewer Version: 2.9.22, Preview Copy: false, Fat Jar: true, OS: Windows 10, Java: 1.8.0_111

java.io.FileNotFoundException: C:\Users\myPC\.Bytecode-Viewer\bcv_temp\FzOmDNhvVJzdzcvVycXjkCDRo.jar (The system cannot find the file specified)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(Unknown Source)
	at java.io.FileInputStream.<init>(Unknown Source)
	at the.bytecode.club.bytecodeviewer.util.JarUtils.loadClasses(JarUtils.java:168)
	at the.bytecode.club.bytecodeviewer.BytecodeViewer$8.run(BytecodeViewer.java:961)

oatmeal01 avatar Oct 02 '20 22:10 oatmeal01

Also happens on Mac

Bytecode Viewer Version: 2.9.22, Preview Copy: false, Fat Jar: true, OS: Mac OS X, Java: 1.8.0_231

java.io.FileNotFoundException: /Users/jason/.Bytecode-Viewer/bcv_temp/JMhdUhCPcZLKArVaPmVWHJJlf.jar (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at the.bytecode.club.bytecodeviewer.util.JarUtils.loadClasses(JarUtils.java:168)
	at the.bytecode.club.bytecodeviewer.BytecodeViewer$8.run(BytecodeViewer.java:961)

jaytj95 avatar Jun 16 '21 18:06 jaytj95

Hopefully https://github.com/Konloch/bytecode-viewer/releases/tag/v2.10.12 solves it

Konloch avatar Jun 29 '21 18:06 Konloch

Hopefully https://github.com/Konloch/bytecode-viewer/releases/tag/v2.10.12 solves it

No, it does not :(

But I do not know if it is caused by this actually:

java.lang.SecurityException: BCV is awesome! Blocking exec: C:\Program Files\Python39\python.exe at the.bytecode.club.bytecodeviewer.util.SecurityMan.checkExec(SecurityMan.java:155) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1096) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071) at the.bytecode.club.bytecodeviewer.util.Enjarify.apk2Jar(Enjarify.java:61) at the.bytecode.club.bytecodeviewer.resources.importing.impl.DEXResourceImporter.open(DEXResourceImporter.java:36) at the.bytecode.club.bytecodeviewer.resources.importing.ImportResource.importKnownFile(ImportResource.java:90) at the.bytecode.club.bytecodeviewer.resources.importing.ImportResource.run(ImportResource.java:62) at java.base/java.lang.Thread.run(Thread.java:834)

I have no Idea why the SecurityManager is blocking this command? But then follows: java.io.FileNotFoundException: C:\Users\JonDoe\.Bytecode-Viewer\bcv_temp\ZbtbKXPeyEOkCWZXHyivnJnJR.jar (Das System kann die angegebene Datei nicht finden) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:219) at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157) at the.bytecode.club.bytecodeviewer.resources.ResourceContainerImporter.importZipInputStream(ResourceContainerImporter.java:151) at the.bytecode.club.bytecodeviewer.resources.ResourceContainerImporter.importAsZip(ResourceContainerImporter.java:74) at the.bytecode.club.bytecodeviewer.resources.importing.impl.DEXResourceImporter.open(DEXResourceImporter.java:40) at the.bytecode.club.bytecodeviewer.resources.importing.ImportResource.importKnownFile(ImportResource.java:90) at the.bytecode.club.bytecodeviewer.resources.importing.ImportResource.run(ImportResource.java:62) at java.base/java.lang.Thread.run(Thread.java:834) java.nio.file.NoSuchFileException: C:\Users\JonDoe\.Bytecode-Viewer\bcv_temp\ZbtbKXPeyEOkCWZXHyivnJnJR.jar at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:235) at java.base/java.nio.file.Files.newByteChannel(Files.java:371) at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:261) at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:230) at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:213) at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:174) at the.bytecode.club.bytecodeviewer.resources.ResourceContainerImporter.importApacheZipFile(ResourceContainerImporter.java:176) at the.bytecode.club.bytecodeviewer.resources.ResourceContainerImporter.importAsZip(ResourceContainerImporter.java:81) at the.bytecode.club.bytecodeviewer.resources.importing.impl.DEXResourceImporter.open(DEXResourceImporter.java:40) at the.bytecode.club.bytecodeviewer.resources.importing.ImportResource.importKnownFile(ImportResource.java:90) at the.bytecode.club.bytecodeviewer.resources.importing.ImportResource.run(ImportResource.java:62) at java.base/java.lang.Thread.run(Thread.java:834)

leo-stone avatar Jul 22 '21 10:07 leo-stone

Hi, the security manager was just recently changed in v2.10.14, try v2.10.13 instead, I will fix the security manager and push a v2.10.15 soon

In the mean time select Settings>APK Decoding>Dex2Jar as a work around for the security manager issue.

It is unrelated to #227 though as I introduced this with the security manager changes

Konloch avatar Jul 22 '21 12:07 Konloch