Skip to content

Commit

Permalink
chore: add sign config
Browse files Browse the repository at this point in the history
Signed-off-by: Haruue Icymoon <[email protected]>
  • Loading branch information
haruue committed Jul 10, 2018
1 parent 6c039c6 commit 3c5a89e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Jetbrains IDE
*.iml
*.log
/.idea

# Gradle
.gradle
/local.properties
/.idea/
.DS_Store

# Android
/build
/captures
.externalNativeBuild
signing.properties
*.apk
/.release
25 changes: 25 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@ android {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "boolean", "FAKE_OPERATE_MODE", "false" // set it true to prevent restart adbd for DEBUG
}
signingConfigs {
sign
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
debug {
signingConfig signingConfigs.sign
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.sign
}
}
productFlavors {
Expand All @@ -39,3 +46,21 @@ dependencies {
implementation 'moe.haruue:haruueutils:1.1.1-preview'
implementation 'com.github.topjohnwu:libsu:1.1.1'
}


def signFile = rootProject.file('signing.properties')
def signProps = new Properties()
if (signFile.canRead()) {
signProps.load(new FileInputStream(signFile))
if (signProps != null) {
android.signingConfigs.sign.storeFile file(signProps['KEYSTORE_FILE'])
android.signingConfigs.sign.storePassword signProps['KEYSTORE_PASSWORD']
android.signingConfigs.sign.keyAlias signProps['KEYSTORE_ALIAS']
android.signingConfigs.sign.keyPassword signProps['KEYSTORE_ALIAS_PASSWORD']
} else {
println 'some entries in \'signing.properties\' not found!'
}
} else {
println '\'signing.properties\' not found!'
}

0 comments on commit 3c5a89e

Please sign in to comment.