Merge branch 'fdroid-add-release-signature' into 'master'

Add a release signature for fdroid apks

See merge request ChristianPauly/fluffychat-flutter!1
This commit is contained in:
Marcel 2020-01-02 23:15:12 +00:00
commit ac0c411b7a
5 changed files with 38 additions and 6 deletions

4
.gitignore vendored
View File

@ -36,3 +36,7 @@ lib/generated_plugin_registrant.dart
# Exceptions to above rules. # Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
/key.jks
/android/key.properties

View File

@ -28,9 +28,14 @@ build_web:
- build/web/ - build/web/
build_android: build_android_fdroid:
stage: coverage stage: coverage
script: script:
- cd android && echo $FDROID_KEY | base64 --decode --ignore-garbage > key.jks && cd ..
- cd android && echo "storePassword=${FDROID_KEY_PASS}" >> key.properties && cd ..
- cd android && echo "keyPassword=${FDROID_KEY_PASS}" >> key.properties && cd ..
- cd android && echo "keyAlias=key" >> key.properties && cd ..
- cd android && echo "storeFile=../key.jks" >> key.properties && cd ..
- flutter build apk --release - flutter build apk --release
artifacts: artifacts:
when: on_success when: on_success

View File

@ -25,6 +25,12 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android { android {
compileSdkVersion 28 compileSdkVersion 28
@ -37,7 +43,6 @@ android {
} }
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "chat.fluffy.fluffychat" applicationId "chat.fluffy.fluffychat"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 28 targetSdkVersion 28
@ -46,11 +51,21 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes { buildTypes {
release { release {
// TODO: Add your own signing config for the release build. signingConfig signingConfigs.release
// Signing with the debug keys for now, so `flutter run --release` works. minifyEnabled true
signingConfig signingConfigs.debug useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
} }

View File

@ -8,7 +8,7 @@
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<application <application
android:name="io.flutter.app.FlutterApplication" android:name="io.flutter.app.FlutterApplication"
android:label="fluffychat" android:label="FluffyChat"
android:icon="@mipmap/launcher_icon"> android:icon="@mipmap/launcher_icon">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"

8
android/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,8 @@
## Flutter wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn io.flutter.embedding.**