-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
360 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
lib, | ||
buildEnv, | ||
fetchurl, | ||
jre, | ||
writeShellScriptBin, | ||
}: | ||
|
||
let | ||
pname = "apkeditor-bin"; | ||
version = "1.4.1"; | ||
|
||
jar = fetchurl { | ||
url = "https://github.com/REAndroid/APKEditor/releases/download/V${version}/APKEditor-${version}.jar"; | ||
hash = "sha256-SpiuanVSZDV2A/GQa5LmLnV9WSKQFOMzlfTgP/AZ/ag="; | ||
}; | ||
in | ||
buildEnv { | ||
name = "${pname}-${version}"; | ||
|
||
paths = [ | ||
(writeShellScriptBin "APKEditor" '' | ||
exec ${lib.getExe jre} -jar ${jar} "$@" | ||
'') | ||
]; | ||
|
||
meta = { | ||
description = "Powerful android apk resources editor"; | ||
maintainers = with lib.maintainers; [ ulysseszhan ]; | ||
license = lib.licenses.asl20; | ||
platforms = lib.platforms.all; | ||
homepage = "https://github.com/REAndroid/APKEditor"; | ||
mainProgram = "APKEditor"; | ||
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
fetchFromGitHub, | ||
gradle, | ||
lib, | ||
REAndroidLibrary, | ||
}: | ||
|
||
let | ||
self = REAndroidLibrary { | ||
pname = "arsclib"; | ||
# 1.3.5 is not new enough for APKEditor because of API changes | ||
version = "1.3.5-unstable-2024-10-21"; | ||
projectName = "ARSCLib"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "REAndroid"; | ||
repo = "ARSCLib"; | ||
# This is the latest commit at the time of packaging | ||
rev = "ed6ccf00e56d7cce13e8648ad46a2678a6093248"; | ||
hash = "sha256-jzd7xkc4O+P9hlGsFGGl2P3pqVvV5+mDyKTRUuGfFSA="; | ||
}; | ||
|
||
mitmCache = gradle.fetchDeps { | ||
pkg = self; | ||
data = ./deps.json; | ||
}; | ||
|
||
meta.license = lib.licenses.asl20; | ||
}; | ||
in | ||
self |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
fetchFromGitHub, | ||
gradle, | ||
lib, | ||
REAndroidLibrary, | ||
}: | ||
|
||
let | ||
self = REAndroidLibrary { | ||
pname = "jcommand"; | ||
version = "2024-09-20"; | ||
projectName = "JCommand"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "REAndroid"; | ||
repo = "JCommand"; | ||
rev = "714b6263c28dabb34adc858951cf4bc60d6c3fed"; | ||
hash = "sha256-6Em+1ddUkZBCYWs88qtfeGnxISZchFrHgDL8fsgZoQg="; | ||
}; | ||
|
||
mitmCache = gradle.fetchDeps { | ||
pkg = self; | ||
data = ./deps.json; | ||
}; | ||
|
||
meta.license = lib.licenses.asl20; | ||
}; | ||
in | ||
self |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
fetchFromGitHub, | ||
callPackage, | ||
|
||
jre, | ||
gradle_6, | ||
makeWrapper, | ||
}: | ||
|
||
let | ||
gradle = gradle_6; | ||
REAndroidLibrary = | ||
args: | ||
let | ||
inherit (args) pname version projectName; | ||
outJar = "share/${projectName}/${projectName}.jar"; | ||
self = stdenv.mkDerivation ( | ||
{ | ||
__darwinAllowLocalNetworking = true; | ||
|
||
buildInputs = [ jre ]; | ||
nativeBuildInputs = [ gradle ]; | ||
|
||
gradleFlags = [ "-Dfile.encoding=utf-8" ]; | ||
gradleBuildTask = "jar"; | ||
doCheck = true; | ||
|
||
inherit outJar; | ||
installPhase = '' | ||
runHook preInstall | ||
install -Dm644 build/libs/*.jar $out/${outJar} | ||
runHook postInstall | ||
''; | ||
} | ||
// args | ||
// { | ||
meta = { | ||
sourceProvenance = with lib.sourceTypes; [ | ||
fromSource | ||
binaryBytecode # mitm cache | ||
]; | ||
} // args.meta; | ||
} | ||
); | ||
in | ||
self; | ||
|
||
arsclib = callPackage ./arsclib { inherit gradle REAndroidLibrary; }; | ||
smali = callPackage ./smali { inherit gradle REAndroidLibrary; }; | ||
jcommand = callPackage ./jcommand { inherit gradle REAndroidLibrary; }; | ||
|
||
apkeditor = | ||
let | ||
pname = "apkeditor"; | ||
version = "1.4.1"; | ||
projectName = "APKEditor"; | ||
in | ||
REAndroidLibrary { | ||
inherit pname version projectName; | ||
|
||
# When you need to update **/deps.json for the dependencies (e.g. for smali), | ||
# uncomment the following line and run `nix build apkeditor.smali.mitmCache.updateScript`. | ||
|
||
# inherit arsclib smali jcommand; | ||
|
||
src = fetchFromGitHub { | ||
owner = "REAndroid"; | ||
repo = "APKEditor"; | ||
rev = "V${version}"; | ||
hash = "sha256-a72j9qGjJXnTFeqLez2rhBSArFVYCX+Xs7NQd8CY5Yk="; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
gradle | ||
makeWrapper | ||
]; | ||
|
||
gradleBuildTask = "fatJar"; | ||
|
||
preConfigure = '' | ||
ln -sf ${arsclib}/${arsclib.outJar} libs/ARSCLib.jar | ||
ln -sf ${smali}/${smali.outJar} libs/smali.jar | ||
ln -sf ${jcommand}/${jcommand.outJar} libs/JCommand.jar | ||
''; | ||
|
||
postInstall = '' | ||
mkdir -p $out/bin | ||
makeWrapper ${lib.getExe jre} $out/bin/APKEditor \ | ||
--add-flags "-jar $out/${apkeditor.outJar}" | ||
''; | ||
|
||
meta = { | ||
description = "Powerful android apk resources editor"; | ||
maintainers = with lib.maintainers; [ ulysseszhan ]; | ||
license = lib.licenses.asl20; | ||
platforms = lib.platforms.all; | ||
mainProgram = "APKEditor"; | ||
}; | ||
}; | ||
in | ||
apkeditor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
fetchFromGitHub, | ||
gradle, | ||
lib, | ||
REAndroidLibrary, | ||
}: | ||
|
||
let | ||
self = REAndroidLibrary { | ||
pname = "smali"; | ||
version = "2024-10-15"; | ||
projectName = "smali"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "REAndroid"; | ||
repo = "smali-lib"; | ||
rev = "c781eafb31f526abce9fdf406ce2c925fec20d28"; | ||
hash = "sha256-6tkvikgWMUcKwzsgbfpxlB6NZBAlZtTE34M3qPQw7Y4="; | ||
}; | ||
|
||
mitmCache = gradle.fetchDeps { | ||
pkg = self; | ||
data = ./deps.json; | ||
}; | ||
gradleBuildTask = "build"; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
install -Dm644 smali/build/libs/*-fat.jar $out/${self.outJar} | ||
runHook postInstall | ||
''; | ||
|
||
# https://github.com/JesusFreke/smali/blob/master/NOTICE | ||
meta.license = with lib.licenses; [ | ||
asl20 | ||
free | ||
]; | ||
}; | ||
in | ||
self |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.