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

Workaround for various problems #67

Open
ts-stevem opened this issue Feb 12, 2021 · 0 comments
Open

Workaround for various problems #67

ts-stevem opened this issue Feb 12, 2021 · 0 comments

Comments

@ts-stevem
Copy link

ts-stevem commented Feb 12, 2021

For others attempting to use this project

TL;DR
Just need to do a couple of steps to use this project

  • Compile the project
  • Add package to filters json file

Make gradlew executable and build/compile the git repo e.g.

apk-dependency-graph$ chmod a+x gradlew
apk-dependency-graph$ ./gradlew build

Edit filters/default.json and add your package name (not optional!)

apk-dependency-graph/filters$ cp default.json custom.json
apk-dependency-graph/filters$ vim custom.json 

Then edit the file so it resembles:

{
    "package-name": "com.example.myproject",
    ...

Once that's done should be ready to run the command, make sure to use the copied custom.json file e.g.

apk-dependency-graph$ ./run.sh .../myproject/main/build/outputs/apk/debug/main-debug.apk filters/custom.json

Details
First, releases may not work; very likely the version the release was built against is incompatible with whatever version is on local workstation*. That error will typically resemble

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/alex_zaitsev/adg/Main 
has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version 
of the Java Runtime only recognizes class file versions up to 52.0

Also, cloning the repo won't work out-of-the-box; it will be necessary to compile in order to generate required file build/libs/apk-dependency-graph.jar, otherwise will see error typ.

Error: Unable to access jarfile .../apk-dependency-graph/build/libs/apk-dependency-graph.jar

Finally, it will be necessary to add package-name to filters/default.json otherwise will fail typ.

'package-name' option cannot be empty. Check filters/default.json

*Yes, it is possible to attempt to address the disparity by mucking around with downloading and installing various JDK versions, but that can result in strange behavior changes on workstation...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant