mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Allow users to register via the app
This commit is contained in:
@@ -25,12 +25,35 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
// Keys for the android play store
|
||||
def keystoreProperties = new Properties()
|
||||
def keystorePropertiesFile = rootProject.file('app/key.properties')
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
// Key for wger.de REST API
|
||||
def wgerProperties = new Properties()
|
||||
def localMapsPropertiesFile = rootProject.file('app/wger.properties')
|
||||
if (localMapsPropertiesFile.exists()) {
|
||||
project.logger.info('Load maps properties from local file')
|
||||
localMapsPropertiesFile.withReader('UTF-8') { reader ->
|
||||
wgerProperties.load(reader)
|
||||
}
|
||||
} else {
|
||||
project.logger.info('Load maps properties from environment')
|
||||
try {
|
||||
wgerProperties['WGER_API_KEY'] = System.getenv('WGER_API_KEY')
|
||||
} catch(NullPointerException e) {
|
||||
project.logger.warn('Failed to load WGER_API_KEY from environment.', e)
|
||||
}
|
||||
}
|
||||
def wgerApiKey = wgerProperties.getProperty('WGER_API_KEY')
|
||||
if(wgerApiKey == null){
|
||||
wgerApiKey = ""
|
||||
project.logger.error('Wger Api Key not configured. Set it in `app/wger.properties` or in the environment variable `WGER_API_KEY`')
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
|
||||
@@ -49,6 +72,7 @@ android {
|
||||
targetSdkVersion 29
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
manifestPlaceholders = [WGER_API_KEY: wgerApiKey]
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
android:name="io.flutter.app.FlutterApplication"
|
||||
android:label="wger"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
|
||||
<meta-data android:name="wger.api_key" android:value="${WGER_API_KEY}" />
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:launchMode="singleTop"
|
||||
|
||||
Reference in New Issue
Block a user