mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 20:11:49 +01:00
Remove APK when app is opened
This commit is contained in:
parent
1cc0b42720
commit
d442be37b6
@ -66,12 +66,6 @@ class AppUpdater : BroadcastReceiver() {
|
|||||||
downloadID = downloadManager.enqueue(request)
|
downloadID = downloadManager.enqueue(request)
|
||||||
}
|
}
|
||||||
|
|
||||||
init {
|
|
||||||
if (File(SkylineApplication.instance.getPublicFilesDir().canonicalPath + "/skyline.apk").exists()) {
|
|
||||||
File(SkylineApplication.instance.getPublicFilesDir().canonicalPath + "/skyline.apk").delete()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val baseUrl = "https://skyline-builds.alula.gay"
|
private const val baseUrl = "https://skyline-builds.alula.gay"
|
||||||
private const val branch = "ftx1"
|
private const val branch = "ftx1"
|
||||||
@ -158,5 +152,11 @@ class AppUpdater : BroadcastReceiver() {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun removeApk(){
|
||||||
|
if (File(SkylineApplication.instance.getPublicFilesDir().canonicalPath + "/skyline.apk").exists()) {
|
||||||
|
File(SkylineApplication.instance.getPublicFilesDir().canonicalPath + "/skyline.apk").delete()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -154,6 +154,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
if (BuildConfig.FLAVOR == "edge") {
|
if (BuildConfig.FLAVOR == "edge") {
|
||||||
binding.checkUpdatesIcon.visibility = View.GONE
|
binding.checkUpdatesIcon.visibility = View.GONE
|
||||||
} else {
|
} else {
|
||||||
|
AppUpdater.removeApk()
|
||||||
AppUpdater.notifyUpdateBadge(context, binding.checkUpdatesIcon)
|
AppUpdater.notifyUpdateBadge(context, binding.checkUpdatesIcon)
|
||||||
binding.checkUpdatesIcon.setOnClickListener {
|
binding.checkUpdatesIcon.setOnClickListener {
|
||||||
AppUpdater.checkForUpdates(context)
|
AppUpdater.checkForUpdates(context)
|
||||||
|
Loading…
Reference in New Issue
Block a user