Skip to content

Commit

Permalink
Fix for MagiskSU
Browse files Browse the repository at this point in the history
  • Loading branch information
rostopira committed Aug 2, 2018
1 parent 588d44b commit 443e3ef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 5 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 28
defaultConfig {
applicationId "ua.rostopira.headsswitch"
minSdkVersion 24
targetSdkVersion 25
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
targetSdkVersion 27
versionCode 2
versionName "2.0"
}
buildTypes {
release {
Expand All @@ -27,7 +23,7 @@ android {
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
repositories {
mavenCentral()
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/ua/rostopira/headsswitch/TileService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class HeadsUpSwitcher: TileService() {
isEnabled = !isEnabled
}

private fun getPermission() =
private fun getPermission() {
Runtime.getRuntime().exec("""su -c 'pm grant ${BuildConfig.APPLICATION_ID} $WRITE_SECURE_SETTINGS'""")
Runtime.getRuntime().exec("""su -c pm grant ${BuildConfig.APPLICATION_ID} $WRITE_SECURE_SETTINGS""")
}

private fun setTileState(state: Boolean = isEnabled) {
if (state) {
Expand Down
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.1.0'
ext.kotlin_version = '1.2.51'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
jcenter()
google()
}
}

Expand Down

0 comments on commit 443e3ef

Please sign in to comment.