diff --git a/app/build.gradle b/app/build.gradle
index 44543bf..0695858 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,7 +6,7 @@ android {
defaultConfig {
applicationId "moe.reimu.weiboxposed"
- minSdkVersion 19
+ minSdkVersion 21
targetSdkVersion 23
versionCode 2
versionName "1.0.1"
@@ -21,4 +21,6 @@ android {
dependencies {
provided 'de.robv.android.xposed:api:82'
+ compile 'com.android.support:support-v4:23.4.0'
+ compile 'com.android.support:design:23.4.0'
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 84b6b10..42ba5f8 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,20 +1,32 @@
-
+
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.Material.Light">
+ android:value="true"/>
+ android:value="@string/module_desc"/>
+ android:value="30"/>
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/app/src/main/java/moe/reimu/weiboxposed/Module.java b/app/src/main/java/moe/reimu/weiboxposed/Module.java
index 1d6ae9a..0b84f96 100644
--- a/app/src/main/java/moe/reimu/weiboxposed/Module.java
+++ b/app/src/main/java/moe/reimu/weiboxposed/Module.java
@@ -1,10 +1,12 @@
package moe.reimu.weiboxposed;
+import android.app.AndroidAppHelper;
import android.content.res.XResources;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.View;
import android.widget.RelativeLayout;
+import android.widget.TextView;
import org.json.JSONArray;
import org.json.JSONObject;
@@ -14,15 +16,18 @@
import de.robv.android.xposed.IXposedHookInitPackageResources;
import de.robv.android.xposed.IXposedHookLoadPackage;
+import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.XC_MethodHook;
+import de.robv.android.xposed.XSharedPreferences;
+import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_InitPackageResources.InitPackageResourcesParam;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
import static de.robv.android.xposed.XposedHelpers.getObjectField;
-public class Module implements IXposedHookInitPackageResources, IXposedHookLoadPackage {
-
+public class Module implements IXposedHookInitPackageResources, IXposedHookLoadPackage, IXposedHookZygoteInit {
+ public XSharedPreferences prefs;
@Override
public void handleInitPackageResources(InitPackageResourcesParam resparam) throws Throwable {
if (!resparam.packageName.equals("com.sina.weibo"))
@@ -37,6 +42,11 @@ public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) thr
if (!lpparam.packageName.equals("com.sina.weibo"))
return;
+ prefs.reload();
+ boolean useExpMethod = prefs.getBoolean("switch_remove_mode", false);
+ XposedBridge.log("[WeiboXposed] App Weibo Loaded");
+ XposedBridge.log("[WeiboXposed] Remove Mode: " + useExpMethod);
+
XC_MethodHook callbackCancel = new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
@@ -57,7 +67,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
});
findAndHookMethod(LIST_BASE, lpparam.classLoader, "insetTrend", callbackCancel);
- XC_MethodHook removeAD = new XC_MethodHook() {
+ XC_MethodHook removeAD_Old = new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
ArrayList