Skip to content

Commit

Permalink
Add separate build flavor for Play without REQUEST_INSTALL_PACKAGES p…
Browse files Browse the repository at this point in the history
…ermission
  • Loading branch information
zacharee committed Aug 13, 2024
1 parent d017e9c commit 37525db
Show file tree
Hide file tree
Showing 23 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Build with Gradle
run: |
./gradlew :android:packageRelease
./gradlew :android:packageFossRelease
./gradlew --stop
- name: Upload Logs
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ bin/
/.idea/deploymentTargetDropDown.xml
/.kotlin/
/.idea/appInsightsSettings.xml
/android/foss/
/android/play/
14 changes: 9 additions & 5 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,20 @@ android {

setProperty("archivesBaseName", "HINT_Control_$versionName")
}
packaging {
resources.excludes.add("META-INF/AL2.0")
resources.excludes.add("META-INF/LGPL2.1")
}
compileOptions {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
buildFeatures {
buildConfig = true
}
flavorDimensions += "version"
productFlavors {
create("foss")
create("play")
}
}
7 changes: 0 additions & 7 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>

<application
android:theme="@style/AppTheme"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round" />
</manifest>
5 changes: 5 additions & 0 deletions android/src/play/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove" />
</manifest>
6 changes: 5 additions & 1 deletion common/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

<application
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:label="@string/app_name"
android:name="dev.zwander.common.App">
android:name="dev.zwander.common.App"
android:theme="@style/AppTheme"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round">
<!--suppress AndroidDomInspection -->
<activity android:name="dev.zwander.android.MainActivity" android:exported="true"
android:configChanges="colorMode
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 37525db

Please sign in to comment.