diff --git a/README.md b/README.md index b4fbbbf..84cbf84 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Add this to your module's `build.gradle` file: ```groovy dependencies { // ... other dependencies - implementation 'com.github.judemanutd:autostarter:1.0.6' + implementation 'com.github.judemanutd:autostarter:1.0.7' } ``` @@ -42,7 +42,7 @@ dependencies { com.github.judemanutd autostarter - 1.0.6 + 1.0.7 pom ``` diff --git a/autostarter/build.gradle b/autostarter/build.gradle index b00e33a..c8aafcd 100644 --- a/autostarter/build.gradle +++ b/autostarter/build.gradle @@ -15,7 +15,7 @@ ext { siteUrl = 'https://github.com/judemanutd/AutoStarter' gitUrl = 'https://github.com/judemanutd/AutoStarter.git' - libraryVersion = '1.0.6' + libraryVersion = '1.0.7' developerId = 'judemanutd' developerName = 'Jude Fernandes' @@ -31,8 +31,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 29 - versionCode 6 - versionName "1.0.6" + versionCode 7 + versionName "1.0.7" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/autostarter/src/main/java/com/judemanutd/autostarter/AutoStartPermissionHelper.kt b/autostarter/src/main/java/com/judemanutd/autostarter/AutoStartPermissionHelper.kt index 0bb2039..b86ca20 100644 --- a/autostarter/src/main/java/com/judemanutd/autostarter/AutoStartPermissionHelper.kt +++ b/autostarter/src/main/java/com/judemanutd/autostarter/AutoStartPermissionHelper.kt @@ -30,6 +30,7 @@ class AutoStartPermissionHelper private constructor() { private val BRAND_ASUS = "asus" private val PACKAGE_ASUS_MAIN = "com.asus.mobilemanager" private val PACKAGE_ASUS_COMPONENT = "com.asus.mobilemanager.powersaver.PowerSaverSettings" + private val PACKAGE_ASUS_COMPONENT_FALLBACK = "com.asus.mobilemanager.autostart.AutoStartActivity" /*** * Honor @@ -147,7 +148,12 @@ class AutoStartPermissionHelper private constructor() { startIntent(context, PACKAGE_ASUS_MAIN, PACKAGE_ASUS_COMPONENT) } catch (e: Exception) { e.printStackTrace() - return false + try { + startIntent(context, PACKAGE_ASUS_MAIN, PACKAGE_ASUS_COMPONENT_FALLBACK) + } catch (ex: Exception) { + ex.printStackTrace() + return false + } } } else { return false @@ -198,7 +204,6 @@ class AutoStartPermissionHelper private constructor() { ex.printStackTrace() return false } - return false } } else { return false @@ -223,9 +228,7 @@ class AutoStartPermissionHelper private constructor() { exx.printStackTrace() return false } - } - } } else { return false @@ -250,9 +253,7 @@ class AutoStartPermissionHelper private constructor() { exx.printStackTrace() return false } - } - } } else { return false