-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: mms - >Prohibition of identification as a new device
- Loading branch information
Showing
5 changed files
with
80 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
app/src/main/java/com/sevtinge/hyperceiler/module/hook/mms/ImOldDevice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* This file is part of HyperCeiler. | ||
* | ||
* HyperCeiler is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* Copyright (C) 2023-2024 HyperCeiler Contributions | ||
*/ | ||
|
||
package com.sevtinge.hyperceiler.module.hook.mms; | ||
|
||
import com.sevtinge.hyperceiler.module.base.BaseHook; | ||
import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; | ||
import com.sevtinge.hyperceiler.module.base.dexkit.IDexKit; | ||
|
||
import org.luckypray.dexkit.DexKitBridge; | ||
import org.luckypray.dexkit.query.FindMethod; | ||
import org.luckypray.dexkit.query.matchers.MethodMatcher; | ||
import org.luckypray.dexkit.result.MethodData; | ||
|
||
import java.lang.reflect.AnnotatedElement; | ||
import java.lang.reflect.Method; | ||
|
||
import de.robv.android.xposed.XC_MethodHook; | ||
|
||
public class ImOldDevice extends BaseHook { | ||
@Override | ||
public void init() throws NoSuchMethodException { | ||
Method method = (Method) DexKit.getDexKitBridge("IsOld", new IDexKit() { | ||
@Override | ||
public AnnotatedElement dexkit(DexKitBridge bridge) throws ReflectiveOperationException { | ||
MethodData methodData = bridge.findMethod(FindMethod.create() | ||
.matcher(MethodMatcher.create() | ||
.usingStrings("isOld") | ||
)).singleOrNull(); | ||
return methodData.getMethodInstance(lpparam.classLoader); | ||
} | ||
}); | ||
hookMethod(method, new MethodHook() { | ||
@Override | ||
protected void before(XC_MethodHook.MethodHookParam param) throws Throwable { | ||
param.setResult(false); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters