3 Commits

Author SHA1 Message Date
MoonLeeeaf
0d6e388ea8 feat: inject setting button
Some checks failed
Android CI / build (push) Failing after 14m58s
2024-08-03 10:04:48 +08:00
MoonLeeeaf
525f842bea docs: add screenshot
Some checks failed
Android CI / build (push) Failing after 14m57s
2024-08-01 11:14:23 +08:00
MoonLeeeaf
47828c8dce feat: force enable enter in desc editing 2024-08-01 11:06:05 +08:00
6 changed files with 127 additions and 21 deletions

View File

@@ -4,14 +4,14 @@
"file": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/src/main/java/io/github/moonleeeaf/fuckmaonemo/Hook.java",
"selection": {
"end": {
"column": 17,
"index": 6820,
"line": 170
"column": 30,
"index": 4201,
"line": 112
},
"start": {
"column": 17,
"index": 6820,
"line": 170
"column": 30,
"index": 4201,
"line": 112
}
}
},
@@ -19,17 +19,32 @@
"file": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/src/main/res/xml/config.xml",
"selection": {
"end": {
"column": 66,
"index": 3096,
"line": 88
"column": 27,
"index": 461,
"line": 13
},
"start": {
"column": 52,
"index": 3082,
"line": 88
"column": 27,
"index": 461,
"line": 13
}
}
},
{
"file": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/build.gradle",
"selection": {
"end": {
"column": 22,
"index": 272,
"line": 14
},
"start": {
"column": 22,
"index": 272,
"line": 14
}
}
}
],
"selectedFile": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/src/main/java/io/github/moonleeeaf/fuckmaonemo/Hook.java"
"selectedFile": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/build.gradle"
}

BIN
.github/6.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

View File

@@ -12,8 +12,8 @@ android {
applicationId "io.github.moonleeeaf.fuckmaonemo"
minSdk 21
targetSdk 33
versionCode 14000
versionName "1.4.0"
versionCode 16000
versionName "1.6.0"
vectorDrawables {
useSupportLibrary true

View File

@@ -1,12 +1,20 @@
package io.github.moonleeeaf.fuckmaonemo;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Application;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetManager;
import android.content.res.loader.AssetsProvider;
import android.os.Bundle;
import android.text.InputFilter;
import android.text.Spanned;
import android.util.Pair;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.PopupMenu;
import android.widget.Toast;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
@@ -95,6 +103,46 @@ public class Hook implements IXposedHookLoadPackage {
XposedBridge.log("[FuckMaoNemo] 注入中...");
// 劫持设置按钮的点击事件
load("inject_settings_button", () -> {
XposedBridge.log("[FuckMaoNemo] Hook_注入设置菜单");
XposedBridge.hookMethod(
getMethod(
XposedHelpers.findClass("com.codemao.nemo.fragment.MineFragment", classLoader),
"onClick",
View.class
),
new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam mp) throws Throwable {
View v = (View) mp.args[0];
if (v.getId() == 2131297099)
v.setId(11451419);
}
@Override
protected void afterHookedMethod(MethodHookParam mp) throws Throwable {
View v = (View) mp.args[0];
Context c = v.getContext();
if (v.getId() == 11451419) {
PopupMenu pop = new PopupMenu(c, v);
Menu m = pop.getMenu();
m.add("Nemo设置").setOnMenuItemClickListener((mm) -> {
c.startActivity(new Intent(c, XposedHelpers.findClass("com.codemao.nemo.activity.SettingActivity", classLoader)));
return false;
});
m.add("模块设置").setOnMenuItemClickListener((mm) -> {
c.startActivity(new Intent().setComponent(new ComponentName("io.github.moonleeeaf.fuckmaonemo", ConfigActivity.class.getName())));
return false;
});
pop.show();
mp.setResult(null);
}
}
}
);
}, true);
// 拦截40x码
load("fuck_40x", () -> {
XposedBridge.log("[FuckMaoNemo] Hook_拦截40x码");
@@ -189,6 +237,25 @@ public class Hook implements IXposedHookLoadPackage {
);
});
// 我就要个人信息换行
load("remove_edit_desc_filter", () -> {
XposedBridge.log("[FuckMaoNemo] Hook_我就要个人信息换行");
XposedBridge.hookMethod(
getMethod(
XposedHelpers.findClass("com.codemao.nemo.activity.UserNameDesEditActivity", classLoader),
"initView",
null
),
new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam mp) throws Throwable {
EditText e = (EditText) XposedHelpers.getObjectField(mp.thisObject, "editText");
e.setFilters(new InputFilter[]{});
}
}
);
});
// 作品没有失效
load("work_is_valid", () -> {
XposedBridge.log("[FuckMaoNemo] Hook_作品没有失效");
@@ -398,7 +465,11 @@ public class Hook implements IXposedHookLoadPackage {
}
public void load(String pref, Callback cb) {
if (xsp.getBoolean(pref, false)) {
load(pref, cb ,false);
}
public void load(String pref, Callback cb, boolean def) {
if (xsp.getBoolean(pref, def)) {
try {
cb.onCallback();
nohengheng++;

View File

@@ -8,12 +8,22 @@
<Preference
android:title="作者"
android:summary="编程猫 @满月叶\nGitHub @MoonLeeeaf\n喵呜~" />
android:summary="编程猫 @满月叶\nGitHub @MoonLeeeaf\nBiliBili @静之彼端\n喵呜~" />
<Preference
android:title="提示"
android:summary="目前只支持 LSPosed\n其他暂未测试\n更改功能后重启生效" />
<SwitchPreference
android:key="force_enable"
android:title="强制启用"
android:title="非官方客户端"
android:summary="如果你正在使用基于官方 Nemo 修改的客户端,那么可以打开此选项(记得配置模块作用域哦)" />
<SwitchPreference
android:key="inject_settings_button"
android:title="注入设置菜单"
android:summary="字面意思"
android:defaultValue="true" />
</PreferenceCategory>
@@ -86,7 +96,16 @@
<SwitchPreference
android:key="fix_kn_player"
android:title="修复 KN 作品无法打开"
android:summary="去你吗的Nemo推广(UA检测),去你妈的 ?is_nemo_player 害得我无法打开我直接把它机吧割了QSWL\n本功能仅需要时启用5.0.0用户请不要启用" />
android:summary="去你吗的Nemo推广(UA检测),去你妈的 ?is_nemo_player 害得我无法打开我直接把它机吧割了QSWL\n本功能仅需要时启用5.0.0用户请不要启用" />
</PreferenceCategory>
<PreferenceCategory android:title="实验">
<SwitchPreference
android:key="remove_edit_desc_filter"
android:title="我就要个人信息换行"
android:summary="删除个人简介编辑页面的过滤器以达到不过滤换行符号的目的(注意:暂时不能手动输入,暂时用复制粘贴换行符来替代)" />
</PreferenceCategory>
@@ -94,8 +113,8 @@
<SwitchPreference
android:key="test"
android:title="未命名实验功能"
android:summary="实验" />
android:title="Unnamed Feature"
android:summary="setFork_user(B)V" />
<SwitchPreference
android:key="force_show_rework"

View File

@@ -5,3 +5,4 @@
![评论区接口提示](.github/3.jpg)
![绕过封号查看资料卡](.github/4.jpg)
![阻止401响应码异常登出](.github/5.jpg)
![强制允许编辑简介时换行](.github/6.png)