Skip to content

Commit

Permalink
Add more apps support
Browse files Browse the repository at this point in the history
  • Loading branch information
shatyuka committed Nov 11, 2021
1 parent d60bee2 commit 1c18e39
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ An Android Xposed module to remove sponsored messages of Telegram
- **Official** org.telegram.messenger.beta
- **NekoX** nekox.messenger
- **Nekogram** tw.nekomimi.nekogram
- **Nanogram** com.cool2645.nekolite
- **Plus Messenger** org.telegram.plus
- **iMe Messenger** com.iMe.android
- **BGram** org.telegram.BifToGram
- **Catogram** ua.itaysonlab.messenger
- **Forkgram** org.forkclient.messenger.beta
- **aka** org.aka.messenger

## License

Expand Down
10 changes: 7 additions & 3 deletions app/src/main/java/com/shatyuka/killergram/MainHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@ public class MainHook implements IXposedHookLoadPackage {
"org.telegram.messenger.beta",
"nekox.messenger",
"tw.nekomimi.nekogram",
"com.cool2645.nekolite",
"org.telegram.plus",
"com.iMe.android",
"org.telegram.BifToGram");
"org.telegram.BifToGram",
"ua.itaysonlab.messenger",
"org.forkclient.messenger.beta",
"org.aka.messenger");

@Override
public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) {
if (hookPackages.contains(lpparam.packageName)) {
try {
Class<?> chatUIActivityClass = XposedHelpers.findClass("org.telegram.ui.ChatActivity", lpparam.classLoader);
XposedBridge.hookAllMethods(chatUIActivityClass, "addSponsoredMessages", XC_MethodReplacement.returnConstant(null));
Class<?> messagesControllerClass = XposedHelpers.findClass("org.telegram.messenger.MessagesController", lpparam.classLoader);
XposedBridge.hookAllMethods(messagesControllerClass, "getSponsoredMessages", XC_MethodReplacement.returnConstant(null));
} catch (Throwable ignored) {
}
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
<item>org.telegram.messenger.beta</item>
<item>nekox.messenger</item>
<item>tw.nekomimi.nekogram</item>
<item>com.cool2645.nekolite</item>
<item>org.telegram.plus</item>
<item>com.iMe.android</item>
<item>org.telegram.BifToGram</item>
<item>ua.itaysonlab.messenger</item>
<item>org.forkclient.messenger.beta</item>
<item>org.aka.messenger</item>
</string-array>
</resources>

0 comments on commit 1c18e39

Please sign in to comment.