From c45f8ddfc3cfc5afa06222b278bdd87ac17573ce Mon Sep 17 00:00:00 2001 From: Kr328 <39107975+Kr328@users.noreply.github.com> Date: Thu, 16 Apr 2020 11:05:49 +0800 Subject: [PATCH] Add simple package name modify detect --- app/src/main/java/com/github/kr328/clash/remote/Remote.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/github/kr328/clash/remote/Remote.kt b/app/src/main/java/com/github/kr328/clash/remote/Remote.kt index d6bbf1c..e66a510 100644 --- a/app/src/main/java/com/github/kr328/clash/remote/Remote.kt +++ b/app/src/main/java/com/github/kr328/clash/remote/Remote.kt @@ -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