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

jadx: init at 0.9.0 #58232

Closed
wants to merge 3 commits into from
Closed

jadx: init at 0.9.0 #58232

wants to merge 3 commits into from

Conversation

artemist
Copy link
Member

Motivation for this change

jadx is a Java decompiler which is more modern than the current jd-gui and supports Android. It's an important part of my, and many other people's ,Android and Java reverse engineering toolkit

Things done

Create the new jadx package. If you would like me to replace occurrences of 'jadx-bin' with jadx or vice versa, I can do so.

I made this package the existing binaries and scripts, as there are some rather annoying requirements about specific JARs to load into the classpath and variables to accept for compatibility. Additionally, I could not make a binary package because I had problems getting gradle to cache the compiler plugins necessary for build (using the same format as the jd-gui package). I could do this with an output sha256 on the main derivation and keep gradle in online mode, but that still seems very shady.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@veprbl
Copy link
Member

veprbl commented Apr 11, 2019

This doesn't build:

fixed-output derivation produced path '/nix/store/akm8d6sib5bj8vh22a7b5l942g217jdr-jadx-0.9.0.zip' with sha256 hash '07r2ahl31ys0492d0p2z5yg5vwk8impdd8j7ld7nr5h066388rij' instead of the expected hash '00yi5gfnz0zxkc4v405w5b8sg0x4xb2q5cai0v1gz2yzd7q9vx6j'
cannot build derivation '/nix/store/bbqjlhg4kxibigl6qrykh8vsm9aw08wl-jadx-bin-0.9.0.drv': 1 dependencies couldn't be built

@artemist
Copy link
Member Author

I'm not sure what that error is from, it could be on your end? I ran nix-prefetch-url again and got the same hash.

@veprbl
Copy link
Member

veprbl commented Apr 13, 2019

@artemist
I run nix-prefetch from three different machines from different parts of the world and get

 % nix-prefetch-url "https://github.com/skylot/jadx/archive/v0.9.0/jadx-0.9.0.zip"
path is '/nix/store/akm8d6sib5bj8vh22a7b5l942g217jdr-jadx-0.9.0.zip'
07r2ahl31ys0492d0p2z5yg5vwk8impdd8j7ld7nr5h066388rij

@veprbl
Copy link
Member

veprbl commented Apr 13, 2019

@GrahamcOfBorg build jadx

@aanderse
Copy link
Member

aanderse commented May 6, 2019

@artemist Can you please try setting the hash to what the bot mentioned (07r2ahl31ys0492d0p2z5yg5vwk8impdd8j7ld7nr5h066388rij) and hopefully we'll see if there are any lurking issues?

};

src = fetchurl {
url = "https://github.com/skylot/jadx/archive/v${version}/jadx-${version}.zip";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This url doesn't work for me, it downloads the sources archive instead. I had to change it to https://github.com/skylot/jadx/releases/download/v${version}/jadx-${version}.zip which downloads the binary archive and matches the hash.

I've noticed with nix that if you change the url but not the hash it will continue to use the previous source associated with that hash (issue #969). This would explain why it can build successfully for you with that url.

@veprbl
Copy link
Member

veprbl commented May 6, 2019

@GrahamcOfBorg build jadx

@veprbl
Copy link
Member

veprbl commented Dec 27, 2019

@artemist Are you still interested in adding jadx to nixpkgs?

@artemist
Copy link
Member Author

@veprbl Not currently. I would like to add jadx eventually (or have someone else do it), but I have very little time to do so. I'll close this, then anyone else can add jadx if they would like.

@artemist artemist closed this Dec 27, 2019
@veprbl veprbl mentioned this pull request Mar 31, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants