mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 11:31:51 +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)
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user