Add permissions and signing config (don't forget to create key.props!)

This commit is contained in:
Andrew 2023-03-03 21:28:49 +07:00
parent 59a8a78a7a
commit 2956901c6b
2 changed files with 23 additions and 3 deletions

View file

@ -1,3 +1,11 @@
def keyProps = new Properties()
def keyPropsFile = rootProject.file('key.properties')
if (keyPropsFile.exists()) {
keyPropsFile.withReader('UTF-8') { reader ->
keyProps.load(reader)
}
}
def localProperties = new Properties() def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties') def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) { if (localPropertiesFile.exists()) {
@ -42,6 +50,19 @@ android {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
} }
signingConfigs {
release {
storeFile file(keyProps.RELEASE_STORE_FILE)
storePassword keyProps.RELEASE_STORE_PASSWORD
keyAlias keyProps.RELEASE_KEY_ALIAS
keyPassword keyProps.RELEASE_KEY_PASSWORD
// Optional, specify signing versions used
v1SigningEnabled true
v2SigningEnabled true
}
}
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.huacu_mobile" applicationId "com.example.huacu_mobile"
@ -55,9 +76,7 @@ android {
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.
signingConfig signingConfigs.debug
} }
} }
} }

View file

@ -1,5 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.huacu_mobile"> package="com.example.huacu_mobile">
<uses-permission android:name="android.permission.INTERNET"/>
<application <application
android:label="huacu_mobile" android:label="huacu_mobile"
android:name="${applicationName}" android:name="${applicationName}"