Hmm somethings are changed

This commit is contained in:
hemanths@live.com 2019-01-02 09:25:55 +05:30
parent 8dfb0dc8dd
commit 423b26be66
76 changed files with 410 additions and 234 deletions

View file

@ -8,7 +8,8 @@ import code.name.monkey.appthemehelper.util.VersionUtils
import code.name.monkey.retromusic.appshortcuts.DynamicShortcutManager
import com.anjlab.android.iab.v3.BillingProcessor
import com.anjlab.android.iab.v3.TransactionDetails
import com.bumptech.glide.Glide
import uk.co.chrisjenx.calligraphy.CalligraphyConfig
class App : MultiDexApplication() {
@ -30,6 +31,11 @@ class App : MultiDexApplication() {
DynamicShortcutManager(this).initDynamicShortcuts()
CalligraphyConfig.initDefault(CalligraphyConfig.Builder()
.setDefaultFont(R.font.circular_std_book)
.build()
)
// automatically restores purchases
billingProcessor = BillingProcessor(this, BuildConfig.GOOGLE_PLAY_LICENSING_KEY,
object : BillingProcessor.IBillingHandler {
@ -45,18 +51,6 @@ class App : MultiDexApplication() {
})
}
private fun setupErrorHandler() {
Thread.setDefaultUncaughtExceptionHandler { _, throwable -> handleUncaughtException(throwable) }
}
private fun handleUncaughtException(throwable: Throwable) {
throwable.printStackTrace()
deleteAppData()
//Intent intent = new Intent(this, ErrorHandlerActivity.class);
//intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//startActivity(intent);
}
override fun onTerminate() {
super.onTerminate()
billingProcessor.release()
@ -74,20 +68,5 @@ class App : MultiDexApplication() {
val isProVersion: Boolean
get() = BuildConfig.DEBUG || instance.billingProcessor.isPurchased(PRO_VERSION_PRODUCT_ID)
fun deleteAppData() {
try {
// clearing app data
val packageName = instance.packageName
val runtime = Runtime.getRuntime()
runtime.exec("pm clear $packageName")
System.exit(0)
} catch (e: Exception) {
e.printStackTrace()
}
}
}
}