2020-06-21 19:24:14 +00:00
|
|
|
package com.vanced.manager.core
|
|
|
|
|
|
|
|
import android.app.Application
|
2020-07-01 20:34:34 +00:00
|
|
|
import android.widget.Toast
|
|
|
|
import androidx.preference.PreferenceManager
|
|
|
|
import com.dezlum.codelabs.getjson.GetJson
|
2020-06-21 19:24:14 +00:00
|
|
|
import com.downloader.PRDownloader
|
2020-07-01 20:34:34 +00:00
|
|
|
import com.vanced.manager.R
|
|
|
|
import com.vanced.manager.utils.InternetTools
|
2020-06-28 18:23:33 +00:00
|
|
|
import com.vanced.manager.utils.NotificationHelper.createNotifChannel
|
2020-06-21 19:24:14 +00:00
|
|
|
|
|
|
|
class App: Application() {
|
|
|
|
|
|
|
|
override fun onCreate() {
|
|
|
|
super.onCreate()
|
2020-07-02 16:03:49 +00:00
|
|
|
//checkUpdates()
|
2020-06-21 19:24:14 +00:00
|
|
|
PRDownloader.initialize(applicationContext)
|
2020-06-28 18:23:33 +00:00
|
|
|
createNotifChannel(this)
|
2020-06-21 19:24:14 +00:00
|
|
|
}
|
|
|
|
|
2020-07-02 16:03:49 +00:00
|
|
|
/*
|
2020-07-01 20:34:34 +00:00
|
|
|
private fun checkUpdates() {
|
|
|
|
val checkPrefs = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("auto_check_update", true)
|
|
|
|
if (checkPrefs) {
|
|
|
|
if (GetJson().isConnected(this) && InternetTools.isUpdateAvailable()) {
|
|
|
|
Toast.makeText(this, getString(R.string.update_found), Toast.LENGTH_SHORT).show()
|
|
|
|
} else
|
|
|
|
Toast.makeText(this, getString(R.string.update_notfound), Toast.LENGTH_SHORT).show()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-02 16:03:49 +00:00
|
|
|
*/
|
|
|
|
|
2020-06-21 19:24:14 +00:00
|
|
|
}
|