Add more clients support
This commit is contained in:
parent
8a06e6c411
commit
05f2bf3055
5 changed files with 24 additions and 7 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,7 +2,6 @@
|
||||||
.gradle
|
.gradle
|
||||||
/local.properties
|
/local.properties
|
||||||
/.idea
|
/.idea
|
||||||
/.idea/assetWizardSettings.xml
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/build
|
/build
|
||||||
/captures
|
/captures
|
||||||
|
|
4
app/.gitignore
vendored
4
app/.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
/build
|
/build
|
||||||
|
/release
|
||||||
|
/debug
|
|
@ -7,7 +7,7 @@ android {
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.shatyuka.killergram"
|
applicationId "com.shatyuka.killergram"
|
||||||
minSdk 23
|
minSdk 16
|
||||||
targetSdk 31
|
targetSdk 31
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package com.shatyuka.killergram;
|
package com.shatyuka.killergram;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import de.robv.android.xposed.IXposedHookLoadPackage;
|
import de.robv.android.xposed.IXposedHookLoadPackage;
|
||||||
import de.robv.android.xposed.XC_MethodReplacement;
|
import de.robv.android.xposed.XC_MethodReplacement;
|
||||||
import de.robv.android.xposed.XposedBridge;
|
import de.robv.android.xposed.XposedBridge;
|
||||||
|
@ -7,12 +10,21 @@ import de.robv.android.xposed.XposedHelpers;
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
||||||
|
|
||||||
public class MainHook implements IXposedHookLoadPackage {
|
public class MainHook implements IXposedHookLoadPackage {
|
||||||
|
public final static List<String> hookPackages = Arrays.asList(
|
||||||
|
"org.telegram.messenger",
|
||||||
|
"org.telegram.messenger.web",
|
||||||
|
"nekox.messenger",
|
||||||
|
"tw.nekomimi.nekogram",
|
||||||
|
"org.telegram.plus");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) {
|
public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) {
|
||||||
try {
|
if (hookPackages.contains(lpparam.packageName)) {
|
||||||
Class<?> chatUIActivityClass = XposedHelpers.findClass("org.telegram.ui.ChatActivity", lpparam.classLoader);
|
try {
|
||||||
XposedBridge.hookAllMethods(chatUIActivityClass, "addSponsoredMessages", XC_MethodReplacement.returnConstant(null));
|
Class<?> chatUIActivityClass = XposedHelpers.findClass("org.telegram.ui.ChatActivity", lpparam.classLoader);
|
||||||
} catch (Throwable ignored) {
|
XposedBridge.hookAllMethods(chatUIActivityClass, "addSponsoredMessages", XC_MethodReplacement.returnConstant(null));
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,5 +2,9 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string-array name="xposedscope">
|
<string-array name="xposedscope">
|
||||||
<item>org.telegram.messenger</item>
|
<item>org.telegram.messenger</item>
|
||||||
|
<item>org.telegram.messenger.web</item>
|
||||||
|
<item>nekox.messenger</item>
|
||||||
|
<item>tw.nekomimi.nekogram</item>
|
||||||
|
<item>org.telegram.plus</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Add table
Reference in a new issue