mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
add buildFlavor for accrescent
This commit is contained in:
parent
fa0c880342
commit
f08f357bb3
3 changed files with 41 additions and 1 deletions
|
@ -51,6 +51,29 @@ android {
|
||||||
versionNameSuffix = "-debug"
|
versionNameSuffix = "-debug"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flavorDimensions += "distribution"
|
||||||
|
|
||||||
|
productFlavors {
|
||||||
|
create("default") {
|
||||||
|
dimension = "distribution"
|
||||||
|
getIsDefault().set(true)
|
||||||
|
buildConfigField "boolean", "USE_ACCESSIBILITY_SERVICE", "true"
|
||||||
|
}
|
||||||
|
create("accrescent") {
|
||||||
|
dimension = "distribution"
|
||||||
|
applicationIdSuffix = ".accrescent"
|
||||||
|
versionNameSuffix = "+accrescent"
|
||||||
|
buildConfigField "boolean", "USE_ACCESSIBILITY_SERVICE", "false"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
accrescent {
|
||||||
|
manifest.srcFile 'src/accrescent/AndroidManifest.xml'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namespace 'de.jrpie.android.launcher'
|
namespace 'de.jrpie.android.launcher'
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
buildConfig true
|
buildConfig true
|
||||||
|
|
15
app/src/accrescent/AndroidManifest.xml
Normal file
15
app/src/accrescent/AndroidManifest.xml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:node="merge">
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:name=".Application"
|
||||||
|
tools:node="merge">
|
||||||
|
<service
|
||||||
|
android:name=".actions.lock.LauncherAccessibilityService"
|
||||||
|
tools:strict="true"
|
||||||
|
tools:node="remove" />
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.widget.Button
|
import android.widget.Button
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import de.jrpie.android.launcher.BuildConfig
|
||||||
import de.jrpie.android.launcher.R
|
import de.jrpie.android.launcher.R
|
||||||
import de.jrpie.android.launcher.preferences.LauncherPreferences
|
import de.jrpie.android.launcher.preferences.LauncherPreferences
|
||||||
|
|
||||||
|
@ -36,7 +37,8 @@ enum class LockMethod(
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun chooseMethod(context: Context) {
|
fun chooseMethod(context: Context) {
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P ||
|
||||||
|
! BuildConfig.USE_ACCESSIBILITY_SERVICE) {
|
||||||
// only device admin is available
|
// only device admin is available
|
||||||
setMethod(context, DEVICE_ADMIN)
|
setMethod(context, DEVICE_ADMIN)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue