package com.base.pdfviewerscannerwhite.helper

import android.app.Activity
import android.app.Application
import android.text.TextUtils
import com.base.pdfviewerscannerwhite.utils.AppPreferences
import com.base.pdfviewerscannerwhite.utils.LogEx
import java.util.UUID


class MyApplication : Application() {
    private val TAG = "MyApplication"
    var uuid = ""

    companion object {
        lateinit var context: MyApplication

        @JvmField
        var PAUSED_VALUE = 0
    }


    override fun onCreate() {
        super.onCreate()
        context = this
        initUUid()
        initApp()
    }

    private fun initUUid() {
        //使用同一个uuid来测试上报
        //7a6f8e5f-ca67-4149-975b-dacdc6c51aff1723174621132
//        AppPreferences.getInstance().put("uuid", "7a6f8e5f-ca67-4149-975b-dacdc6c51aff1723174621132")
        uuid = AppPreferences.getInstance().getString("uuid", "")
        if (TextUtils.isEmpty(uuid)) {
            uuid = UUID.randomUUID().toString()
//            + System.currentTimeMillis()
            AppPreferences.getInstance().put("uuid", uuid)
            LogEx.logDebug(TAG, "uuid=$uuid")
        }
    }

    fun initApp() {
    }





}