-
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.
- Loading branch information
Showing
5 changed files
with
68 additions
and
0 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/community/FuckDetection.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.community; | ||
|
||
import static com.sevtinge.hyperceiler.BuildConfig.APPLICATION_ID; | ||
|
||
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; | ||
|
||
public class FuckDetection extends BaseHook { | ||
@Override | ||
public void init() throws NoSuchMethodException { | ||
Method method = (Method) DexKit.getDexKitBridge("GetPackageVersionName", new IDexKit() { | ||
@Override | ||
public AnnotatedElement dexkit(DexKitBridge bridge) throws ReflectiveOperationException { | ||
MethodData methodData = bridge.findMethod(FindMethod.create() | ||
.matcher(MethodMatcher.create() | ||
.usingStrings("5577218", "binding.editContactInformation.text") | ||
)).singleOrNull(); | ||
return methodData.getMethodInstance(lpparam.classLoader); | ||
} | ||
}); | ||
hookMethod(method, new MethodHook() { | ||
@Override | ||
protected void before(MethodHookParam param) throws Throwable { | ||
if (param.args[0].equals(APPLICATION_ID)) param.args[0] = null; | ||
} | ||
}); | ||
} | ||
} |
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