mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-22 22:11:27 +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"
|
||||
}
|
||||
}
|
||||
|
||||
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'
|
||||
buildFeatures {
|
||||
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.widget.Button
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import de.jrpie.android.launcher.BuildConfig
|
||||
import de.jrpie.android.launcher.R
|
||||
import de.jrpie.android.launcher.preferences.LauncherPreferences
|
||||
|
||||
|
@ -36,7 +37,8 @@ enum class LockMethod(
|
|||
|
||||
companion object {
|
||||
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
|
||||
setMethod(context, DEVICE_ADMIN)
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue