Skip to content

Commit 301d641

Browse files
committed
Support qq long password
1 parent 78b34e0 commit 301d641

File tree

9 files changed

+271
-26
lines changed

9 files changed

+271
-26
lines changed

app/build.gradle

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,27 @@ task debugQQ(dependsOn: ["installDebug", stopQQ]) {
143143
}
144144
}
145145

146+
task stopMultiQQ {
147+
doLast {
148+
println "Stop MultiQQ..."
149+
exec {
150+
executable = ADB_PATH
151+
args = ['shell', "am force-stop --user 95 com.tencent.mobileqq"]
152+
}
153+
}
154+
}
155+
156+
task debugMultiQQ(dependsOn: ["installDebug", stopMultiQQ]) {
157+
doLast {
158+
println "Start MultiQQ..."
159+
exec {
160+
executable = ADB_PATH
161+
args = ['shell', "am start -n com.tencent.mobileqq/.activity.SplashActivity --user 95"]
162+
}
163+
164+
}
165+
}
166+
146167
dependencies {
147168
implementation 'com.android.support:support-v4:26.0.2'
148169
implementation 'com.wei.android.lib:fingerprintidentify:1.2.1'
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.yyxx.wechatfp.util;
2+
3+
import android.content.Context;
4+
import android.content.res.Configuration;
5+
import android.view.View;
6+
import android.view.inputmethod.InputMethodManager;
7+
8+
import com.yyxx.wechatfp.util.log.L;
9+
10+
/**
11+
* Created by Jason on 2017/8/5.
12+
*/
13+
14+
public class KeyboardUtils {
15+
16+
public static void switchIme(View view, boolean show) {
17+
18+
try {
19+
Context context = view.getContext();
20+
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
21+
22+
if (context.getResources().getConfiguration().hardKeyboardHidden != Configuration.HARDKEYBOARDHIDDEN_YES) {
23+
show = false;
24+
}
25+
if (show) { // 显示键盘,即输入法
26+
if (imm != null) {
27+
imm.showSoftInput(view, 0);
28+
}
29+
} else { // 隐藏键盘
30+
if (imm != null) {
31+
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
32+
}
33+
}
34+
} catch (Exception | Error e) {
35+
L.e(e);
36+
}
37+
}
38+
}

app/src/main/java/com/yyxx/wechatfp/util/ViewUtil.java

Lines changed: 110 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,35 @@
1010
import android.os.Build;
1111
import android.os.SystemClock;
1212
import android.support.annotation.Nullable;
13+
import android.support.v7.widget.AppCompatImageView;
14+
import android.support.v7.widget.ButtonBarLayout;
15+
import android.support.v7.widget.ListViewCompat;
16+
import android.support.v7.widget.SwitchCompat;
1317
import android.text.TextUtils;
1418
import android.view.MotionEvent;
1519
import android.view.View;
1620
import android.view.ViewGroup;
1721
import android.view.ViewParent;
22+
import android.widget.CheckBox;
23+
import android.widget.CheckedTextView;
24+
import android.widget.EditText;
25+
import android.widget.FrameLayout;
26+
import android.widget.GridLayout;
27+
import android.widget.GridView;
28+
import android.widget.ImageView;
29+
import android.widget.LinearLayout;
30+
import android.widget.ListView;
31+
import android.widget.ProgressBar;
32+
import android.widget.QuickContactBadge;
33+
import android.widget.RadioButton;
34+
import android.widget.RatingBar;
35+
import android.widget.RelativeLayout;
36+
import android.widget.SeekBar;
37+
import android.widget.Space;
38+
import android.widget.Spinner;
39+
import android.widget.Switch;
40+
import android.widget.TableLayout;
41+
import android.widget.TableRow;
1842
import android.widget.TextView;
1943

2044
import com.yyxx.wechatfp.util.log.L;
@@ -160,10 +184,78 @@ public static View findViewByText(View rootView, String... names) {
160184
return null;
161185
}
162186

187+
private static Class sRecycleViewClz;
188+
189+
private static String getViewBaseDesc(View view) {
190+
if (sRecycleViewClz == null) {
191+
try {
192+
sRecycleViewClz = Class.forName("android.support.v7.widget.RecyclerView");
193+
} catch (ClassNotFoundException e) {
194+
}
195+
}
196+
197+
if (view instanceof FrameLayout) {
198+
return FrameLayout.class.getName();
199+
} else if (view instanceof RatingBar) {
200+
return RatingBar.class.getName();
201+
} else if (view instanceof SeekBar) {
202+
return SeekBar.class.getName();
203+
} else if (view instanceof TableLayout) {
204+
return TableLayout.class.getName();
205+
} else if (view instanceof ButtonBarLayout) {
206+
return ButtonBarLayout.class.getName();
207+
} else if (view instanceof TableRow) {
208+
return TableRow.class.getName();
209+
} else if (view instanceof LinearLayout) {
210+
return LinearLayout.class.getName();
211+
} else if (view instanceof RelativeLayout) {
212+
return RelativeLayout.class.getName();
213+
} else if (view instanceof GridLayout) {
214+
return GridLayout.class.getName();
215+
} else if (view instanceof CheckBox) {
216+
return CheckBox.class.getName();
217+
} else if (view instanceof RadioButton) {
218+
return RadioButton.class.getName();
219+
} else if (view instanceof CheckedTextView) {
220+
return CheckedTextView.class.getName();
221+
} else if (view instanceof Spinner) {
222+
return Spinner.class.getName();
223+
} else if (view instanceof ProgressBar) {
224+
return ProgressBar.class.getName();
225+
} else if (view instanceof QuickContactBadge) {
226+
return QuickContactBadge.class.getName();
227+
} else if (view instanceof SwitchCompat) {
228+
return SwitchCompat.class.getName();
229+
} else if (view instanceof Switch) {
230+
return Switch.class.getName();
231+
} else if (view instanceof Space) {
232+
return Space.class.getName();
233+
} else if (view instanceof TextView) {
234+
return TextView.class.getName();
235+
} else if (view instanceof AppCompatImageView) {
236+
return AppCompatImageView.class.getName();
237+
} else if (view instanceof ImageView) {
238+
return ImageView.class.getName();
239+
} else if (view instanceof ListViewCompat) {
240+
return ListViewCompat.class.getName();
241+
} else if (view instanceof ListView) {
242+
return ListView.class.getName();
243+
} else if (view instanceof GridView) {
244+
return ListView.class.getName();
245+
} else if (sRecycleViewClz != null && view.getClass().isAssignableFrom(sRecycleViewClz)) {
246+
return sRecycleViewClz.getName();
247+
}
248+
return view.getClass().getName();
249+
}
250+
163251
public static String getViewInfo(View view) {
164252
StringBuffer stringBuffer = new StringBuffer();
165253
stringBuffer.append(String.valueOf(view));
166-
if (view instanceof TextView) {
254+
stringBuffer.append(" type:").append(getViewBaseDesc(view));
255+
stringBuffer.append(" clz:").append(view.getClass().getName());
256+
if (view instanceof EditText) {
257+
stringBuffer.append(" text:").append(((EditText) view).getText()).append(" hint:").append(((EditText) view).getHint());
258+
} else if (view instanceof TextView) {
167259
stringBuffer.append(" text:").append(((TextView) view).getText());
168260
}
169261
int []location = new int[]{0,0};
@@ -173,9 +265,18 @@ public static String getViewInfo(View view) {
173265
if (!TextUtils.isEmpty(desc)) {
174266
stringBuffer.append(" desc:").append(desc);
175267
}
268+
stringBuffer.append(" tag:").append(view.getTag());
176269
return stringBuffer.toString();
177270
}
178271

272+
public static void recursiveLoopChildren(View view) {
273+
if (view instanceof ViewGroup) {
274+
recursiveLoopChildren((ViewGroup) view);
275+
} else {
276+
L.d("Empty view");
277+
}
278+
}
279+
179280
public static void recursiveLoopChildren(ViewGroup parent) {
180281
for (int i = parent.getChildCount() - 1; i >= 0; i--) {
181282
final View child = parent.getChildAt(i);
@@ -186,7 +287,7 @@ public static void recursiveLoopChildren(ViewGroup parent) {
186287
} else {
187288
if (child != null) {
188289
try {
189-
L.d("view", getViewInfo(child), child.getTag());
290+
L.d("view", getViewInfo(child));
190291
} catch (Exception e) {
191292

192293
}
@@ -202,7 +303,13 @@ public static void getChildViews(ViewGroup parent, String text, List<View> outLi
202303
if (child == null) {
203304
continue;
204305
}
205-
if (child instanceof TextView) {
306+
if (child instanceof EditText) {
307+
if (text.equals(String.valueOf(((TextView) child).getText()))) {
308+
outList.add(child);
309+
} else if (text.equals(String.valueOf(((EditText) child).getHint()))) {
310+
outList.add(child);
311+
}
312+
} else if (child instanceof TextView) {
206313
if (text.equals(String.valueOf(((TextView) child).getText()))) {
207314
outList.add(child);
208315
}

app/src/main/java/com/yyxx/wechatfp/view/PasswordInputView.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ private void initView(Context context) {
5555
mInputView.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
5656
String packageName = context.getPackageName();
5757
if (Constant.PACKAGE_NAME_ALIPAY.equals(packageName)
58-
|| Constant.PACKAGE_NAME_TAOBAO.equals(packageName)) {
58+
|| Constant.PACKAGE_NAME_TAOBAO.equals(packageName)
59+
|| Constant.PACKAGE_NAME_QQ.equals(packageName)
60+
) {
5961
mInputView.setInputType(InputType.TYPE_CLASS_TEXT
6062
| InputType.TYPE_TEXT_VARIATION_PASSWORD
6163
);

0 commit comments

Comments
 (0)