Skip to content

Commit

Permalink
feat: 谋权篡位 & 强制置顶评论
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonLeeeaf committed Jul 7, 2024
1 parent 6b886b3 commit b824665
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 22 deletions.
30 changes: 15 additions & 15 deletions .androidide/editor/openedFiles.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
"allFiles": [
{
"file": "/storage/emulated/0/铃芽の文件/Projects/FuckMaoNemo/app/src/main/res/xml/config.xml",
"file": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/src/main/java/io/github/moonleeeaf/fuckmaonemo/Hook.java",
"selection": {
"end": {
"column": 36,
"index": 1031,
"line": 30
"column": 59,
"index": 9189,
"line": 224
},
"start": {
"column": 36,
"index": 1031,
"line": 30
"column": 59,
"index": 9189,
"line": 224
}
}
},
{
"file": "/storage/emulated/0/铃芽の文件/Projects/FuckMaoNemo/app/build.gradle",
"file": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/src/main/res/xml/config.xml",
"selection": {
"end": {
"column": 26,
"index": 302,
"line": 15
"column": 0,
"index": 0,
"line": 0
},
"start": {
"column": 26,
"index": 302,
"line": 15
"column": 0,
"index": 0,
"line": 0
}
}
}
],
"selectedFile": "/storage/emulated/0/铃芽の文件/Projects/FuckMaoNemo/app/build.gradle"
"selectedFile": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/src/main/java/io/github/moonleeeaf/fuckmaonemo/Hook.java"
}
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "io.github.moonleeeaf.fuckmaonemo"
minSdk 21
targetSdk 33
versionCode 12100
versionName "1.2.1"
versionCode 13000
versionName "1.3.p"

vectorDrawables {
useSupportLibrary true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ protected void onCreate(Bundle arg0) {

return false;
});

findPreference("see_miao").setOnPreferenceClickListener((p) -> {
new AlertDialog.Builder(this)
.setTitle("屏蔽词列表")
.setMessage("当期列表:\n" + Hook.MIAO_LIST)
.show();

return false;
});
}

}
102 changes: 102 additions & 0 deletions app/src/main/java/io/github/moonleeeaf/fuckmaonemo/Hook.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public class Hook implements IXposedHookLoadPackage {
private int nohengheng;
private int aaaa;

public static final String MIAO_LIST = "妈 马 操 草 傻 艹 牛 逼 P 槽 涩 色 m";
public static final String[] MIAO = MIAO_LIST.split(" ");

private XC_MethodHook.Unhook force_set_work_myown_unhook;

@Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam param) throws Throwable {
if ("com.codemao.nemo".equals(param.packageName)) {
Expand Down Expand Up @@ -53,6 +58,13 @@ public Application getApplication() throws ClassNotFoundException {
return (Application) XposedHelpers.callStaticMethod(Class.forName("android.app.ActivityThread"), "currentApplication");
}

public static String fuck屏蔽词(String str) {
for (String i : MIAO) {
str = str.replaceAll(i, "‌" + i + "‌");
}
return str;
}

public void hook(XC_LoadPackage.LoadPackageParam param) throws Exception {
if (isHooked) return;
else isHooked = true;
Expand Down Expand Up @@ -164,6 +176,96 @@ protected Object replaceHookedMethod(MethodHookParam arg0) throws Throwable {
);
});

// 强制置顶评论
load("force_top_comment", () -> {
XposedBridge.log("[FuckMaoNemo] Hook_强制置顶评论");
XposedBridge.hookMethod(
getMethod(
XposedHelpers.findClass("com.codemao.nemo.view.CommentOptionDialogV2", classLoader),
"checkIsSelf",
null
),
new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam mp) throws Throwable {
XposedHelpers.setBooleanField(mp.thisObject, "isOwnWork", true);
}
}
);
});

// 谋权篡位
load("force_set_work_myown", () -> {
XposedBridge.log("[FuckMaoNemo] Hook_谋权篡位");
XposedBridge.hookMethod(
getMethod(
XposedHelpers.findClass("com.codemao.nemo.activity.WorkDetailActivity", classLoader),
"setWorkDetailData",
null
),
new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam mp) throws Throwable {
force_set_work_myown_unhook = XposedBridge.hookMethod(
getMethod(
XposedHelpers.findClass("com.codemao.creativecenter.utils.bcm.bean.AuthorInfo", classLoader),
"getId",
null
),
new XC_MethodReplacement() {
@Override
protected Object replaceHookedMethod(MethodHookParam hp) throws Throwable {
Method m = getMethod(XposedHelpers.findClass("com.codemao.nemo.util.LocalUserHelper", classLoader), "getUserInfo", null);
m.setAccessible(true);
Object usrInfo = m.invoke(null, null);

m = getMethod(usrInfo.getClass(), "getId", null);
m.setAccessible(true);

force_set_work_myown_unhook.unhook(); // 希望人没事
return m.invoke(usrInfo, null); // long 类型
}
});
}
}
);
});

// 防止屏蔽屏蔽词
load("fuck_miao", () -> {
XposedBridge.log("[FuckMaoNemo] Hook_反屏蔽");
XC_MethodHook hook = new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam mp) throws Throwable {
XposedHelpers.setObjectField(mp.thisObject, "content", fuck屏蔽词((String) XposedHelpers.getObjectField(mp.thisObject, "content")));
}
};
XposedBridge.hookMethod(
getMethod(
XposedHelpers.findClass("com.codemao.nemo.fragment.WorkCommentFragment", classLoader),
"sendReply",
null
),
hook
);
XposedBridge.hookMethod(
getMethod(
XposedHelpers.findClass("com.codemao.nemo.fragment.WorkCommentFragment", classLoader),
"sendComment",
null
),
hook
);
XposedBridge.hookMethod(
getMethod(
XposedHelpers.findClass("com.codemao.nemo.activity.CommentDetailActivity", classLoader),
"send",
null
),
hook
);
});

XposedBridge.log("[FuckMaoNemo] 执行完毕");

Toast.makeText(getApplication(), "[FuckMaoNemo] 加载成功 (≧▽≦)\n" + nohengheng + " 个功能加载成功, " + aaaa + " 个失败", Toast.LENGTH_LONG).show();
Expand Down
34 changes: 29 additions & 5 deletions app/src/main/res/xml/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,31 @@
<SwitchPreference
android:key="fuck_update"
android:title="屏蔽更新"
android:summary="主页不会弹更新对话框" />
android:summary="主页不会弹更新对话框,不会拦截设置里手动查看的更新" />

<SwitchPreference
android:key="fuck_no_proxy"
android:title="反防抓包"
android:summary="效果不太明显,目前只能发现账号相关的有反防抓包" />
android:summary="目前只发现账号相关的有反防抓包,真无法抓包就去刷原生安卓吧,亲测有效" />

</PreferenceCategory>

<PreferenceCategory android:title="评论">

<SwitchPreference
android:key="force_top_comment"
android:title="强制置顶评论"
android:summary="灵感来源于 CodeCat,可以无视作品作者直接置顶评论(注意:只支持 Nemo 作品,其它无效响应406码!)" />

<SwitchPreference
android:key="fuck_miao"
android:title="别屏蔽我词语!"
android:summary="让部分屏蔽词无法再被屏蔽,请勿用于恶语相向,否则被举报不要来找我!!\n可能会导致缩短评论字数上限,算法有待优化" />

<Preference
android:key="see_miao"
android:title="查看支持防屏蔽的词汇"
android:summary="对应上面的 防屏蔽" />

</PreferenceCategory>

Expand All @@ -42,15 +61,20 @@
<SwitchPreference
android:key="fuck_fcm"
android:title="绕过防沉迷"
android:summary="滞空防沉迷检测方法的调用实现无伤速通破解防沉迷,无需 Player 链接" />
android:summary="滞空防沉迷检测方法的调用实现无伤速通破解防沉迷,无需 Player 链接,不支持叽叽猫砸进里面的岛3,不支持内嵌社区网页的防沉迷,那不属于我的能力范围" />

<SwitchPreference
android:key="force_set_work_myown"
android:title="谋权篡位"
android:summary="伪装任意作品是你自己的,可以:\n直接编辑作品源码\n其他用途" />

</PreferenceCategory>

<PreferenceCategory android:title="已弃用">
<PreferenceCategory android:title="实验">
<SwitchPreference
android:key="force_show_rework"
android:title="强制显示再创作图标"
android:summary="使作品的 再创作 按钮永远显示,即使作品并未设置为开放源代码(显示了也没啥用,服务端给你拦截了作品未开源)" />
android:summary="使作品的 再创作 按钮永远显示,即使作品并未设置为开放源代码(显示了也没啥用,服务端给你拦截了,报错信息为 作品未开源,亲测无效" />

</PreferenceCategory>
</PreferenceScreen>

0 comments on commit b824665

Please sign in to comment.