diff --git a/app/src/main/java/emu/skyline/AppUpdater.kt b/app/src/main/java/emu/skyline/AppUpdater.kt index 0caf8332..e9a97221 100644 --- a/app/src/main/java/emu/skyline/AppUpdater.kt +++ b/app/src/main/java/emu/skyline/AppUpdater.kt @@ -66,12 +66,6 @@ class AppUpdater : BroadcastReceiver() { downloadID = downloadManager.enqueue(request) } - init { - if (File(SkylineApplication.instance.getPublicFilesDir().canonicalPath + "/skyline.apk").exists()) { - File(SkylineApplication.instance.getPublicFilesDir().canonicalPath + "/skyline.apk").delete() - } - } - companion object { private const val baseUrl = "https://skyline-builds.alula.gay" private const val branch = "ftx1" @@ -158,5 +152,11 @@ class AppUpdater : BroadcastReceiver() { return null } } + + fun removeApk(){ + if (File(SkylineApplication.instance.getPublicFilesDir().canonicalPath + "/skyline.apk").exists()) { + File(SkylineApplication.instance.getPublicFilesDir().canonicalPath + "/skyline.apk").delete() + } + } } } diff --git a/app/src/main/java/emu/skyline/MainActivity.kt b/app/src/main/java/emu/skyline/MainActivity.kt index 881de5f4..10197c89 100644 --- a/app/src/main/java/emu/skyline/MainActivity.kt +++ b/app/src/main/java/emu/skyline/MainActivity.kt @@ -154,6 +154,7 @@ class MainActivity : AppCompatActivity() { if (BuildConfig.FLAVOR == "edge") { binding.checkUpdatesIcon.visibility = View.GONE } else { + AppUpdater.removeApk() AppUpdater.notifyUpdateBadge(context, binding.checkUpdatesIcon) binding.checkUpdatesIcon.setOnClickListener { AppUpdater.checkForUpdates(context)