mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: try fix #120
This commit is contained in:
parent
6201d12f5f
commit
41dd1de8f8
@ -109,7 +109,7 @@ internal object CardSvc: BaseSvc() {
|
||||
val dataService = app
|
||||
.getRuntimeService(IProfileDataService::class.java, "all")
|
||||
val card = refreshCardLock.withLock {
|
||||
suspendCancellableCoroutine<Card?> {
|
||||
suspendCancellableCoroutine {
|
||||
app.addObserver(object: ProfileCardObserver() {
|
||||
override fun onGetProfileCard(success: Boolean, obj: Any) {
|
||||
app.removeObserver(this)
|
||||
|
@ -66,6 +66,8 @@ class AntiDetection: IAction {
|
||||
}
|
||||
|
||||
private fun antiFindPackage(context: Context) {
|
||||
if (isAntiFindPackage) return
|
||||
|
||||
val packageManager = context.packageManager
|
||||
val applicationInfo = packageManager.getApplicationInfo("moe.fuqiuluo.shamrock", 0)
|
||||
val packageInfo = packageManager.getPackageInfo("moe.fuqiuluo.shamrock", 0)
|
||||
@ -74,7 +76,7 @@ class AntiDetection: IAction {
|
||||
val packageName = it.args[0] as String
|
||||
if(packageName == "moe.fuqiuluo.shamrock") {
|
||||
LogCenter.log("AntiDetection: 检测到对Shamrock的检测,欺骗PackageManager(GA)", Level.WARN)
|
||||
it.throwable = PackageManager.NameNotFoundException()
|
||||
it.throwable = PackageManager.NameNotFoundException("Hided")
|
||||
} else if (packageName == "moe.fuqiuluo.shamrock.hided") {
|
||||
it.result = applicationInfo
|
||||
}
|
||||
@ -100,6 +102,8 @@ class AntiDetection: IAction {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isAntiFindPackage = true
|
||||
}
|
||||
|
||||
private fun antiMemoryWalking() {
|
||||
@ -205,4 +209,9 @@ class AntiDetection: IAction {
|
||||
}.toTypedArray()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
var isAntiFindPackage = false
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user