Fix for mdgram
This commit is contained in:
parent
1a5d8e9b7c
commit
bf95bd7f63
2 changed files with 22 additions and 2 deletions
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage;
|
||||
import de.robv.android.xposed.XC_MethodReplacement;
|
||||
import de.robv.android.xposed.XC_MethodHook;
|
||||
import de.robv.android.xposed.XposedBridge;
|
||||
import de.robv.android.xposed.XposedHelpers;
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
||||
|
@ -63,5 +64,24 @@ public class MainHook implements IXposedHookLoadPackage {
|
|||
}
|
||||
} catch (Throwable ignored) { }
|
||||
}
|
||||
|
||||
if (lpparam.packageName.equals("org.telegram.mdgram")) {
|
||||
try {
|
||||
Class<?> getSponsoredMessagesClass = XposedHelpers.findClassIfExists("org.telegram.tgnet.TLRPC$TL_channels_getSponsoredMessages", lpparam.classLoader);
|
||||
if (getSponsoredMessagesClass != null) {
|
||||
XposedBridge.hookAllMethods(getSponsoredMessagesClass, "a", XC_MethodReplacement.returnConstant(null));
|
||||
}
|
||||
|
||||
Class<?> messageClass = XposedHelpers.findClassIfExists("org.telegram.tgnet.TLRPC$Message", lpparam.classLoader);
|
||||
if (messageClass != null) {
|
||||
XposedBridge.hookAllConstructors(messageClass, new XC_MethodHook() {
|
||||
@Override
|
||||
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||
XposedHelpers.setBooleanField(param.thisObject, "noforwards", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (Throwable ignored) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,11 +12,11 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
|||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app"s APK
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Automatically convert third-party libraries to use AndroidX
|
||||
android.enableJetifier=true
|
||||
|
||||
appVerName=23.04.12
|
||||
appVerCode=202304120
|
||||
appVerCode=202304122
|
||||
|
|
Loading…
Add table
Reference in a new issue