Skip to content

Commit

Permalink
v1.09
Browse files Browse the repository at this point in the history
更新gradle版本;新增微信登录自动确认;
  • Loading branch information
su committed May 14, 2018
1 parent 1ad324e commit 8225fbc
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 12 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
24 changes: 14 additions & 10 deletions wechathelper/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'

android {
compileSdkVersion 26
defaultConfig {
applicationId "com.wuxiaosu.wechathelper"
minSdkVersion 21
targetSdkVersion 23
versionCode 9
versionName "1.08"
versionCode 10
versionName "1.09"
}

signingConfigs {
Expand Down Expand Up @@ -61,6 +60,11 @@ android {
}

}

lintOptions {
abortOnError false
}

}

repositories {
Expand All @@ -72,14 +76,14 @@ repositories {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:26.1.0'
provided 'de.robv.android.xposed:api:82'
compile 'me.weishu:epic:0.3.6'
compile 'com.jaeger.statusbarutil:library:1.4.0'
compile 'com.github.arimorty:floatingsearchview:2.1.1'
compile 'com.jakewharton:butterknife:8.8.1'
implementation 'com.android.support:appcompat-v7:26.1.0'
compileOnly 'de.robv.android.xposed:api:82'
implementation 'me.weishu:epic:0.3.6'
implementation 'com.jaeger.statusbarutil:library:1.4.0'
implementation 'com.github.arimorty:floatingsearchview:2.1.1'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile project(':tencentmaplitelib')
implementation project(':tencentmaplitelib')
implementation 'com.github.wuxiaosu:SettingLabelView:2.0@aar'
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import com.wuxiaosu.wechathelper.hook.EmojiGameHook;
import com.wuxiaosu.wechathelper.hook.ExdeviceRankHook;
import com.wuxiaosu.wechathelper.hook.ExtDeviceWXLoginUIHook;
import com.wuxiaosu.wechathelper.hook.LauncherUIHook;
import com.wuxiaosu.wechathelper.hook.MoneyHook;
import com.wuxiaosu.wechathelper.hook.RevokeMsgHook;
Expand Down Expand Up @@ -100,6 +101,7 @@ private void handleHook(ClassLoader classLoader, String versionName) {
LauncherUIHook.getInstance().init(classLoader, versionName);
ExdeviceRankHook.getInstance().init(classLoader, versionName);
RevokeMsgHook.getInstance().init(classLoader, versionName);
ExtDeviceWXLoginUIHook.getInstance().init(classLoader, versionName);
// XLogHook.getInstance().init(classLoader, versionName);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.wuxiaosu.wechathelper.hook;

import android.annotation.SuppressLint;
import android.widget.Button;

import com.wuxiaosu.wechathelper.utils.Constant;
import com.wuxiaosu.widget.utils.PropertiesUtils;

import java.lang.reflect.Field;

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;


/**
* Created by su on 2018/05/13.
* 自动登录
*/
public class ExtDeviceWXLoginUIHook {

private boolean pcAutoLogin;

private ExtDeviceWXLoginUIHook() {
}

private ClassLoader classLoader;

public void init(ClassLoader classLoader, String versionName) {
if (this.classLoader == null) {
this.classLoader = classLoader;
hook(classLoader);
}
}

public static ExtDeviceWXLoginUIHook getInstance() {
return ExtDeviceWXLoginUIHook.SingletonHolder.instance;
}

private static class SingletonHolder {
@SuppressLint("StaticFieldLeak")
private static final ExtDeviceWXLoginUIHook instance = new ExtDeviceWXLoginUIHook();
}

private void hook(final ClassLoader classLoader) {
pcAutoLogin = Boolean.valueOf(PropertiesUtils.getValue(Constant.PRO_FILE, "pc_auto_login", "false"));

if (!pcAutoLogin) {
return;
}

try {
final Class extDeviceWXLoginUIHookClazz = XposedHelpers.findClass("com.tencent.mm.plugin.webwx.ui.ExtDeviceWXLoginUI", classLoader);
XposedHelpers.findAndHookMethod(extDeviceWXLoginUIHookClazz, "initView",
new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Object object = param.thisObject;
Field[] fields = extDeviceWXLoginUIHookClazz.getDeclaredFields();
for (Field field : fields) {
Object objectField = XposedHelpers.getObjectField(object, field.getName());
if (objectField instanceof Button && ((Button) objectField).getText().toString().equals("登录")) {
((Button) objectField).callOnClick();
break;
}
}
super.afterHookedMethod(param);
}
});
} catch (Error | Exception e) {
XposedBridge.log(e);
}
}
}
8 changes: 8 additions & 0 deletions wechathelper/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@
app:label_text="隐藏“发现页”"
app:preferences_key="@string/pre_key_hide_discover"
app:subheading_text="设置改变需重启微信" />

<com.wuxiaosu.widget.SettingLabelView
style="@style/SettingLayout"
app:external_path="@string/external_path"
app:is_external="true"
app:label_text="微信登录自动确认"
app:preferences_key="@string/pre_key_pc_auto_login"
app:subheading_text="设置改变需重启微信" />
</LinearLayout>
</ScrollView>
</FrameLayout>
Expand Down
1 change: 1 addition & 0 deletions wechathelper/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<string name="pre_key_disable_revoke">disable_revoke</string>
<string name="pre_key_hide_discover">hide_discover</string>
<string name="pre_key_fake_launcher_menu">fake_launcher_menu</string>
<string name="pre_key_pc_auto_login">pc_auto_login</string>


<string name="external_path">wechathelper</string>
Expand Down

0 comments on commit 8225fbc

Please sign in to comment.