mirror of
https://github.com/MoonLeeeaf/FuckMaoNemo.git
synced 2024-10-05 15:02:48 +00:00
This commit is contained in:
parent
525f842bea
commit
0d6e388ea8
|
@ -1,32 +1,32 @@
|
||||||
{
|
{
|
||||||
"allFiles": [
|
"allFiles": [
|
||||||
{
|
|
||||||
"file": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/src/main/res/xml/config.xml",
|
|
||||||
"selection": {
|
|
||||||
"end": {
|
|
||||||
"column": 83,
|
|
||||||
"index": 3436,
|
|
||||||
"line": 97
|
|
||||||
},
|
|
||||||
"start": {
|
|
||||||
"column": 83,
|
|
||||||
"index": 3436,
|
|
||||||
"line": 97
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"file": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/src/main/java/io/github/moonleeeaf/fuckmaonemo/Hook.java",
|
"file": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/src/main/java/io/github/moonleeeaf/fuckmaonemo/Hook.java",
|
||||||
"selection": {
|
"selection": {
|
||||||
"end": {
|
"end": {
|
||||||
"column": 58,
|
"column": 30,
|
||||||
"index": 8459,
|
"index": 4201,
|
||||||
"line": 207
|
"line": 112
|
||||||
},
|
},
|
||||||
"start": {
|
"start": {
|
||||||
"column": 58,
|
"column": 30,
|
||||||
"index": 8459,
|
"index": 4201,
|
||||||
"line": 207
|
"line": 112
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file": "/storage/emulated/0/MoonLeaf/Projects/FuckMaoNemo/app/src/main/res/xml/config.xml",
|
||||||
|
"selection": {
|
||||||
|
"end": {
|
||||||
|
"column": 27,
|
||||||
|
"index": 461,
|
||||||
|
"line": 13
|
||||||
|
},
|
||||||
|
"start": {
|
||||||
|
"column": 27,
|
||||||
|
"index": 461,
|
||||||
|
"line": 13
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,8 +12,8 @@ android {
|
||||||
applicationId "io.github.moonleeeaf.fuckmaonemo"
|
applicationId "io.github.moonleeeaf.fuckmaonemo"
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 33
|
targetSdk 33
|
||||||
versionCode 15000
|
versionCode 16000
|
||||||
versionName "1.5.0"
|
versionName "1.6.0"
|
||||||
|
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
useSupportLibrary true
|
useSupportLibrary true
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package io.github.moonleeeaf.fuckmaonemo;
|
package io.github.moonleeeaf.fuckmaonemo;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
|
@ -9,7 +11,10 @@ import android.os.Bundle;
|
||||||
import android.text.InputFilter;
|
import android.text.InputFilter;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.View;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.PopupMenu;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import de.robv.android.xposed.IXposedHookLoadPackage;
|
import de.robv.android.xposed.IXposedHookLoadPackage;
|
||||||
import de.robv.android.xposed.XC_MethodHook;
|
import de.robv.android.xposed.XC_MethodHook;
|
||||||
|
@ -98,6 +103,46 @@ public class Hook implements IXposedHookLoadPackage {
|
||||||
|
|
||||||
XposedBridge.log("[FuckMaoNemo] 注入中...");
|
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码
|
// 拦截40x码
|
||||||
load("fuck_40x", () -> {
|
load("fuck_40x", () -> {
|
||||||
XposedBridge.log("[FuckMaoNemo] Hook_拦截40x码");
|
XposedBridge.log("[FuckMaoNemo] Hook_拦截40x码");
|
||||||
|
@ -420,7 +465,11 @@ public class Hook implements IXposedHookLoadPackage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load(String pref, Callback cb) {
|
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 {
|
try {
|
||||||
cb.onCallback();
|
cb.onCallback();
|
||||||
nohengheng++;
|
nohengheng++;
|
||||||
|
|
|
@ -8,13 +8,23 @@
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
android:title="作者"
|
android:title="作者"
|
||||||
android:summary="编程猫 @满月叶\nGitHub @MoonLeeeaf\n喵呜~" />
|
android:summary="编程猫 @满月叶\nGitHub @MoonLeeeaf\nBiliBili @静之彼端\n喵呜~" />
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:title="提示"
|
||||||
|
android:summary="目前只支持 LSPosed\n其他暂未测试\n更改功能后重启生效" />
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="force_enable"
|
android:key="force_enable"
|
||||||
android:title="强制启用"
|
android:title="非官方客户端"
|
||||||
android:summary="如果你正在使用基于官方 Nemo 修改的客户端,那么可以打开此选项(记得配置模块作用域哦)" />
|
android:summary="如果你正在使用基于官方 Nemo 修改的客户端,那么可以打开此选项(记得配置模块作用域哦)" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="inject_settings_button"
|
||||||
|
android:title="注入设置菜单"
|
||||||
|
android:summary="字面意思"
|
||||||
|
android:defaultValue="true" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="网络">
|
<PreferenceCategory android:title="网络">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user