1
+ import groovy.swing.SwingBuilder
1
2
apply plugin : ' android'
2
3
3
4
android {
4
5
compileSdkVersion 19
5
6
buildToolsVersion ' 19.0.3'
6
7
7
8
defaultConfig {
8
- minSdkVersion 16
9
+ minSdkVersion 14
9
10
targetSdkVersion 19
10
11
}
11
12
13
+ signingConfigs {
14
+ debug {
15
+ storeFile file(" /path/to/keystore/file" )
16
+ }
17
+ release {
18
+ storeFile file(" /path/to/keystore/file" )
19
+ keyAlias " keyAlias"
20
+ storePassword " "
21
+ keyPassword " "
22
+ }
23
+ }
12
24
buildTypes {
13
25
release {
26
+ signingConfig signingConfigs. release
27
+ debuggable false
14
28
runProguard false
15
29
proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.txt'
16
30
}
17
31
}
32
+ lintOptions {
33
+ abortOnError false
34
+ }
18
35
}
19
36
20
37
dependencies {
@@ -25,3 +42,44 @@ dependencies {
25
42
compile ' com.android.support:support-v4:+'
26
43
compile ' com.github.codechimp-org.apprater:library:1.0.+'
27
44
}
45
+
46
+ gradle. taskGraph. whenReady { taskGraph ->
47
+ if (taskGraph. hasTask(' :Voice Control For Plex:assembleRelease' )) {
48
+
49
+ def pass = ' '
50
+ if (System . console() == null ) {
51
+ new SwingBuilder (). edt {
52
+ dialog(modal : true , // Otherwise the build will continue running before you closed the dialog
53
+ title : ' Enter password' , // Dialog title
54
+ alwaysOnTop : true , // pretty much what the name says
55
+ resizable : false , // Don't allow the user to resize the dialog
56
+ locationRelativeTo : null , // Place dialog in center of the screen
57
+ pack : true , // We need to pack the dialog (so it will take the size of it's children)
58
+ show : true // Let's show it
59
+ ) {
60
+ vbox { // Put everything below each other
61
+ label(text : " !Please enter key passphrase:" )
62
+ input = passwordField()
63
+ button(defaultButton : true , text : ' OK' , actionPerformed : {
64
+ pass = new String (input. password); // Set pass variable to value of input field
65
+ dispose(); // Close dialog
66
+ })
67
+ } // vbox end
68
+ } // dialog end
69
+ } // edt end
70
+ } else {
71
+ pass = System . console(). readPassword(" \n Please enter key passphrase: " )
72
+ pass = new String (pass)
73
+ }
74
+
75
+ if (pass. size() <= 0 ) {
76
+ throw new InvalidUserDataException (" You must enter a password to proceed." )
77
+ }
78
+
79
+ // -----
80
+ // Do what you need to do with pass here!
81
+ // -----
82
+ android. signingConfigs. release. storePassword = pass;
83
+ android. signingConfigs. release. keyPassword = pass;
84
+ } // end if has task
85
+ } // end whenReady
0 commit comments