Add simple package name modify detect

This commit is contained in:
Kr328
2020-04-16 11:05:49 +08:00
parent e04c9c15ff
commit c45f8ddfc3

View File

@@ -10,6 +10,7 @@ import android.os.Handler
import android.os.IBinder
import androidx.core.content.edit
import com.github.kr328.clash.ApkBrokenActivity
import com.github.kr328.clash.BuildConfig
import com.github.kr328.clash.Constants
import com.github.kr328.clash.common.Global
import com.github.kr328.clash.common.utils.intent
@@ -152,6 +153,9 @@ object Remote {
if (sp.getLong(Constants.PREFERENCE_KEY_LAST_INSTALL, 0) == pkg.lastUpdateTime)
return true
if ( application.packageName != BuildConfig.APPLICATION_ID )
return false
val info = application.applicationInfo
val sources =
info.splitSourceDirs ?: arrayOf(info.sourceDir) ?: return false