Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] jadx at master outputs "INFO - loading ..." and then returns, 1.2.0 does more #1150

Closed
carstenhag opened this issue Apr 15, 2021 · 4 comments
Labels
bug Core Issues in jadx-core module

Comments

@carstenhag
Copy link

carstenhag commented Apr 15, 2021

Describe error
Installed jadx via brew install jadx --HEAD. Via brew install jadx, which installs 1.2.0, it at least does more than that (still has 56 errors but thats ok for now).

$jadx -d enbw-app-jadx com.enbw.ev_6.9.0.apk
INFO  - loading ...
$ jadx -v -d enbw-app-jadx/ com.enbw.ev_6.9.0.apk
DEBUG - Loaded plugin: SmaliInput
DEBUG - Loaded plugin: JavaConvert
DEBUG - Loaded plugin: DexInput
DEBUG - Effective jadx args: JadxArgs{inputFiles=[com.enbw.ev_6.9.0.apk], outDir=enbw-app-jadx, outDirSrc=enbw-app-jadx/sources, outDirRes=enbw-app-jadx/resources, threadsCount=6, cfgOutput=false, rawCFGOutput=false, fallbackMode=false, showInconsistentCode=false, useImports=true, skipResources=false, skipSources=false, deobfuscationOn=false, deobfuscationMapFile=null, deobfuscationForceSave=false, useSourceNameAsClassAlias=false, parseKotlinMetadata=false, deobfuscationMinLength=3, deobfuscationMaxLength=64, escapeUnicode=false, replaceConsts=true, respectBytecodeAccModifiers=false, exportAsGradleProject=false, fsCaseSensitive=false, renameFlags=[CASE, VALID, PRINTABLE], outputFormat=JAVA, codeCache=NoOpCodeCache, codeWriter=SimpleCodeWriter}
INFO  - loading ...

The app is com.enbw.ev, uploading it to APKMirror atm, but it's not available there yet. It's too big for Github.

@carstenhag carstenhag added Core Issues in jadx-core module bug labels Apr 15, 2021
@carstenhag carstenhag changed the title [core] jadx at master returns only "INFO - loading ..." and then returns, 1.2.0 works fine [core] jadx at master outputs "INFO - loading ..." and then returns, 1.2.0 works fine Apr 15, 2021
@carstenhag carstenhag changed the title [core] jadx at master outputs "INFO - loading ..." and then returns, 1.2.0 works fine [core] jadx at master outputs "INFO - loading ..." and then returns, 1.2.0 does more Apr 15, 2021
@skylot
Copy link
Owner

skylot commented Apr 18, 2021

@carstenhag I tried apk from here (version 6.9.0) but can't reproduce your issue. Can you check if this a correct apk?

@carstenhag
Copy link
Author

carstenhag commented Apr 18, 2021

Doesn't seem to be the same

shasum -a 256 EnBW\ mobility\ Compare\ Charge\ Electric\ Cars_v6.9.0_apkpure.com.apk
80d077ad3272327403368bebd7ac8fcd582b95ff05330b51702963914e317215  EnBW mobility Compare Charge Electric Cars_v6.9.0_apkpure.com.apk
shasum -a 256 com.enbw.ev_6.9.0.apk
c655f1848cd8f427a9f24e10297a9900aef87d545b5fd97b9f30e30f64ffd9b8  com.enbw.ev_6.9.0.apk

but I can reproduce the issue with both APKs on my Mac. Here's the apk: https://drive.google.com/file/d/1uPSYKdwZNRh1idof4uwo6pwYBD_Jz1X-/view?usp=sharing

On my Windows machine, on both APKs jadx @ master works fine, so it must be something mac- or jdk-specific. I'll try to write down some info about my machines

macOS Big Sur 11.2.3 (20D91)
Intel i5

brew install jadx --HEAD
==> Downloading https://github.com/downloads/stephanenicolas/RoboDemo/robodemo-sample-1.0.1.apk
Already downloaded: /Users/carstenh/Library/Caches/Homebrew/downloads/9e97eda5f0f966eaed18404623c0f08b106f42d16cd62f229be050c385a3b3f8--robodemo-sample-1.0.1.apk
==> Cloning https://github.com/skylot/jadx.git
Updating /Users/carstenh/Library/Caches/Homebrew/jadx--git
From https://github.com/skylot/jadx
   e8f57d3..c52c659  master     -> origin/master
==> Checking out branch master
Already on 'master'
Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
HEAD is now at c52c659 fix: correct inline flag for variables used in anonymous classes (#1154)
==> gradle clean dist
🍺  /usr/local/Cellar/jadx/HEAD-c52c659: 53 files, 18.5MB, built in 31 seconds
Removing: /Users/carstenh/Library/Caches/Homebrew/jadx--1.2.0.zip... (14.7MB)


$JAVA_HOME
/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home (should be a patched jdk8 for IntelliJ I believe)
Win10 Pro version 1909

$ java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (Zulu 8.52.0.23-CA-win64) (build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (Zulu 8.52.0.23-CA-win64) (build 25.282-b08, mixed mode)

jadx built from source at c52c659b9464ccbbb1cf23f01f92a3d59097130e

./jadx -d out --deobf "D:\Downloads\com.enbw.ev_6.9.0.apk"

@winrg
Copy link

winrg commented May 19, 2022

Encountered this same issue, fixed it by changing JVM versions. Try running with Java 11.

skylot added a commit that referenced this issue May 19, 2022
Thrown java.lang.Error was ignored and not logged.
@skylot
Copy link
Owner

skylot commented May 19, 2022

Ok, this time I am managed to find a way to reproduce this issue and made a fix.
To reproduce jadx should be build using java 11 and next executed with java 8. Doing so we will use not compatible classpaths and got a NoSuchMethodError:

ERROR - Process error:
java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
	at jadx.plugins.input.dex.sections.SectionReader.duplicate(SectionReader.java:60)

But because of incorrect handle of errors in jadx-cli java.lang.Error exception was ignored and not logged. I commit a fix for that.
So now jadx will show usable error, and it will be easier to understand what is going wrong.

Anyway, I recommend always use the latest java version. Or at least try to not mix compile and runtime java versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module
Projects
None yet
Development

No branches or pull requests

3 participants