From b3ba7d959f10fcd0b0fd17be5aa7e3e75e40e159 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Mon, 12 Sep 2022 14:41:22 +0300 Subject: [PATCH] Rename to org.selfprivacy.app and add flavors. --- android/app/build.gradle | 21 +++++++++++++++++-- android/app/src/debug/AndroidManifest.xml | 2 +- android/app/src/main/AndroidManifest.xml | 2 +- .../selfprivacy/app}/MainActivity.kt | 2 +- android/app/src/profile/AndroidManifest.xml | 2 +- android/build.gradle | 13 ++++++++++++ linux/CMakeLists.txt | 2 +- 7 files changed, 37 insertions(+), 7 deletions(-) rename android/app/src/main/kotlin/{pro/kherel/selfprivacy => org/selfprivacy/app}/MainActivity.kt (75%) diff --git a/android/app/build.gradle b/android/app/build.gradle index 0963724e..3811c5e7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,9 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion flutter.compileSdkVersion + namespace 'org.selfprivacy.app' + + compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion sourceSets { @@ -48,7 +50,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "pro.kherel.selfprivacy" + applicationId "org.selfprivacy.app" minSdkVersion 21 targetSdkVersion 31 versionCode flutterVersionCode.toInteger() @@ -62,6 +64,21 @@ android { signingConfig signingConfigs.debug } } + + flavorDimensions "default" + productFlavors { + fdroid { + applicationId "pro.kherel.selfprivacy" + } + production { + applicationIdSuffix "" + } + nightly { + applicationIdSuffix ".nightly" + versionCode project.getVersionCode() + versionName "nightly-" + project.getVersionCode() + } + } } flutter { diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 27e1af1d..dddeb01f 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="org.selfprivacy.app"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 33c2ba9a..50f47475 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="org.selfprivacy.app"> diff --git a/android/build.gradle b/android/build.gradle index 31e95773..d78205d8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,18 @@ buildscript { ext.kotlin_version = '1.6.10' + ext.getVersionCode = { -> + try { + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-list', '--first-parent', '--count', 'origin/master' + standardOutput = stdout + } + return Integer.parseInt(stdout.toString().trim()) + } + catch (ignored) { + return -1 + } + } repositories { google() jcenter() diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index cc332a28..94dd8d0b 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -7,7 +7,7 @@ project(runner LANGUAGES CXX) set(BINARY_NAME "selfprivacy") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "pro.kherel.selfprivacy") +set(APPLICATION_ID "org.selfprivacy.app") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake.