Skip to content

Commit

Permalink
Fixed "failed to unlock app" error
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamza417 committed Dec 5, 2022
1 parent 205bd4e commit 85d7b1f
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 46 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
android {
compileSdkVersion 33

def appVersionCode = 50
def appVersionCode = 51
def appVersionName = "build_$appVersionCode (alpha)"

buildFeatures {
Expand Down
87 changes: 54 additions & 33 deletions app/src/main/assets/html/changelogs.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,75 @@ <h1>Change Logs</h1>
<br>

<sub>(Current Version)</sub>
<h2>Build50</h2>
<h2>Build51</h2>

<!-- Write change logs here -->

<h4>User Interface</h4>
<h4>Bug Fixes</h4>

<ul>
<li>Added animations to bottom menus.</li>
<li>Redesigned <b>Batch</b> panel menu.</li>
<li>Added disabled/cross icon on the names of disabled apps.</li>
<li>Added new design for <i>Audio Player</i>.</li>
<li>Fixed "failed to unlock app" error on unlocker activation.</li>
</ul>

<h4>Bug Fixes</h4>
<br>
<br>
<div class="wrap-collapsible">
<input id="build_50" class="toggle" type="checkbox">
<label for="build_50" class="lbl-toggle">Build50</label>
<div class="collapsible-content">
<div class="content-inner">
<h4>User Interface</h4>

<ul>
<li>Fixed DeadObject error in various panels caused during relaunch and reload of the app.</li>
<li>Fixed bottom menu velocity issue when list is refreshed.</li>
<li>Fixed bottom menu flickering issue when fragment is closing.</li>
<li>Fixed delay in opening <b>Batch</b> panel.</li>
<li>Fixed never ending vibrations after batch extract is done.</li>
<li>Fixed a few issues with batch uninstaller (more revisions needed).</li>
</ul>
<ul>
<li>Added animations to bottom menus.</li>
<li>Redesigned <b>Batch</b> panel menu.</li>
<li>Added disabled/cross icon on the names of disabled apps.</li>
<li>Added new design for <i>Audio Player</i>.</li>
</ul>

<h4>Batch</h4>
<h4>Bug Fixes</h4>

<ul>
<li>Implemented non-root uninstaller mechanism.</li>
</ul>
<ul>
<li>Fixed DeadObject error in various panels caused during relaunch and reload of
the app.
</li>
<li>Fixed bottom menu velocity issue when list is refreshed.</li>
<li>Fixed bottom menu flickering issue when fragment is closing.</li>
<li>Fixed delay in opening <b>Batch</b> panel.</li>
<li>Fixed never ending vibrations after batch extract is done.</li>
<li>Fixed a few issues with batch uninstaller (more revisions needed).</li>
</ul>

<h4>Other</h4>
<h4>Batch</h4>

<ul>
<li>Added app level uninstaller listener. App should automatically refresh and update all data
if any app is uninstalled within or outside the scope of the app.
</li>
</ul>
<ul>
<li>Implemented non-root uninstaller mechanism.</li>
</ul>

<h4>Trial Version</h4>
<h4>Other</h4>

<p>From this version onwards, this app will add a trial period limit on app uses. The trial
period will last until 15 days and will offer access to all app's features can be used and tested
within this duration. Once the trial period ends, the app will lock a tiny percentage of its core
features which can be purchased if the user deems them necessary otherwise any other app's
feature will continue to work as intended even after the trial period has ended.
</p>
<ul>
<li>Added app level uninstaller listener. App should automatically refresh and
update all data
if any app is uninstalled within or outside the scope of the app.
</li>
</ul>

<br>
<h4>Trial Version</h4>

<p>From this version onwards, this app will add a trial period limit on app uses. The
trial
period will last until 15 days and will offer access to all app's features can be
used and tested
within this duration. Once the trial period ends, the app will lock a tiny percentage
of its core
features which can be purchased if the user deems them necessary otherwise any other
app's
feature will continue to work as intended even after the trial period has ended.
</p>
</div>
</div>
</div>
<br>
<div class="wrap-collapsible">
<input id="build_49" class="toggle" type="checkbox">
Expand Down
18 changes: 14 additions & 4 deletions app/src/main/java/app/simple/inure/activities/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import app.simple.inure.apk.utils.PackageUtils.isPackageInstalled
import app.simple.inure.constants.IntentConstants
import app.simple.inure.constants.ShortcutConstants
import app.simple.inure.constants.ThemeConstants
import app.simple.inure.constants.Warnings
import app.simple.inure.crash.CrashReporter
import app.simple.inure.decorations.theme.ThemeCoordinatorLayout
import app.simple.inure.extensions.activities.BaseActivity
Expand All @@ -26,6 +27,7 @@ import app.simple.inure.themes.manager.ThemeManager
import app.simple.inure.ui.launcher.SplashScreen
import app.simple.inure.ui.music.Music
import app.simple.inure.ui.panels.*
import app.simple.inure.util.AppUtils
import app.simple.inure.util.CalendarUtils
import app.simple.inure.util.ConditionUtils.isZero
import app.simple.inure.util.NullSafety.isNull
Expand Down Expand Up @@ -129,26 +131,34 @@ class MainActivity : BaseActivity() {
.commit()
}
IntentConstants.ACTION_UNLOCK -> {
if (packageManager.isPackageInstalled("app.simple.inureunlock")) {
if (MainPreferences.isAppFullVersionEnabled()) {
if (packageManager.isPackageInstalled(AppUtils.unlockerPackageName)) {
if (MainPreferences.isFullVersion()) {
showWarning(R.string.full_version_already_activated, goBack = false)

supportFragmentManager.beginTransaction()
.replace(R.id.app_container, SplashScreen.newInstance(false), "splash_screen")
.commit()
} else {
if (MainPreferences.setAppFullVersionEnabled(value = true)) {
if (MainPreferences.setFullVersion(value = true)) {
showWarning(R.string.full_version_activated, goBack = false)

supportFragmentManager.beginTransaction()
.replace(R.id.app_container, SplashScreen.newInstance(false), "splash_screen")
.commit()
} else {
showWarning(R.string.failed_to_activate_full_version, goBack = false)

supportFragmentManager.beginTransaction()
.replace(R.id.app_container, SplashScreen.newInstance(false), "splash_screen")
.commit()
}
}
} else {
showWarning(R.string.failed_to_activate_full_version, goBack = false)
showWarning(Warnings.getInureWarning03(), goBack = false)

supportFragmentManager.beginTransaction()
.replace(R.id.app_container, SplashScreen.newInstance(false), "splash_screen")
.commit()
}
}
else -> {
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/app/simple/inure/constants/Warnings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ object Warnings {
* InureWarning02: Failed to load the bitmap
*/
fun getInureWarning02(path: String, type: String): String = "0x002: Failed to load type: $type from path: $path"

/**
* InureWarning03: Unknown app state detected!
*/
fun getInureWarning03(): String = "0x003: Unknown app state detected!"
}
8 changes: 4 additions & 4 deletions app/src/main/java/app/simple/inure/dialogs/app/FullVersion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import app.simple.inure.R
import app.simple.inure.decorations.ripple.DynamicRippleTextView
import app.simple.inure.extensions.fragments.ScopedBottomSheetFragment
import app.simple.inure.interfaces.fragments.WarningCallbacks
import app.simple.inure.util.BuildUtils
import app.simple.inure.util.AppUtils
import app.simple.inure.util.IntentHelper.asUri
import app.simple.inure.util.IntentHelper.openInBrowser
import app.simple.inure.util.MarketUtils
Expand All @@ -33,9 +33,9 @@ class FullVersion : ScopedBottomSheetFragment() {
startPostponedEnterTransition()

purchase.setOnClickListener {
if (BuildUtils.isPlayFlavor()) {
MarketUtils.openAppOnPlayStore(requireContext(), "app.simple.inureunlocker")
} else if (BuildUtils.isGithubFlavor()) {
if (AppUtils.isPlayFlavor()) {
MarketUtils.openAppOnPlayStore(requireContext(), AppUtils.unlockerPackageName)
} else if (AppUtils.isGithubFlavor()) {
// Open GumRoad link in Browser
getString(R.string.gumroad_link).asUri().openInBrowser(requireContext())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,11 @@ open class BaseActivity : AppCompatActivity(), ThemeChangedListener, android.con
}
}

open fun showWarning(warning: String) {
open fun showWarning(warning: String, goBack: Boolean = true) {
supportFragmentManager.showWarning(warning).setOnWarningCallbackListener {
onBackPressedDispatcher.onBackPressed()
if (goBack) {
onBackPressedDispatcher.onBackPressed()
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ object MainPreferences {

// ---------------------------------------------------------------------------------------------------------- //

fun setAppFullVersionEnabled(value: Boolean): Boolean {
fun setFullVersion(value: Boolean): Boolean {
return getSharedPreferences().edit().putBoolean(isAppFullVersionEnabled, value).commit()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ package app.simple.inure.util
import app.simple.inure.BuildConfig

@Suppress("KotlinConstantConditions")
object BuildUtils {
object AppUtils {

const val appVersion = BuildConfig.VERSION_NAME
const val appVersionCode = BuildConfig.VERSION_CODE
const val appPackageName = BuildConfig.APPLICATION_ID
const val appBuildType = BuildConfig.BUILD_TYPE
const val appFlavor = BuildConfig.FLAVOR
const val unlockerPackageName = "app.simple.inureunlocker"

/**
* Returns true if the flavor is play store
Expand Down
3 changes: 3 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/51.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Refer to Change Logs under About section of the app to get the detailed list of all changes in this version.

Feel free to join app's Telegram group to discuss this release: https://t.me/inure_app_manager

0 comments on commit 85d7b1f

Please sign in to comment.