22# SPDX-License-Identifier: MIT
33
44# https://www.reddit.com/r/GrapheneOS/comments/bpcttk/avb_key_auditor_app/
5- { callPackage , lib , stdenv , pkgs , substituteAll , fetchFromGitHub ,
6- androidPkgs , jdk11_headless , gradle , gradleToNixPatchedFetchers ,
5+ {
6+ callPackage ,
7+ lib ,
8+ stdenv ,
9+ pkgs ,
10+ substituteAll ,
11+ fetchFromGitHub ,
12+ androidPkgs ,
13+ jdk11_headless ,
14+ gradle ,
15+ gradleToNixPatchedFetchers ,
716 domain ? "example.org" ,
817 applicationName ? "Robotnix Auditor" ,
918 applicationId ? "org.robotnix.auditor" ,
1019 signatureFingerprint ? "" , # Signature that this app will be signed by.
1120 device ? "" ,
12- avbFingerprint ? ""
21+ avbFingerprint ? "" ,
1322} :
1423let
15- androidsdk = androidPkgs . sdk ( p : with p ; [ cmdline-tools-latest platform-tools platforms-android-30 build-tools-30-0-3 ] ) ;
16- buildGradle = callPackage ./gradle-env.nix { } ;
24+ androidsdk = androidPkgs . sdk (
25+ p : with p ; [
26+ cmdline-tools-latest
27+ platform-tools
28+ platforms-android-30
29+ build-tools-30-0-3
30+ ]
31+ ) ;
32+ buildGradle = callPackage ./gradle-env.nix { } ;
1733 supportedDevices = import ./supported-devices.nix ;
1834in
1935buildGradle rec {
@@ -31,12 +47,16 @@ buildGradle rec {
3147
3248 patches = [
3349 # TODO: Enable support for passing multiple device fingerprints
34- ( substituteAll ( {
35- src = ./customized-auditor.patch ;
36- inherit domain applicationName applicationId ;
37- signatureFingerprint = lib . toUpper signatureFingerprint ;
38- }
39- // lib . genAttrs supportedDevices ( d : if ( device == d ) then avbFingerprint else "DISABLED_CUSTOM_${ d } " ) ) )
50+ ( substituteAll (
51+ {
52+ src = ./customized-auditor.patch ;
53+ inherit domain applicationName applicationId ;
54+ signatureFingerprint = lib . toUpper signatureFingerprint ;
55+ }
56+ // lib . genAttrs supportedDevices (
57+ d : if ( device == d ) then avbFingerprint else "DISABLED_CUSTOM_${ d } "
58+ )
59+ ) )
4060
4161 # TODO: Ugly downgrades due to not being able to update to gradle 7.0.2, since its not working with gradle2nix
4262 ./build-hacks.patch
0 commit comments