2
2
# SPDX-License-Identifier: MIT
3
3
4
4
# 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 ,
7
16
domain ? "example.org" ,
8
17
applicationName ? "Robotnix Auditor" ,
9
18
applicationId ? "org.robotnix.auditor" ,
10
19
signatureFingerprint ? "" , # Signature that this app will be signed by.
11
20
device ? "" ,
12
- avbFingerprint ? ""
21
+ avbFingerprint ? "" ,
13
22
} :
14
23
let
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 { } ;
17
33
supportedDevices = import ./supported-devices.nix ;
18
34
in
19
35
buildGradle rec {
@@ -31,12 +47,16 @@ buildGradle rec {
31
47
32
48
patches = [
33
49
# 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
+ ) )
40
60
41
61
# TODO: Ugly downgrades due to not being able to update to gradle 7.0.2, since its not working with gradle2nix
42
62
./build-hacks.patch
0 commit comments