This commit is contained in:
@@ -59,10 +59,15 @@ android {
|
||||
}
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'com.google.android.material:material:1.3.0'
|
||||
|
||||
/*implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'*/
|
||||
@@ -89,6 +94,8 @@ dependencies {
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
implementation 'com.github.Levine1992:Abllib:V1.0'
|
||||
implementation 'com.getbase:floatingactionbutton:1.9.0'
|
||||
//noinspection GradleCompatible
|
||||
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||
api 'com.blankj:utilcode:1.23.7'
|
||||
}
|
||||
|
||||
@@ -1,22 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.derry.wechat">
|
||||
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||
<uses-permission
|
||||
android:name="android.permission.INJECT_EVENTS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.GET_TASKS" />
|
||||
<uses-permission android:name="android.permission.REORDER_TASKS" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" /> <!-- 这个权限用于进行网络定位 -->
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 这个权限用于访问GPS定位 -->
|
||||
<uses-permission android:name="android.permission.READ_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 读取手机通讯录 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 写入手机通讯录 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- 这个权限用于进行网络定位 -->
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 这个权限用于访问GPS定位 -->
|
||||
<uses-permission android:name="android.permission.WRITE_CONTACTS" /> <!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 用于读取手机当前的状态 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据 -->
|
||||
<!-- 下载权限 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> <!-- 访问网络,网络定位需要上网 -->
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- 腾讯bugly权限 -->
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" /> <!-- Bugly升级SDK权限配置开始 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- 二维码扫描 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 震动权限 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 摄像头权限 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 用于申请调用A-GPS模块 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 用于读取手机当前的状态 -->
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- 写入扩展存储,向扩展卡写入数据,用于写入缓存定位数据 -->
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- 获取手机录音机使用权限,听写、识别、语义理解需要用到此权限 -->
|
||||
<uses-permission android:name="android.permission.INTERNET" /> <!-- 读取联系人权限,上传联系人需要用到此权限 -->
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <!-- 网络权限,加载网络网页需要联网 -->
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 精确定位权限,允许一个程序访问精确位置(GPS定位) -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.WRITE_SETTINGS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
|
||||
<application
|
||||
android:name="com.xiangxue.common.base.BaseApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/atom_logo"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/atom_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".W_MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
android:enabled="true"
|
||||
android:theme="@style/Theme.Design.NoActionBar">
|
||||
<activity android:name=".Activity.W_MainActivity"
|
||||
android:exported="true">
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
</activity>
|
||||
<activity android:name=".WeChatPlate"/>
|
||||
<activity android:name=".Activity.WeChatPlate"/>
|
||||
<activity android:name=".Activity.WeChatChannelActivity"/>
|
||||
<service
|
||||
android:name=".abllib.AblService"
|
||||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
|
||||
android:enabled="true">
|
||||
<intent-filter android:priority="1000">
|
||||
<action android:name="android.accessibilityservice.AccessibilityService" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.accessibilityservice"
|
||||
android:resource="@xml/abl_service" />
|
||||
</service>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,14 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.derry.wechat.debug">
|
||||
|
||||
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||
<uses-permission
|
||||
android:name="android.permission.INJECT_EVENTS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.GET_TASKS" />
|
||||
<uses-permission android:name="android.permission.REORDER_TASKS" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" /> <!-- 这个权限用于进行网络定位 -->
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 这个权限用于访问GPS定位 -->
|
||||
<uses-permission android:name="android.permission.READ_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 读取手机通讯录 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 写入手机通讯录 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- 这个权限用于进行网络定位 -->
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 这个权限用于访问GPS定位 -->
|
||||
<uses-permission android:name="android.permission.WRITE_CONTACTS" /> <!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 用于读取手机当前的状态 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据 -->
|
||||
<!-- 下载权限 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> <!-- 访问网络,网络定位需要上网 -->
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- 腾讯bugly权限 -->
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" /> <!-- Bugly升级SDK权限配置开始 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- 二维码扫描 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 震动权限 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 摄像头权限 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 用于申请调用A-GPS模块 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 用于读取手机当前的状态 -->
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- 写入扩展存储,向扩展卡写入数据,用于写入缓存定位数据 -->
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- 获取手机录音机使用权限,听写、识别、语义理解需要用到此权限 -->
|
||||
<uses-permission android:name="android.permission.INTERNET" /> <!-- 读取联系人权限,上传联系人需要用到此权限 -->
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <!-- 网络权限,加载网络网页需要联网 -->
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- 精确定位权限,允许一个程序访问精确位置(GPS定位) -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_SETTINGS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_SECURE_SETTINGS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
|
||||
<application
|
||||
android:name="com.xiangxue.common.base.BaseApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:icon="@drawable/wechat"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:largeHeap="true"
|
||||
android:enabled="true"
|
||||
android:roundIcon="@drawable/wechat"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
android:theme="@style/Theme.Design.NoActionBar">
|
||||
<activity
|
||||
android:name="com.derry.wechat.Activity.WeChatChannelActivity"
|
||||
android:exported="false" />
|
||||
<activity android:name="com.derry.wechat.Activity.WeChatPlate"
|
||||
android:exported="true"/>
|
||||
<activity android:name=".Login_DebugActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -16,6 +87,18 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name="com.derry.wechat.abllib.AblService"
|
||||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
|
||||
android:enabled="true">
|
||||
<intent-filter android:priority="1000">
|
||||
<action android:name="android.accessibilityservice.AccessibilityService" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.accessibilityservice"
|
||||
android:resource="@xml/abl_service" />
|
||||
</service>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.derry.wechat.Activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.PopupWindow;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
|
||||
import com.derry.wechat.steps.TestAblStep1;
|
||||
|
||||
import com.derry.wechat.abllib.AblConfig;
|
||||
import com.derry.wechat.abllib.AblService;
|
||||
import com.derry.wechat.abllib.AblStepHandler;
|
||||
import com.derry.wechat.abllib.AblSteps;
|
||||
import com.derry.wechat.abllib.utils.AblUtil;
|
||||
import com.derry.wechat.debug.R;
|
||||
import com.derry.wechat.steps.TestAblStep2;
|
||||
import com.xiangxue.arouter_annotation.ARouter;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/**
|
||||
* xiaoading
|
||||
* @author Administrator
|
||||
* DYX 2021-12-2
|
||||
*/
|
||||
@ARouter(path = "/wechat/W_MainActivity")
|
||||
public class W_MainActivity extends AppCompatActivity {
|
||||
public static String APP_PACKAGE_NAME = "com.tencent.mm";
|
||||
private PopupWindow mPopCut;
|
||||
private Disposable mdDisposable;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.w_activity_main);
|
||||
//透明状态栏
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
|
||||
AblConfig.Builder()
|
||||
.setMonitoringPackageNames("com.tencent.mm")//微信包
|
||||
.setLogTag("DDD")//logtag,不设置默认是abllib
|
||||
.setStepMsgDelayMillis(3000)//步骤延迟时间
|
||||
.setFindViewMillisInFuture(10000)//寻找界面超时时间
|
||||
.setFindViewCountDownInterval(200)//寻找界面间隔时间
|
||||
.build().init();
|
||||
AblStepHandler.getInstance().initStepClass(new TestAblStep1() , new TestAblStep2());
|
||||
|
||||
AblUtil.getPermissions(W_MainActivity.this);
|
||||
|
||||
//adb shell pm grant com.derry.wechat android.permission.WRITE_SECURE_SETTINGS
|
||||
Settings.Secure.putString(getContentResolver(),
|
||||
Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, "com.derry.wechat/com.derry.wechat.abllib.AblService");
|
||||
Settings.Secure.putString(getContentResolver(),
|
||||
Settings.Secure.ACCESSIBILITY_ENABLED, "1");//1表示开启
|
||||
if (AblUtil.isAccessibilityServiceOpen(W_MainActivity.this)) {
|
||||
// Log.e("TIAOSHI###", "无障碍服务正常");
|
||||
ToastUtils.showShort( "无障碍服务正常");
|
||||
}else {
|
||||
ToastUtils.showShort( "无障碍服务异常");
|
||||
Settings.Secure.putString(getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, "com.derry.wechat/com.derry.wechat.abllib.AblService");
|
||||
Settings.Secure.putString(getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, "0");//1表示开启
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 底部导航栏
|
||||
*/
|
||||
Button mBtnCut = findViewById(R.id.cut);
|
||||
mBtnCut.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
@SuppressLint("InflateParams") View v = getLayoutInflater().inflate(R.layout.layout_pop,null);
|
||||
mPopCut = new PopupWindow(v, ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
mPopCut.setTouchable(true);
|
||||
mPopCut.setFocusable(true);
|
||||
mPopCut.showAtLocation(getWindow().getDecorView(), Gravity.BOTTOM,0,0);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 菜单
|
||||
*/
|
||||
Button mBtnRecommend = findViewById(R.id.recommed);
|
||||
mBtnRecommend.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(W_MainActivity.this, WeChatPlate.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
Button mBtnChannel = findViewById(R.id.channel);
|
||||
mBtnChannel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(W_MainActivity.this,WeChatChannelActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
Settings.Secure.putString(getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, "com.fisherbone.fuzhu/com.fisherbone.fuzhu.abllib.AblService");
|
||||
Settings.Secure.putString(getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, "0");//1表示开启
|
||||
|
||||
if (mdDisposable != null) {
|
||||
mdDisposable.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.derry.wechat.Activity;
|
||||
|
||||
import static com.derry.wechat.Activity.W_MainActivity.APP_PACKAGE_NAME;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.derry.wechat.abllib.AblStepHandler;
|
||||
import com.derry.wechat.abllib.AblSteps;
|
||||
import com.derry.wechat.abllib.utils.AblUtil;
|
||||
import com.derry.wechat.abllib.utils.AblViewUtil;
|
||||
import com.derry.wechat.debug.R;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* Dyx 2021-12-2
|
||||
*/
|
||||
public class WeChatChannelActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_we_chat_channel);
|
||||
//透明状态栏
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
|
||||
|
||||
WeChatControlWindow weChatControlWindow = new WeChatControlWindow(WeChatChannelActivity.this);
|
||||
Button mBtnChannelStart = findViewById(R.id.wechat_channel_start);
|
||||
mBtnChannelStart.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (AblUtil.isAccessibilityServiceOpen(WeChatChannelActivity.this)) {
|
||||
AblStepHandler.getInstance().setStop(false);
|
||||
//AblUtil.addSuspensionWindowView(WeChatChannelActivity.this,weChatControlWindow.initWindowView());
|
||||
launchapp(WeChatChannelActivity.this);
|
||||
AblViewUtil.mySleep(5);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_10);
|
||||
} else {
|
||||
AblUtil.openAccessibilitySettings();
|
||||
//ToastUtils.showShort("请先开启辅助服务");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//跳转页面的方法
|
||||
private void launchapp(Context context) {
|
||||
//判断当前手机是否有要跳入的app
|
||||
if (isAppInstalled(context)){
|
||||
//如果有根据包名跳转
|
||||
context.startActivity(context.getPackageManager().getLaunchIntentForPackage(APP_PACKAGE_NAME));
|
||||
}else{
|
||||
//如果没有,走进入系统商店找到这款APP,提示你去下载这款APP的程序
|
||||
goToMarket(context);
|
||||
}
|
||||
}
|
||||
//这里是进入应用商店,下载指定APP的方法。
|
||||
private void goToMarket(Context context) {
|
||||
Uri uri = Uri.parse("market://details?id=" + W_MainActivity.APP_PACKAGE_NAME);
|
||||
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
|
||||
try {
|
||||
context.startActivity(goToMarket);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
//这里是判断APP中是否有相应APP的方法
|
||||
private boolean isAppInstalled(Context context) {
|
||||
try {
|
||||
context.getPackageManager().getPackageInfo(W_MainActivity.APP_PACKAGE_NAME,0);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.derry.wechat.Activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.derry.wechat.abllib.AblService;
|
||||
import com.derry.wechat.abllib.AblStepHandler;
|
||||
import com.derry.wechat.debug.R;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* DYX 2021-12-3
|
||||
*/
|
||||
public class WeChatControlWindow {
|
||||
Context mContext;
|
||||
public WeChatControlWindow (Context mContext){
|
||||
this.mContext=mContext;
|
||||
}
|
||||
public View initWindowView(){//悬浮窗
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater)mContext.getSystemService
|
||||
(Context.LAYOUT_INFLATER_SERVICE);
|
||||
View view = View.inflate(mContext, R.layout.view_test_w, null);
|
||||
// view.findViewById(R.id.fu_btn_1).setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// if (AblUtil.isAccessibilityServiceOpen(W_MainActivity.this)) {
|
||||
// AblStepHandler.getInstance().setStop(false);
|
||||
// AblStepHandler.sendMsg(AblSteps.STEP_1);
|
||||
// } else {
|
||||
// ToastUtils.showShort("请先开启辅助服务");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
view.findViewById(R.id.fu_btn_2).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
WindowManager windowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
|
||||
windowManager.removeView(view);
|
||||
|
||||
}
|
||||
});
|
||||
view.findViewById(R.id.fu_btn_3).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AblStepHandler.getInstance().setStop(true);
|
||||
}
|
||||
});
|
||||
view.findViewById(R.id.fu_btn_4).setOnClickListener(new View.OnClickListener() {
|
||||
@SuppressLint("ObsoleteSdkInt")
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
AblService.getInstance().disableSelf();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.derry.wechat.Activity;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import android.view.WindowManager;
|
||||
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.derry.wechat.debug.R;
|
||||
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
public class WeChatPlate extends AppCompatActivity {
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.layout_wechatplate);
|
||||
//透明状态栏
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.derry.wechat;
|
||||
|
||||
import android.os.Message;
|
||||
|
||||
import com.levine.abllib.AblStepBase;
|
||||
|
||||
public class TestAblStep2 extends AblStepBase {
|
||||
@Override
|
||||
public void onStep(int step, Message msg) {
|
||||
switch (step){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
package com.derry.wechat;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
|
||||
import com.levine.abllib.AblConfig;
|
||||
import com.levine.abllib.AblService;
|
||||
import com.levine.abllib.AblStepHandler;
|
||||
import com.levine.abllib.AblSteps;
|
||||
import com.levine.abllib.utils.AblUtil;
|
||||
import com.xiangxue.arouter_annotation.ARouter;
|
||||
|
||||
/**
|
||||
* xiaoading
|
||||
*/
|
||||
@ARouter(path = "/wechat/W_MainActivity")
|
||||
public class W_MainActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.w_activity_main);
|
||||
AblConfig.Builder()
|
||||
.setMonitoringPackageNames("com.tencent.mm")//微信包
|
||||
.setLogTag("DDD")//logtag,不设置默认是abllib
|
||||
.setStepMsgDelayMillis(3000)//步骤延迟时间
|
||||
.setFindViewMillisInFuture(10000)//寻找界面超时时间
|
||||
.setFindViewCountDownInterval(200)//寻找界面间隔时间
|
||||
.build().init();
|
||||
AblStepHandler.getInstance().initStepClass(new TestAblStep1());
|
||||
findViewById(R.id.btn_1).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AblUtil.openAccessibilitySettings();
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_2).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AblUtil.addSuspensionWindowView(W_MainActivity.this,initWindowView());
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_3).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AblUtil.openDrawOverlaysAnth(W_MainActivity.this);
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_4).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (AblUtil.isAccessibilityServiceOpen(W_MainActivity.this)) {
|
||||
AblStepHandler.getInstance().setStop(false);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_1);
|
||||
} else {
|
||||
ToastUtils.showShort("请先开启辅助服务");
|
||||
}
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_5).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AblStepHandler.getInstance().setStop(true);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
private View initWindowView(){//悬浮窗
|
||||
View view = View.inflate(this, R.layout.view_test_w, null);
|
||||
view.findViewById(R.id.fu_btn_1).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (AblUtil.isAccessibilityServiceOpen(W_MainActivity.this)) {
|
||||
AblStepHandler.getInstance().setStop(false);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_1);
|
||||
} else {
|
||||
ToastUtils.showShort("请先开启辅助服务");
|
||||
}
|
||||
}
|
||||
});
|
||||
view.findViewById(R.id.fu_btn_2).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
|
||||
windowManager.removeView(view);
|
||||
}
|
||||
});
|
||||
view.findViewById(R.id.fu_btn_3).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AblStepHandler.getInstance().setStop(true);
|
||||
}
|
||||
});
|
||||
view.findViewById(R.id.fu_btn_4).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
AblService.getInstance().disableSelf();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
18
wechat/src/main/java/com/derry/wechat/WeChatConfig.java
Normal file
18
wechat/src/main/java/com/derry/wechat/WeChatConfig.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.derry.wechat;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* DYX 2021-12-3
|
||||
*/
|
||||
public class WeChatConfig {
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
public static String KEY_DEVICE_ID = "device_id";
|
||||
|
||||
/**
|
||||
* 设备是否已激活
|
||||
* 设备是否已激活 0是激活 1是未激活
|
||||
*/
|
||||
public static String IS_ACTIVATION = "activation";
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.derry.wechat;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.PopupWindow;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
|
||||
|
||||
public class WeChatPlate extends AppCompatActivity {
|
||||
private PopupWindow mPopCut;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.layout_wechatplate);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
|
||||
Button mBtnCut = findViewById(R.id.cut);
|
||||
mBtnCut.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
@SuppressLint("InflateParams") View v = getLayoutInflater().inflate(R.layout.layout_pop,null);
|
||||
mPopCut = new PopupWindow(v, ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
mPopCut.setTouchable(true);
|
||||
mPopCut.setFocusable(true);
|
||||
mPopCut.showAtLocation(getWindow().getDecorView(), Gravity.BOTTOM,0,0);
|
||||
}
|
||||
});
|
||||
|
||||
Button mBtnRecommend = findViewById(R.id.recommed);
|
||||
mBtnRecommend.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(WeChatPlate.this,W_MainActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
89
wechat/src/main/java/com/derry/wechat/abllib/AblConfig.java
Normal file
89
wechat/src/main/java/com/derry/wechat/abllib/AblConfig.java
Normal file
@@ -0,0 +1,89 @@
|
||||
package com.derry.wechat.abllib;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
|
||||
/**
|
||||
* 2019/4/21
|
||||
* 17:49
|
||||
* Levine
|
||||
* wechat 1483232332
|
||||
* @author Administrator
|
||||
* DYX 2021-11-30
|
||||
*/
|
||||
public class AblConfig {
|
||||
|
||||
private String mLogTag;
|
||||
private boolean mIsLog;
|
||||
private long mStepMsgDelayMillis;//消息延迟发送时间
|
||||
private long findViewMillisInFuture;//查找view倒计时总时长
|
||||
private long findViewCountDownInterval;//查找view检查间隔时间
|
||||
/**
|
||||
* 所监测的APP包名,如果不设置将会监听整个系统的界面变化,如果设置后只会监听指定包名的APP
|
||||
* 【暂时不用】
|
||||
*/
|
||||
public static String[] sMonitoringPackageNames;
|
||||
|
||||
private AblConfig(Builder builder) {
|
||||
mLogTag = builder.mLogTag;
|
||||
mIsLog = builder.mIsLog;
|
||||
sMonitoringPackageNames = builder.mMonitoringPackageNames;
|
||||
mStepMsgDelayMillis = builder.mStepMsgDelayMillis;
|
||||
findViewCountDownInterval = builder.findViewCountDownInterval;
|
||||
findViewMillisInFuture = builder.findViewMillisInFuture;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
LogUtils.getConfig().setGlobalTag(mLogTag);
|
||||
LogUtils.getConfig().setLogSwitch(mIsLog);
|
||||
AblStepHandler.getInstance().setStepMsgDelayMillis(mStepMsgDelayMillis);
|
||||
FindViewCountDown.countDownInterval = findViewCountDownInterval;
|
||||
FindViewCountDown.millisInFuture = findViewMillisInFuture;
|
||||
}
|
||||
|
||||
public static Builder Builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private String mLogTag = "abllib";
|
||||
private boolean mIsLog = true;
|
||||
private String[] mMonitoringPackageNames;
|
||||
private long mStepMsgDelayMillis = 2000;//步骤延迟发送时间
|
||||
private long findViewMillisInFuture = 10000;//查找view倒计时总时长
|
||||
private long findViewCountDownInterval = 500;//查找view检查间隔时间
|
||||
|
||||
public Builder setLogTag(String logTag) {
|
||||
mLogTag = logTag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setLog(boolean log) {
|
||||
mIsLog = log;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMonitoringPackageNames(String... monitoringPackageNames) {
|
||||
mMonitoringPackageNames = monitoringPackageNames;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setStepMsgDelayMillis(long stepMsgDelayMillis) {
|
||||
mStepMsgDelayMillis = stepMsgDelayMillis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setFindViewMillisInFuture(long findViewMillisInFuture) {
|
||||
this.findViewMillisInFuture = findViewMillisInFuture;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setFindViewCountDownInterval(long findViewCountDownInterval) {
|
||||
this.findViewCountDownInterval = findViewCountDownInterval;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AblConfig build() {
|
||||
return new AblConfig(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
64
wechat/src/main/java/com/derry/wechat/abllib/AblService.java
Normal file
64
wechat/src/main/java/com/derry/wechat/abllib/AblService.java
Normal file
@@ -0,0 +1,64 @@
|
||||
package com.derry.wechat.abllib;
|
||||
|
||||
import android.accessibilityservice.AccessibilityService;
|
||||
import android.accessibilityservice.AccessibilityServiceInfo;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
|
||||
|
||||
/**
|
||||
* 2019/4/21
|
||||
* 11:29
|
||||
* Levine
|
||||
* wechat 1483232332
|
||||
* @author Administrator
|
||||
*
|
||||
* DYX 2021-11-30
|
||||
*/
|
||||
public class AblService extends AccessibilityService {
|
||||
|
||||
private static AblService mAblService;
|
||||
|
||||
public static AblService getInstance() {
|
||||
if (mAblService == null) {
|
||||
throw new NullPointerException("AblService辅助服务未开启");
|
||||
}
|
||||
return mAblService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
mAblService = this;
|
||||
init();
|
||||
}
|
||||
private void init() {
|
||||
|
||||
}
|
||||
@Override
|
||||
protected boolean onGesture(int gestureId) {
|
||||
return super.onGesture(gestureId);
|
||||
}
|
||||
@Override
|
||||
protected void onServiceConnected() {
|
||||
super.onServiceConnected();
|
||||
LogUtils.v("onServiceConnected");
|
||||
AccessibilityServiceInfo config = new AccessibilityServiceInfo();
|
||||
//配置监听的事件类型为界面变化|点击事件
|
||||
config.eventTypes = AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED | AccessibilityEvent.TYPE_VIEW_CLICKED;
|
||||
config.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
|
||||
config.flags = AccessibilityServiceInfo.FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY;
|
||||
setServiceInfo(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccessibilityEvent(AccessibilityEvent event) {
|
||||
// LogUtils.v(event.getPackageName() + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInterrupt() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.derry.wechat.abllib;
|
||||
|
||||
/**
|
||||
* 2019/4/21
|
||||
* 16:44
|
||||
* Levine
|
||||
* wechat 1483232332
|
||||
* @author Administrator
|
||||
* DYX 2021-12-1
|
||||
*/
|
||||
public abstract class AblStepBase implements AblStepHandler.StepListener {
|
||||
}
|
||||
215
wechat/src/main/java/com/derry/wechat/abllib/AblStepHandler.java
Normal file
215
wechat/src/main/java/com/derry/wechat/abllib/AblStepHandler.java
Normal file
@@ -0,0 +1,215 @@
|
||||
package com.derry.wechat.abllib;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 2019/4/21
|
||||
* 14:36
|
||||
* Levine
|
||||
* wechat 1483232332
|
||||
* @author Administrator
|
||||
* DYX 2021-12-2
|
||||
*/
|
||||
public class AblStepHandler extends Handler {
|
||||
|
||||
private static AblStepHandler instance;
|
||||
private List<StepListener> mStepListeners = new ArrayList<>();
|
||||
private boolean isStop = true;//是否停止
|
||||
private String[] mDatas;//数据
|
||||
private long mStepMsgDelayMillis = 2000;//消息延迟发送时间
|
||||
private List<String> mInitializedSteps = new ArrayList<>();//已经初始化过的步骤
|
||||
|
||||
private AblStepHandler() {
|
||||
super(Looper.getMainLooper());
|
||||
}
|
||||
|
||||
public static AblStepHandler getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized (AblStepHandler.class) {
|
||||
if (instance == null) {
|
||||
instance = new AblStepHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送handler执行消息
|
||||
*
|
||||
* @param step 步骤
|
||||
* @param delayMillis 延迟时间
|
||||
* @param datas 数据
|
||||
*/
|
||||
public static void sendMsg(int step, long delayMillis, String... datas) {
|
||||
AblStepHandler ablStepHandler = AblStepHandler.getInstance();
|
||||
if (datas != null && datas.length > 0) {
|
||||
ablStepHandler.setDatas(datas);
|
||||
}
|
||||
ablStepHandler.sendEmptyMessageDelayed(step, delayMillis);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送handler执行消息
|
||||
*
|
||||
* @param step 步骤
|
||||
* @param delayMillis 延迟时间
|
||||
*/
|
||||
public static void sendMsg(int step, long delayMillis) {
|
||||
sendMsg(step, delayMillis, new String[]{});
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送handler执行消息
|
||||
*
|
||||
* @param step 步骤
|
||||
* @param datas 数据
|
||||
*/
|
||||
public static void sendMsg(int step, String... datas) {
|
||||
sendMsg(step, AblStepHandler.getInstance().getStepMsgDelayMillis(), datas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送handler执行消息
|
||||
*
|
||||
* @param step 步骤
|
||||
*/
|
||||
public static void sendMsg(int step) {
|
||||
sendMsg(step, AblStepHandler.getInstance().getStepMsgDelayMillis(), new String[]{});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据viewid或文字发送执行消息
|
||||
*
|
||||
* @param millisInFuture view查找超时时间
|
||||
* @param countDownInterval 查找间隔时间
|
||||
* @param step 步骤
|
||||
*/
|
||||
public static void sendMsgByView(
|
||||
long millisInFuture,
|
||||
long countDownInterval,
|
||||
int step,
|
||||
String... nextMsgViewIdOrText
|
||||
) {
|
||||
FindViewCountDown.start(millisInFuture, countDownInterval, step, nextMsgViewIdOrText);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据viewid或文字发送执行消息
|
||||
*
|
||||
* @param millisInFuture view查找超时时间
|
||||
* @param countDownInterval 查找间隔时间
|
||||
* @param callBack 回调,注:如果回调不为空将不发送消息,要发送消息就自己在成功的回调里发送
|
||||
* @param viewIdOrText viewid或者文字内容
|
||||
*/
|
||||
public static void sendMsgByView(
|
||||
long millisInFuture,
|
||||
long countDownInterval,
|
||||
@NonNull FindViewCountDown.CallBack callBack,
|
||||
String... viewIdOrText
|
||||
) {
|
||||
FindViewCountDown.start(millisInFuture, countDownInterval, callBack, viewIdOrText);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据viewid或文字发送执行消息
|
||||
*
|
||||
* @param step 步骤
|
||||
* @param viewIdOrText viewid或者文字内容
|
||||
*/
|
||||
public static void sendMsgByView(
|
||||
int step,
|
||||
String... viewIdOrText
|
||||
) {
|
||||
FindViewCountDown.start(step, viewIdOrText);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据viewid或文字发送执行消息
|
||||
*
|
||||
* @param callBack 回调,注:如果回调不为空将不发送消息,要发送消息就自己在成功的回调里发送
|
||||
* @param viewIdOrText viewid或者文字内容
|
||||
*/
|
||||
public static void sendMsgByView(
|
||||
@NonNull FindViewCountDown.CallBack callBack,
|
||||
String... viewIdOrText
|
||||
) {
|
||||
FindViewCountDown.start(callBack, viewIdOrText);
|
||||
}
|
||||
|
||||
|
||||
public String[] getDatas() {
|
||||
return mDatas;
|
||||
}
|
||||
|
||||
public void setDatas(String... datas) {
|
||||
mDatas = datas;
|
||||
}
|
||||
|
||||
public long getStepMsgDelayMillis() {
|
||||
return mStepMsgDelayMillis;
|
||||
}
|
||||
|
||||
public void setStepMsgDelayMillis(long msgDelayMillis) {
|
||||
mStepMsgDelayMillis = msgDelayMillis;
|
||||
}
|
||||
|
||||
public boolean isStop() {
|
||||
|
||||
return isStop;
|
||||
}
|
||||
|
||||
public void setStop(boolean stop) {
|
||||
isStop = stop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (isStop) {
|
||||
return;
|
||||
}
|
||||
LogUtils.v("step", msg.what);
|
||||
for (StepListener stepListener : mStepListeners) {
|
||||
stepListener.onStep(msg.what, msg);
|
||||
}
|
||||
}
|
||||
|
||||
private void addStepListener(StepListener handleMessageListener) {
|
||||
mStepListeners.add(handleMessageListener);
|
||||
}
|
||||
|
||||
public void removeStepListener(StepListener handleMessageListener) {
|
||||
mStepListeners.remove(handleMessageListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化步骤实现类
|
||||
*
|
||||
* @param ablStepBases 继承了StepBase的实现类
|
||||
*/
|
||||
public void initStepClass(AblStepBase... ablStepBases) {
|
||||
for (AblStepBase ablStepBase : ablStepBases) {
|
||||
if (mInitializedSteps.contains(ablStepBase.getClass().getName())) {
|
||||
LogUtils.e(ablStepBase.getClass().getName() + "已经初始化,请勿重复初始化");
|
||||
continue;
|
||||
}
|
||||
addStepListener(ablStepBase);
|
||||
mInitializedSteps.add(ablStepBase.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
public interface StepListener {
|
||||
void onStep(int step, Message msg);
|
||||
}
|
||||
|
||||
}
|
||||
234
wechat/src/main/java/com/derry/wechat/abllib/AblSteps.java
Normal file
234
wechat/src/main/java/com/derry/wechat/abllib/AblSteps.java
Normal file
@@ -0,0 +1,234 @@
|
||||
package com.derry.wechat.abllib;
|
||||
|
||||
/**
|
||||
* 2019/4/21
|
||||
* 18:33
|
||||
* Levine
|
||||
* wechat 1483232332
|
||||
* @author Administrator
|
||||
* DYX 2021-12-2
|
||||
*/
|
||||
public class AblSteps {
|
||||
/**
|
||||
* 全局静态常量步骤标识1~200,不够自己再加,从200开始加,基本应该都是够的了
|
||||
*/
|
||||
public final static int STEP_1 = 1;
|
||||
public final static int STEP_2 = 2;
|
||||
public final static int STEP_3 = 3;
|
||||
public final static int STEP_4 = 4;
|
||||
public final static int STEP_5 = 5;
|
||||
public final static int STEP_6 = 6;
|
||||
public final static int STEP_7 = 7;
|
||||
public final static int STEP_8 = 8;
|
||||
public final static int STEP_9 = 9;
|
||||
/*****************************************/
|
||||
public final static int STEP_10 = 10;
|
||||
public final static int STEP_11 = 11;
|
||||
public final static int STEP_12 = 12;
|
||||
public final static int STEP_13 = 13;
|
||||
public final static int STEP_14 = 14;
|
||||
public final static int STEP_15 = 15;
|
||||
public final static int STEP_16 = 16;
|
||||
public final static int STEP_17 = 17;
|
||||
public final static int STEP_18 = 18;
|
||||
public final static int STEP_19 = 19;
|
||||
/*****************************************/
|
||||
public final static int STEP_20 = 20;
|
||||
public final static int STEP_21 = 21;
|
||||
public final static int STEP_22 = 22;
|
||||
public final static int STEP_23 = 23;
|
||||
public final static int STEP_24 = 24;
|
||||
public final static int STEP_25 = 25;
|
||||
public final static int STEP_26 = 26;
|
||||
public final static int STEP_27 = 27;
|
||||
public final static int STEP_28 = 28;
|
||||
public final static int STEP_29 = 29;
|
||||
/*****************************************/
|
||||
public final static int STEP_30 = 30;
|
||||
public final static int STEP_31 = 31;
|
||||
public final static int STEP_32 = 32;
|
||||
public final static int STEP_33 = 33;
|
||||
public final static int STEP_34 = 34;
|
||||
public final static int STEP_35 = 35;
|
||||
public final static int STEP_36 = 36;
|
||||
public final static int STEP_37 = 37;
|
||||
public final static int STEP_38 = 38;
|
||||
public final static int STEP_39 = 39;
|
||||
/*****************************************/
|
||||
public final static int STEP_40 = 40;
|
||||
public final static int STEP_41 = 41;
|
||||
public final static int STEP_42 = 42;
|
||||
public final static int STEP_43 = 43;
|
||||
public final static int STEP_44 = 44;
|
||||
public final static int STEP_45 = 45;
|
||||
public final static int STEP_46 = 46;
|
||||
public final static int STEP_47 = 47;
|
||||
public final static int STEP_48 = 48;
|
||||
public final static int STEP_49 = 49;
|
||||
/*****************************************/
|
||||
public final static int STEP_50 = 50;
|
||||
public final static int STEP_51 = 51;
|
||||
public final static int STEP_52 = 52;
|
||||
public final static int STEP_53 = 53;
|
||||
public final static int STEP_54 = 54;
|
||||
public final static int STEP_55 = 55;
|
||||
public final static int STEP_56 = 56;
|
||||
public final static int STEP_57 = 57;
|
||||
public final static int STEP_58 = 58;
|
||||
public final static int STEP_59 = 59;
|
||||
/*****************************************/
|
||||
public final static int STEP_60 = 60;
|
||||
public final static int STEP_61 = 61;
|
||||
public final static int STEP_62 = 62;
|
||||
public final static int STEP_63 = 63;
|
||||
public final static int STEP_64 = 64;
|
||||
public final static int STEP_65 = 65;
|
||||
public final static int STEP_66 = 66;
|
||||
public final static int STEP_67 = 67;
|
||||
public final static int STEP_68 = 68;
|
||||
public final static int STEP_69 = 69;
|
||||
/*****************************************/
|
||||
public final static int STEP_70 = 70;
|
||||
public final static int STEP_71 = 71;
|
||||
public final static int STEP_72 = 72;
|
||||
public final static int STEP_73 = 73;
|
||||
public final static int STEP_74 = 74;
|
||||
public final static int STEP_75 = 75;
|
||||
public final static int STEP_76 = 76;
|
||||
public final static int STEP_77 = 77;
|
||||
public final static int STEP_78 = 78;
|
||||
public final static int STEP_79 = 79;
|
||||
/*****************************************/
|
||||
public final static int STEP_80 = 80;
|
||||
public final static int STEP_81 = 81;
|
||||
public final static int STEP_82 = 82;
|
||||
public final static int STEP_83 = 83;
|
||||
public final static int STEP_84 = 84;
|
||||
public final static int STEP_85 = 85;
|
||||
public final static int STEP_86 = 86;
|
||||
public final static int STEP_87 = 87;
|
||||
public final static int STEP_88 = 88;
|
||||
public final static int STEP_89 = 89;
|
||||
/*****************************************/
|
||||
public final static int STEP_90 = 90;
|
||||
public final static int STEP_91 = 91;
|
||||
public final static int STEP_92 = 92;
|
||||
public final static int STEP_93 = 93;
|
||||
public final static int STEP_94 = 94;
|
||||
public final static int STEP_95 = 95;
|
||||
public final static int STEP_96 = 96;
|
||||
public final static int STEP_97 = 97;
|
||||
public final static int STEP_98 = 98;
|
||||
public final static int STEP_99 = 99;
|
||||
/*****************************************/
|
||||
public final static int STEP_100 = 100;
|
||||
public final static int STEP_101 = 101;
|
||||
public final static int STEP_102 = 102;
|
||||
public final static int STEP_103 = 103;
|
||||
public final static int STEP_104 = 104;
|
||||
public final static int STEP_105 = 105;
|
||||
public final static int STEP_106 = 106;
|
||||
public final static int STEP_107 = 107;
|
||||
public final static int STEP_108 = 108;
|
||||
public final static int STEP_109 = 109;
|
||||
/*****************************************/
|
||||
public final static int STEP_110 = 110;
|
||||
public final static int STEP_111 = 111;
|
||||
public final static int STEP_112 = 112;
|
||||
public final static int STEP_113 = 113;
|
||||
public final static int STEP_114 = 114;
|
||||
public final static int STEP_115 = 115;
|
||||
public final static int STEP_116 = 116;
|
||||
public final static int STEP_117 = 117;
|
||||
public final static int STEP_118 = 118;
|
||||
public final static int STEP_119 = 119;
|
||||
/*****************************************/
|
||||
public final static int STEP_120 = 120;
|
||||
public final static int STEP_121 = 121;
|
||||
public final static int STEP_122 = 122;
|
||||
public final static int STEP_123 = 123;
|
||||
public final static int STEP_124 = 124;
|
||||
public final static int STEP_125 = 125;
|
||||
public final static int STEP_126 = 126;
|
||||
public final static int STEP_127 = 127;
|
||||
public final static int STEP_128 = 128;
|
||||
public final static int STEP_129 = 129;
|
||||
/*****************************************/
|
||||
public final static int STEP_130 = 130;
|
||||
public final static int STEP_131 = 131;
|
||||
public final static int STEP_132 = 132;
|
||||
public final static int STEP_133 = 133;
|
||||
public final static int STEP_134 = 134;
|
||||
public final static int STEP_135 = 135;
|
||||
public final static int STEP_136 = 136;
|
||||
public final static int STEP_137 = 137;
|
||||
public final static int STEP_138 = 138;
|
||||
public final static int STEP_139 = 139;
|
||||
/*****************************************/
|
||||
public final static int STEP_140 = 140;
|
||||
public final static int STEP_141 = 141;
|
||||
public final static int STEP_142 = 142;
|
||||
public final static int STEP_143 = 143;
|
||||
public final static int STEP_144 = 144;
|
||||
public final static int STEP_145 = 145;
|
||||
public final static int STEP_146 = 146;
|
||||
public final static int STEP_147 = 147;
|
||||
public final static int STEP_148 = 148;
|
||||
public final static int STEP_149 = 149;
|
||||
/*****************************************/
|
||||
public final static int STEP_150 = 150;
|
||||
public final static int STEP_151 = 151;
|
||||
public final static int STEP_152 = 152;
|
||||
public final static int STEP_153 = 153;
|
||||
public final static int STEP_154 = 154;
|
||||
public final static int STEP_155 = 155;
|
||||
public final static int STEP_156 = 156;
|
||||
public final static int STEP_157 = 157;
|
||||
public final static int STEP_158 = 158;
|
||||
public final static int STEP_159 = 159;
|
||||
/*****************************************/
|
||||
public final static int STEP_160 = 160;
|
||||
public final static int STEP_161 = 161;
|
||||
public final static int STEP_162 = 162;
|
||||
public final static int STEP_163 = 163;
|
||||
public final static int STEP_164 = 164;
|
||||
public final static int STEP_165 = 165;
|
||||
public final static int STEP_166 = 166;
|
||||
public final static int STEP_167 = 167;
|
||||
public final static int STEP_168 = 168;
|
||||
public final static int STEP_169 = 169;
|
||||
/*****************************************/
|
||||
public final static int STEP_170 = 170;
|
||||
public final static int STEP_171 = 171;
|
||||
public final static int STEP_172 = 172;
|
||||
public final static int STEP_173 = 173;
|
||||
public final static int STEP_174 = 174;
|
||||
public final static int STEP_175 = 175;
|
||||
public final static int STEP_176 = 176;
|
||||
public final static int STEP_177 = 177;
|
||||
public final static int STEP_178 = 178;
|
||||
public final static int STEP_179 = 179;
|
||||
/*****************************************/
|
||||
public final static int STEP_180 = 180;
|
||||
public final static int STEP_181 = 181;
|
||||
public final static int STEP_182 = 182;
|
||||
public final static int STEP_183 = 183;
|
||||
public final static int STEP_184 = 184;
|
||||
public final static int STEP_185 = 185;
|
||||
public final static int STEP_186 = 186;
|
||||
public final static int STEP_187 = 187;
|
||||
public final static int STEP_188 = 188;
|
||||
public final static int STEP_189 = 189;
|
||||
/*****************************************/
|
||||
public final static int STEP_190 = 190;
|
||||
public final static int STEP_191 = 191;
|
||||
public final static int STEP_192 = 192;
|
||||
public final static int STEP_193 = 193;
|
||||
public final static int STEP_194 = 194;
|
||||
public final static int STEP_195 = 195;
|
||||
public final static int STEP_196 = 196;
|
||||
public final static int STEP_197 = 197;
|
||||
public final static int STEP_198 = 198;
|
||||
public final static int STEP_199 = 199;
|
||||
public final static int STEP_200 = 200;
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.derry.wechat.abllib;
|
||||
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.derry.wechat.abllib.utils.AblViewUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 寻找界面倒计时
|
||||
* 2019/4/21
|
||||
* 15:21
|
||||
* Levine
|
||||
* wechat 1483232332
|
||||
* @author Administrator
|
||||
* DYX 2021-11-30
|
||||
*/
|
||||
public class FindViewCountDown {
|
||||
|
||||
private static DownTimer mDownTimer;
|
||||
public static long millisInFuture = 10000;//默认倒计时总时长
|
||||
public static long countDownInterval = 500;//间隔时间
|
||||
|
||||
private static class DownTimer extends CountDownTimer {
|
||||
|
||||
private String[] mMsgViewIdOrText;
|
||||
private int mStep;
|
||||
private CallBack mCallback;
|
||||
|
||||
public DownTimer(
|
||||
long millisInFuture,
|
||||
long countDownInterval,
|
||||
int step, CallBack callback,
|
||||
String... viewIdOrText
|
||||
) {
|
||||
super(millisInFuture, countDownInterval);
|
||||
mMsgViewIdOrText = viewIdOrText.clone();
|
||||
mStep = step;
|
||||
mCallback = callback;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick(long l) {
|
||||
if (AblStepHandler.getInstance().isStop()) {
|
||||
cancel();
|
||||
return;
|
||||
}
|
||||
for (String string : mMsgViewIdOrText) {
|
||||
AccessibilityNodeInfo fromId = AblViewUtil.findById(string, 0);
|
||||
AccessibilityNodeInfo fromText = AblViewUtil.findByText(string, 0);
|
||||
if (fromId != null || fromText != null) {
|
||||
cancel();
|
||||
if (mCallback != null) {
|
||||
mCallback.succ();
|
||||
} else {
|
||||
AblStepHandler.sendMsg(mStep);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
if (mCallback != null) {
|
||||
mCallback.fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface CallBack {
|
||||
void succ();
|
||||
|
||||
default void fail() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据viewid或文字发送执行消息
|
||||
*
|
||||
* @param millisInFuture view查找超时时间
|
||||
* @param countDownInterval 查找间隔时间
|
||||
* @param step 步骤
|
||||
* @param viewIdOrText viewid或者文字内容
|
||||
*/
|
||||
public static void start(
|
||||
long millisInFuture,
|
||||
long countDownInterval,
|
||||
int step,
|
||||
String... viewIdOrText
|
||||
) {
|
||||
start(millisInFuture, countDownInterval, step, null, viewIdOrText);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据viewid或文字发送执行消息
|
||||
*
|
||||
* @param millisInFuture view查找超时时间
|
||||
* @param countDownInterval 查找间隔时间
|
||||
* @param callBack 回调,注:如果回调不为空将不发送消息,要发送消息就自己在成功的回调里发送
|
||||
* @param viewIdOrText viewid或者文字内容
|
||||
*/
|
||||
public static void start(
|
||||
long millisInFuture,
|
||||
long countDownInterval,
|
||||
@NonNull CallBack callBack,
|
||||
String... viewIdOrText
|
||||
) {
|
||||
start(millisInFuture, countDownInterval, 0, callBack, viewIdOrText);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据viewid或文字发送执行消息
|
||||
*
|
||||
* @param callBack 回调,注:如果回调不为空将不发送消息,要发送消息就自己在成功的回调里发送
|
||||
* @param viewIdOrText viewid或者文字内容
|
||||
*/
|
||||
public static void start(
|
||||
@NonNull CallBack callBack,
|
||||
String... viewIdOrText
|
||||
) {
|
||||
start(millisInFuture, countDownInterval, 0, callBack, viewIdOrText);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据viewid或文字发送执行消息
|
||||
*
|
||||
* @param step 步骤
|
||||
* @param viewIdOrText viewid或者文字内容
|
||||
*/
|
||||
public static void start(
|
||||
int step,
|
||||
String... viewIdOrText
|
||||
) {
|
||||
start(millisInFuture, countDownInterval, step, null, viewIdOrText);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据viewid或文字发送执行消息
|
||||
*
|
||||
* @param millisInFuture view查找超时时间
|
||||
* @param countDownInterval 查找间隔时间
|
||||
* @param step 步骤
|
||||
* @param callBack 回调,注:如果回调不为空将不发送消息,要发送消息就自己在成功的回调里发送
|
||||
* @param viewIdOrText viewid或者文字内容
|
||||
*/
|
||||
private static void start(
|
||||
long millisInFuture,
|
||||
long countDownInterval,
|
||||
int step,
|
||||
CallBack callBack,
|
||||
String... viewIdOrText
|
||||
) {
|
||||
if (mDownTimer != null) {
|
||||
mDownTimer.cancel();
|
||||
}
|
||||
mDownTimer = new DownTimer(millisInFuture, countDownInterval, step, callBack, viewIdOrText);
|
||||
mDownTimer.start();
|
||||
}
|
||||
|
||||
public static DownTimer getDownTimer() {
|
||||
return mDownTimer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.derry.wechat.abllib.callback;
|
||||
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
/**
|
||||
* 2019/4/21
|
||||
* 13:05
|
||||
* Levine
|
||||
* wechat 1483232332
|
||||
*/
|
||||
public interface AniCallBack {
|
||||
void succ(AccessibilityNodeInfo info);
|
||||
|
||||
default void fail() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.derry.wechat.abllib.callback;
|
||||
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 2019/4/21
|
||||
* 13:04
|
||||
* Levine
|
||||
* wechat 1483232332
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface AnisCallBack {
|
||||
void succ(List<AccessibilityNodeInfo> infos);
|
||||
|
||||
default void fail() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.derry.wechat.abllib.callback;
|
||||
|
||||
import android.accessibilityservice.GestureDescription;
|
||||
|
||||
/**
|
||||
* 2019/4/21
|
||||
* 13:20
|
||||
* Levine
|
||||
* wechat 1483232332
|
||||
*/
|
||||
public interface GestureCallBack {
|
||||
void succ(GestureDescription gestureDescription);
|
||||
|
||||
void fail(GestureDescription gestureDescription);
|
||||
}
|
||||
255
wechat/src/main/java/com/derry/wechat/abllib/utils/AblUtil.java
Normal file
255
wechat/src/main/java/com/derry/wechat/abllib/utils/AblUtil.java
Normal file
@@ -0,0 +1,255 @@
|
||||
package com.derry.wechat.abllib.utils;
|
||||
|
||||
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AppOpsManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.net.Uri;
|
||||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.blankj.utilcode.util.DeviceUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.SPUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.derry.wechat.WeChatConfig;
|
||||
import com.derry.wechat.abllib.AblConfig;
|
||||
import com.derry.wechat.abllib.AblService;
|
||||
import com.derry.wechat.weutil.WeChatDeviceUtils;
|
||||
import com.derry.wechat.weutil.WeChatSPUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.tbruyelle.rxpermissions2.RxPermissions;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
/**
|
||||
* 2019/4/21
|
||||
* 18:21
|
||||
* Levine
|
||||
* wechat 1483232332
|
||||
* @author Administrator
|
||||
* Dyx 2021-11-27
|
||||
*/
|
||||
public class AblUtil {
|
||||
|
||||
/***
|
||||
* 检查悬浮窗开启权限
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
@SuppressLint("ObsoleteSdkInt")
|
||||
public static boolean checkFloatPermission(Context context) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
||||
return true;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
||||
try {
|
||||
Class cls = Class.forName("android.content.Context");
|
||||
Field declaredField = cls.getDeclaredField("APP_OPS_SERVICE");
|
||||
declaredField.setAccessible(true);
|
||||
Object obj = declaredField.get(cls);
|
||||
if (!(obj instanceof String)) {
|
||||
return false;
|
||||
}
|
||||
String str2 = (String) obj;
|
||||
obj = cls.getMethod("getSystemService", String.class).invoke(context, str2);
|
||||
cls = Class.forName("android.app.AppOpsManager");
|
||||
Field declaredField2 = cls.getDeclaredField("MODE_ALLOWED");
|
||||
declaredField2.setAccessible(true);
|
||||
Method checkOp = cls.getMethod("checkOp", Integer.TYPE, Integer.TYPE, String.class);
|
||||
int result = (Integer) checkOp.invoke(obj, 24, Binder.getCallingUid(), context.getPackageName());
|
||||
return result == declaredField2.getInt(cls);
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
AppOpsManager appOpsMgr = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
|
||||
if (appOpsMgr == null) {
|
||||
return false;
|
||||
}
|
||||
int mode = appOpsMgr.checkOpNoThrow("android:system_alert_window", android.os.Process.myUid(), context.getPackageName());
|
||||
return Settings.canDrawOverlays(context) || mode == AppOpsManager.MODE_ALLOWED || mode == AppOpsManager.MODE_IGNORED;
|
||||
} else {
|
||||
return Settings.canDrawOverlays(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加悬浮界面
|
||||
*
|
||||
* @param context
|
||||
* @param view
|
||||
*/
|
||||
@SuppressLint("ObsoleteSdkInt")
|
||||
public static void addSuspensionWindowView(Context context, View view) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (Settings.canDrawOverlays(context)) {
|
||||
addSuspensionView(context, view);
|
||||
} else {
|
||||
ToastUtils.showShort("请先开启允许显示在其他应用上权限");
|
||||
}
|
||||
} else {
|
||||
addSuspensionView(context, view);
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeSuspensionWindowView(Context context, View view) {
|
||||
WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
windowManager.removeView(view);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加悬浮界面
|
||||
*
|
||||
* @param context
|
||||
* @param view
|
||||
*/
|
||||
private static void addSuspensionView(Context context, View view) {
|
||||
WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
layoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
||||
} else {
|
||||
layoutParams.type = WindowManager.LayoutParams.TYPE_PHONE;
|
||||
}
|
||||
layoutParams.format = PixelFormat.TRANSLUCENT;
|
||||
//支持透明
|
||||
// layoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;// 焦点
|
||||
layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
//窗口的宽和高
|
||||
layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
layoutParams.x = 0;
|
||||
//窗口位置的偏移量
|
||||
layoutParams.y = 0;
|
||||
layoutParams.gravity = Gravity.LEFT|Gravity.TOP;
|
||||
windowManager.addView(view, layoutParams);
|
||||
//添加窗口
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开悬浮窗授权界面
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
public static void openDrawOverlaysAnth(Context context) {
|
||||
Intent intent = new Intent(
|
||||
Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
|
||||
Uri.parse("package:" + context.getPackageName())
|
||||
);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否是需要监听的APP包名
|
||||
*
|
||||
* @param thisPackageName APP包名
|
||||
* @return
|
||||
*/
|
||||
public static boolean checkPackageName(String thisPackageName) {
|
||||
if (AblConfig.sMonitoringPackageNames != null && AblConfig.sMonitoringPackageNames.length > 0) {
|
||||
for (String packageName : AblConfig.sMonitoringPackageNames) {
|
||||
if (packageName.contentEquals(thisPackageName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开无障碍服务设置
|
||||
*/
|
||||
public static void openAccessibilitySettings() {
|
||||
Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 辅助服务是否开启
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static boolean isAccessibilityServiceOpen(Context context) {
|
||||
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
List<ActivityManager.RunningServiceInfo> services = am.getRunningServices(Short.MAX_VALUE);
|
||||
for (ActivityManager.RunningServiceInfo info : services) {
|
||||
LogUtils.v(info.service.getClassName());
|
||||
if (info.service.getClassName().equals(AblService.class.getName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static void getPermissions(Context context) {
|
||||
|
||||
|
||||
RxPermissions rxPermissions = new RxPermissions((Activity) context);
|
||||
rxPermissions.request(Manifest.permission.READ_PHONE_STATE,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
.subscribe(new io.reactivex.Observer<Boolean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(Boolean aBoolean) {
|
||||
if (aBoolean) {
|
||||
String device_id = (String) WeChatSPUtils.getSp(context, WeChatConfig.KEY_DEVICE_ID, "");
|
||||
Log.e("设备imei为sp:", device_id);//小米8==548ec01ca14763927b10defb19371f81
|
||||
if(device_id.equals("")) {
|
||||
String imei = WeChatDeviceUtils.getIMEI(context);
|
||||
try {
|
||||
String s = WeChatDeviceUtils.toMD5(imei);
|
||||
Log.e("设备imei为:", s);//小米8==548ec01ca14763927b10defb19371f81
|
||||
//红米7a==7228bdb66fed66c60d961e30a9dc06d3
|
||||
WeChatSPUtils.setSP(context, WeChatConfig.KEY_DEVICE_ID, s);
|
||||
OkGo.getInstance().addCommonParams(new HttpParams("device_id", s));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
//红米7a==865367043276309
|
||||
} else {
|
||||
Toast.makeText(context, "获取权限失败,请重新授权",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,603 @@
|
||||
package com.derry.wechat.abllib.utils;
|
||||
|
||||
import static com.derry.wechat.Activity.W_MainActivity.APP_PACKAGE_NAME;
|
||||
|
||||
import android.accessibilityservice.AccessibilityService;
|
||||
import android.accessibilityservice.GestureDescription;
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Path;
|
||||
import android.graphics.Rect;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.derry.wechat.Activity.W_MainActivity;
|
||||
import com.derry.wechat.abllib.AblService;
|
||||
import com.derry.wechat.abllib.callback.AniCallBack;
|
||||
import com.derry.wechat.abllib.callback.AnisCallBack;
|
||||
import com.derry.wechat.abllib.callback.GestureCallBack;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 界面操作工具类
|
||||
* wechat 1483232332
|
||||
* @author Administrator
|
||||
* DYX 2021-12-2
|
||||
*/
|
||||
public class AblViewUtil {
|
||||
/**
|
||||
* 根据id获取view
|
||||
*
|
||||
* @param parent
|
||||
* @param id 界面id
|
||||
* @param position
|
||||
* @return
|
||||
*/
|
||||
public static AccessibilityNodeInfo findById(
|
||||
AccessibilityNodeInfo parent,
|
||||
String id,
|
||||
int position,
|
||||
@Nullable AniCallBack callBack
|
||||
) {
|
||||
if (parent != null) {
|
||||
List<AccessibilityNodeInfo> accessibilityNodeInfos =
|
||||
parent.findAccessibilityNodeInfosByViewId(id);
|
||||
if (accessibilityNodeInfos != null &&
|
||||
!accessibilityNodeInfos.isEmpty() &&
|
||||
position < accessibilityNodeInfos.size()) {
|
||||
if (callBack != null) {
|
||||
callBack.succ(accessibilityNodeInfos.get(position));
|
||||
}
|
||||
return accessibilityNodeInfos.get(position);
|
||||
}
|
||||
}
|
||||
if (callBack != null) {
|
||||
callBack.fail();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static AccessibilityNodeInfo findById(
|
||||
AccessibilityNodeInfo parent,
|
||||
String id,
|
||||
int position
|
||||
) {
|
||||
return findById(parent, id, position, null);
|
||||
}
|
||||
|
||||
public static AccessibilityNodeInfo findById(String id, int position) {
|
||||
return findById(AblService.getInstance().getRootInActiveWindow(), id, position, null);
|
||||
}
|
||||
|
||||
public static AccessibilityNodeInfo findById(String id, int position, AniCallBack callBack) {
|
||||
return findById(AblService.getInstance().getRootInActiveWindow(), id, position, callBack);
|
||||
}
|
||||
|
||||
public static List<AccessibilityNodeInfo> findById(
|
||||
AccessibilityNodeInfo parent,
|
||||
String id,
|
||||
@Nullable AnisCallBack anisCallBack
|
||||
) {
|
||||
if (parent != null) {
|
||||
List<AccessibilityNodeInfo> accessibilityNodeInfos =
|
||||
parent.findAccessibilityNodeInfosByViewId(id);
|
||||
if (accessibilityNodeInfos != null &&
|
||||
!accessibilityNodeInfos.isEmpty()) {
|
||||
if (anisCallBack != null) {
|
||||
anisCallBack.succ(accessibilityNodeInfos);
|
||||
}
|
||||
return accessibilityNodeInfos;
|
||||
}
|
||||
}
|
||||
if (anisCallBack != null) {
|
||||
anisCallBack.fail();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public static List<AccessibilityNodeInfo> findById(
|
||||
AccessibilityNodeInfo parent,
|
||||
String id
|
||||
) {
|
||||
return findById(parent, id, null);
|
||||
}
|
||||
|
||||
public static List<AccessibilityNodeInfo> findById(String id) {
|
||||
return findById(AblService.getInstance().getRootInActiveWindow(), id, null);
|
||||
}
|
||||
|
||||
public static List<AccessibilityNodeInfo> findById(String id, AnisCallBack anisCallBack) {
|
||||
return findById(AblService.getInstance().getRootInActiveWindow(), id, anisCallBack);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文本获取view
|
||||
*
|
||||
* @param parent
|
||||
* @param text
|
||||
* @param position
|
||||
* @return
|
||||
*/
|
||||
public static AccessibilityNodeInfo findByText(AccessibilityNodeInfo parent, String text, int position) {
|
||||
if (parent != null) {
|
||||
List<AccessibilityNodeInfo> accessibilityNodeInfos =
|
||||
parent.findAccessibilityNodeInfosByText(text);
|
||||
if (accessibilityNodeInfos != null &&
|
||||
!accessibilityNodeInfos.isEmpty() &&
|
||||
position < accessibilityNodeInfos.size()) {
|
||||
return accessibilityNodeInfos.get(position);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static AccessibilityNodeInfo findByText(String text, int position) {
|
||||
return findByText(AblService.getInstance().getRootInActiveWindow(), text, position);
|
||||
}
|
||||
|
||||
public static List<AccessibilityNodeInfo> findByText(AccessibilityNodeInfo parent, String text) {
|
||||
if (parent != null) {
|
||||
List<AccessibilityNodeInfo> accessibilityNodeInfos =
|
||||
parent.findAccessibilityNodeInfosByText(text);
|
||||
if (accessibilityNodeInfos != null &&
|
||||
!accessibilityNodeInfos.isEmpty()) {
|
||||
return accessibilityNodeInfos;
|
||||
}
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public static List<AccessibilityNodeInfo> findByText(String text) {
|
||||
return findByText(AblService.getInstance().getRootInActiveWindow(), text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手势模拟
|
||||
*
|
||||
* @param start_position 开始位置,长度为2的数组,下标0为x轴,下标1为y轴
|
||||
* @param end_position
|
||||
* @param startTime 开始间隔时间
|
||||
* @param duration 持续时间
|
||||
* @param callback 回调
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.N)
|
||||
public static void dispatch_gesture(
|
||||
float[] start_position,
|
||||
float[] end_position,
|
||||
long startTime,
|
||||
long duration,
|
||||
@Nullable GestureCallBack callback
|
||||
) {
|
||||
Path path = new Path();
|
||||
path.moveTo(start_position[0], start_position[1]);
|
||||
path.lineTo(end_position[0], end_position[1]);
|
||||
GestureDescription.Builder builder = new GestureDescription.Builder();
|
||||
GestureDescription.StrokeDescription strokeDescription =
|
||||
new GestureDescription.StrokeDescription(path, startTime, duration);
|
||||
GestureDescription gestureDescription = builder.addStroke(strokeDescription).build();
|
||||
AblService.getInstance().dispatchGesture(gestureDescription, new AccessibilityService.GestureResultCallback() {
|
||||
@Override
|
||||
public void onCompleted(GestureDescription gestureDescription) {
|
||||
if (callback != null) {
|
||||
callback.succ(gestureDescription);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancelled(GestureDescription gestureDescription) {
|
||||
if (callback != null) {
|
||||
callback.fail(gestureDescription);
|
||||
}
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* x轴居中竖直滑动屏幕
|
||||
*
|
||||
* @param yRatio y轴份数
|
||||
* @param startSlideRatio y轴开始的份数
|
||||
* @param stopSlideRatio y轴结束的份数
|
||||
*/
|
||||
public static void scrollVertical(
|
||||
int yRatio,
|
||||
int startSlideRatio,
|
||||
int stopSlideRatio,
|
||||
long startTime,
|
||||
long duration,
|
||||
@Nullable GestureCallBack callback
|
||||
) {
|
||||
int screenHeight = ScreenUtils.getScreenHeight();
|
||||
int screenWidth = ScreenUtils.getScreenWidth();
|
||||
int start = (screenHeight / yRatio) * startSlideRatio;
|
||||
int stop = (screenHeight / yRatio) * stopSlideRatio;
|
||||
dispatch_gesture(
|
||||
new float[]{screenWidth >> 1, start},
|
||||
new float[]{screenWidth >> 1, stop},
|
||||
startTime,
|
||||
duration,
|
||||
callback
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 竖直滑动,y轴分为20份
|
||||
*
|
||||
* @param startSlideRatio 开始份数
|
||||
* @param stopSlideRatio 结束份数
|
||||
*/
|
||||
public static void scrollVertical(
|
||||
int startSlideRatio,
|
||||
int stopSlideRatio
|
||||
) {
|
||||
int screenHeight = ScreenUtils.getScreenHeight();
|
||||
int screenWidth = ScreenUtils.getScreenWidth();
|
||||
int start = (screenHeight / 20) * startSlideRatio;
|
||||
int stop = (screenHeight / 20) * stopSlideRatio;
|
||||
dispatch_gesture(
|
||||
new float[]{screenWidth >> 1, start},
|
||||
new float[]{screenWidth >> 1, stop},
|
||||
50,
|
||||
500,
|
||||
null
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* x轴居中竖直滑动屏幕
|
||||
*
|
||||
* @param startY y轴开始位置
|
||||
* @param stopY y轴结束位置
|
||||
*/
|
||||
public static void scrollVertical(
|
||||
float startY,
|
||||
float stopY,
|
||||
long startTime,
|
||||
long duration,
|
||||
@Nullable GestureCallBack callback
|
||||
) {
|
||||
int screenWidth = ScreenUtils.getScreenWidth();
|
||||
dispatch_gesture(
|
||||
new float[]{screenWidth >> 1, startY},
|
||||
new float[]{screenWidth >> 1, stopY},
|
||||
startTime,
|
||||
duration,
|
||||
callback
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* y轴居中横向滑动
|
||||
*
|
||||
* @param xRatio x轴份数
|
||||
* @param startSlideRatio x轴开始滑动份数
|
||||
* @param stopSlideRatio x轴结束滑动份数
|
||||
* @param startTime 开始延迟时间
|
||||
* @param duration 滑动持续时间
|
||||
* @param callback 回调
|
||||
*/
|
||||
public void scrollHorizontal(
|
||||
int xRatio,
|
||||
int startSlideRatio,
|
||||
int stopSlideRatio,
|
||||
long startTime,
|
||||
long duration,
|
||||
@Nullable GestureCallBack callback
|
||||
) {
|
||||
int screenHeight = ScreenUtils.getScreenHeight();
|
||||
int screenWidth = ScreenUtils.getScreenWidth();
|
||||
int start = (screenWidth / xRatio) * startSlideRatio;
|
||||
int stop = (screenWidth / xRatio) * stopSlideRatio;
|
||||
dispatch_gesture(
|
||||
new float[]{start, screenHeight >> 1},
|
||||
new float[]{stop, screenHeight >> 1},
|
||||
startTime,
|
||||
duration,
|
||||
callback
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* y轴居中横向滑动
|
||||
*
|
||||
* @param startX x轴开始位置
|
||||
* @param stopX x轴结束位置
|
||||
* @param startTime 开始延迟时间
|
||||
* @param duration 滑动持续时间
|
||||
* @param callback 回调
|
||||
*/
|
||||
public void scrollHorizontal(
|
||||
int startX,
|
||||
int stopX,
|
||||
long startTime,
|
||||
long duration,
|
||||
@Nullable GestureCallBack callback
|
||||
) {
|
||||
int screenHeight = ScreenUtils.getScreenHeight();
|
||||
dispatch_gesture(
|
||||
new float[]{startX, screenHeight >> 1},
|
||||
new float[]{stopX, screenHeight >> 1},
|
||||
startTime,
|
||||
duration,
|
||||
callback
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击屏幕
|
||||
*
|
||||
* @param ratio 屏幕长宽份数
|
||||
* @param xRatio 屏幕宽ratio份的比例
|
||||
* @param yRatio
|
||||
*/
|
||||
public static void clickScreen(
|
||||
int ratio,
|
||||
int xRatio,
|
||||
int yRatio,
|
||||
@Nullable GestureCallBack callback
|
||||
) {
|
||||
int screenHeight = ScreenUtils.getScreenHeight();
|
||||
int screenWidth = ScreenUtils.getScreenWidth();
|
||||
int y = (screenHeight / ratio) * yRatio;
|
||||
int x = (screenWidth / ratio) * xRatio;
|
||||
dispatch_gesture(
|
||||
new float[]{x, y},
|
||||
new float[]{x, y},
|
||||
100,
|
||||
50,
|
||||
callback
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击屏幕
|
||||
*/
|
||||
public static void clickScreen(
|
||||
int xRatio,
|
||||
int yRatio
|
||||
) {
|
||||
int screenHeight = ScreenUtils.getScreenHeight();
|
||||
int screenWidth = ScreenUtils.getScreenWidth();
|
||||
int y = (screenHeight / 20) * yRatio;
|
||||
int x = (screenWidth / 20) * xRatio;
|
||||
dispatch_gesture(
|
||||
new float[]{x, y},
|
||||
new float[]{x, y},
|
||||
100,
|
||||
50,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
public static void clickScreen(
|
||||
float x,
|
||||
float y
|
||||
) {
|
||||
dispatch_gesture(
|
||||
new float[]{x, y},
|
||||
new float[]{x, y},
|
||||
100,
|
||||
2000,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
public static void clickScreen(
|
||||
float x,
|
||||
float y,
|
||||
long duration
|
||||
) {
|
||||
dispatch_gesture(
|
||||
new float[]{x, y},
|
||||
new float[]{x, y},
|
||||
100,
|
||||
duration,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击屏幕
|
||||
*
|
||||
* @param x x轴像素
|
||||
* @param y
|
||||
* @param startTime 开始间隔时间
|
||||
* @param duration 持续时间
|
||||
*/
|
||||
public static void clickScreen(
|
||||
float x,
|
||||
float y,
|
||||
long startTime,
|
||||
long duration,
|
||||
@Nullable GestureCallBack callback
|
||||
) {
|
||||
dispatch_gesture(
|
||||
new float[]{x, y},
|
||||
new float[]{x, y},
|
||||
startTime,
|
||||
duration,
|
||||
callback
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回
|
||||
*/
|
||||
public static void back() {
|
||||
AblService.getInstance().performGlobalAction(AccessibilityService.GLOBAL_ACTION_BACK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 黏贴文本至view
|
||||
*
|
||||
* @param info
|
||||
* @param text
|
||||
*/
|
||||
public static void paste(AccessibilityNodeInfo info, String text) {
|
||||
ClipData clip = ClipData.newPlainText(System.currentTimeMillis() + "", text);
|
||||
ClipboardManager clipboardManager = (ClipboardManager) AblService.getInstance().getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
assert clipboardManager != null;
|
||||
clipboardManager.setPrimaryClip(clip);
|
||||
ClipData abc = clipboardManager.getPrimaryClip();
|
||||
assert abc != null;
|
||||
ClipData.Item item = abc.getItemAt(0);
|
||||
if (info != null) {
|
||||
info.performAction(AccessibilityNodeInfo.ACTION_PASTE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳过广告
|
||||
*/
|
||||
public static void Skip(){
|
||||
List<AccessibilityNodeInfo> nodeInfoList = AblService.getInstance().getRootInActiveWindow().findAccessibilityNodeInfosByText("跳过");
|
||||
for (AccessibilityNodeInfo info : nodeInfoList) {
|
||||
CharSequence charSequence = info.getText();
|
||||
if (charSequence != null) {
|
||||
String msg = charSequence.toString();
|
||||
if (msg.contains("跳过")) {
|
||||
info.performAction(AccessibilityNodeInfo.ACTION_CLICK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 根据范围获和输入的文本获取节点
|
||||
*/
|
||||
public static AccessibilityNodeInfo getNodeInfo(String str) {
|
||||
AccessibilityNodeInfo nodeInfo = null;
|
||||
List<AccessibilityNodeInfo> nodeInfos = AblViewUtil.findByText(str);
|
||||
for (int i=0;i<nodeInfos.size();i++){
|
||||
AccessibilityNodeInfo child = nodeInfos.get(i);
|
||||
Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
nodeZuobiao(child);
|
||||
Rect rect = new Rect();
|
||||
child.getBoundsInScreen(rect);
|
||||
if(rect.left>0&&rect.top>2000&&rect.top<=2210&&rect.bottom>0&&rect.bottom<=2210&&rect.right<1080) {
|
||||
Log.e("TIAOSHI###", "----twoNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
nodeZuobiao(child);
|
||||
nodeInfo = child;
|
||||
}
|
||||
}
|
||||
return nodeInfo;
|
||||
}
|
||||
/**
|
||||
* 查看节点的坐标点
|
||||
*/
|
||||
public static void nodeZuobiao(AccessibilityNodeInfo nodeinfo){
|
||||
Rect rect = new Rect();
|
||||
nodeinfo.getBoundsInScreen(rect);
|
||||
Log.e("TIAOSHI###", "----显示节点的坐标:" + "(" + rect.left + "," + rect.top + ")" + "," + "(" + rect.right + "," + rect.bottom + ")");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前页面是否包含某文本
|
||||
*/
|
||||
public static boolean isContainText(String str) {
|
||||
boolean flag = false;
|
||||
List<AccessibilityNodeInfo> nodeInfos = AblViewUtil.findByText(str);
|
||||
for (int i=0;i<nodeInfos.size();i++){
|
||||
AccessibilityNodeInfo child = nodeInfos.get(i);
|
||||
Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
nodeZuobiao(child);
|
||||
Rect rect = new Rect();
|
||||
child.getBoundsInScreen(rect);
|
||||
if(rect.left>0&&rect.top>0&&rect.top<=2210&&rect.bottom>0&&rect.bottom<=2210&&rect.right<1080) {
|
||||
Log.e("TIAOSHI###", "----twoNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription());
|
||||
nodeZuobiao(child);
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param text
|
||||
* 根据文本寻找控件节点
|
||||
*/
|
||||
public static void findAndPerformActionTextView(String text) {
|
||||
if (AblService.getInstance().getRootInActiveWindow() == null) {
|
||||
return;
|
||||
}
|
||||
List node = AblService.getInstance().getRootInActiveWindow().findAccessibilityNodeInfosByText(text);
|
||||
for ( int i = 0; i < node.size(); i++ ){
|
||||
AccessibilityNodeInfo nodeInfo = (AccessibilityNodeInfo) node.get(i);
|
||||
if (nodeInfo != null && nodeInfo.isEnabled()){
|
||||
performViewClick(nodeInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 模拟点击事件,如果该node不能点击,则点击父node,将点击事件一直向父级传递,直至到根node或者找到一个可以点击的node
|
||||
*
|
||||
* @param nodeInfo nodeInfo
|
||||
*/
|
||||
public static void performViewClick(AccessibilityNodeInfo nodeInfo) {
|
||||
if (nodeInfo == null) {
|
||||
return;
|
||||
} else {
|
||||
while (nodeInfo != null) {
|
||||
if (nodeInfo.isClickable()) {
|
||||
nodeInfo.performAction(AccessibilityNodeInfo.ACTION_CLICK);
|
||||
break;
|
||||
}
|
||||
nodeInfo = nodeInfo.getParent();
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void mySleep(int i) {
|
||||
try {
|
||||
Thread.sleep(i * 1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//跳转页面的方法
|
||||
private void launchapp(Context context) {
|
||||
//判断当前手机是否有要跳入的app
|
||||
if (isAppInstalled(context)){
|
||||
//如果有根据包名跳转
|
||||
context.startActivity(context.getPackageManager().getLaunchIntentForPackage(APP_PACKAGE_NAME));
|
||||
}else{
|
||||
//如果没有,走进入系统商店找到这款APP,提示你去下载这款APP的程序
|
||||
goToMarket(context);
|
||||
}
|
||||
}
|
||||
//这里是进入应用商店,下载指定APP的方法。
|
||||
private void goToMarket(Context context) {
|
||||
Uri uri = Uri.parse("market://details?id=" + APP_PACKAGE_NAME);
|
||||
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
|
||||
try {
|
||||
context.startActivity(goToMarket);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
//这里是判断APP中是否有相应APP的方法
|
||||
private boolean isAppInstalled(Context context) {
|
||||
try {
|
||||
context.getPackageManager().getPackageInfo(APP_PACKAGE_NAME,0);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,47 @@
|
||||
package com.derry.wechat.debug;
|
||||
|
||||
import android.content.Context;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.PopupWindow;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.derry.wechat.TestAblStep1;
|
||||
import com.levine.abllib.AblConfig;
|
||||
import com.levine.abllib.AblService;
|
||||
import com.levine.abllib.AblStepHandler;
|
||||
import com.levine.abllib.AblSteps;
|
||||
import com.levine.abllib.utils.AblUtil;
|
||||
|
||||
// import com.derry.login.R; // 不对了
|
||||
import com.derry.wechat.Activity.W_MainActivity;
|
||||
import com.derry.wechat.Activity.WeChatChannelActivity;
|
||||
import com.derry.wechat.Activity.WeChatPlate;
|
||||
import com.derry.wechat.steps.TestAblStep1;
|
||||
import com.derry.wechat.abllib.AblConfig;
|
||||
import com.derry.wechat.abllib.AblService;
|
||||
import com.derry.wechat.abllib.AblStepHandler;
|
||||
import com.derry.wechat.abllib.AblSteps;
|
||||
import com.derry.wechat.abllib.utils.AblUtil;
|
||||
import com.derry.wechat.steps.TestAblStep2;
|
||||
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
public class Login_DebugActivity extends AppCompatActivity {
|
||||
|
||||
public static String APP_PACKAGE_NAME = "com.tencent.mm";
|
||||
private PopupWindow mPopCut;
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.w_activity_debug);
|
||||
//透明状态栏
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
|
||||
AblConfig.Builder()
|
||||
.setMonitoringPackageNames("com.tencent.mm")//微信包
|
||||
.setLogTag("DDD")//logtag,不设置默认是abllib
|
||||
@@ -33,80 +49,57 @@ public class Login_DebugActivity extends AppCompatActivity {
|
||||
.setFindViewMillisInFuture(10000)//寻找界面超时时间
|
||||
.setFindViewCountDownInterval(200)//寻找界面间隔时间
|
||||
.build().init();
|
||||
AblStepHandler.getInstance().initStepClass(new TestAblStep1());
|
||||
findViewById(R.id.btn_1).setOnClickListener(new View.OnClickListener() {
|
||||
AblStepHandler.getInstance().initStepClass(new TestAblStep1() , new TestAblStep2());
|
||||
|
||||
AblUtil.getPermissions(Login_DebugActivity.this);
|
||||
|
||||
//adb shell pm grant com.derry.wechat.debug android.permission.WRITE_SECURE_SETTINGS
|
||||
Settings.Secure.putString(getContentResolver(),
|
||||
Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, "com.derry.wechat.debug/com.derry.wechat.debug.abllib.AblService");
|
||||
Settings.Secure.putString(getContentResolver(),
|
||||
Settings.Secure.ACCESSIBILITY_ENABLED, "1");//1表示开启
|
||||
if (AblUtil.isAccessibilityServiceOpen(Login_DebugActivity.this)) {
|
||||
// Log.e("TIAOSHI###", "无障碍服务正常");
|
||||
ToastUtils.showShort( "无障碍服务正常");
|
||||
}else {
|
||||
ToastUtils.showShort( "无障碍服务异常");
|
||||
Settings.Secure.putString(getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, "com.derry.wechat.debug/com.derry.wechat.debug.abllib.AblService");
|
||||
Settings.Secure.putString(getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, "0");//1表示开启
|
||||
}
|
||||
/**
|
||||
* 底部导航栏
|
||||
*/
|
||||
Button mBtnCut = findViewById(R.id.cut);
|
||||
mBtnCut.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AblUtil.openAccessibilitySettings();
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_2).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AblUtil.addSuspensionWindowView(Login_DebugActivity.this,initWindowView());
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_3).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AblUtil.openDrawOverlaysAnth(Login_DebugActivity.this);
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_4).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (AblUtil.isAccessibilityServiceOpen(Login_DebugActivity.this)) {
|
||||
AblStepHandler.getInstance().setStop(false);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_1);
|
||||
} else {
|
||||
ToastUtils.showShort("请先开启辅助服务");
|
||||
}
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_5).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AblStepHandler.getInstance().setStop(true);
|
||||
@SuppressLint("InflateParams") View v = getLayoutInflater().inflate(R.layout.layout_pop,null);
|
||||
mPopCut = new PopupWindow(v, ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
mPopCut.setTouchable(true);
|
||||
mPopCut.setFocusable(true);
|
||||
mPopCut.showAtLocation(getWindow().getDecorView(), Gravity.BOTTOM,0,0);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
private View initWindowView(){//悬浮窗
|
||||
View view = View.inflate(this, R.layout.view_test_w, null);
|
||||
view.findViewById(R.id.fu_btn_1).setOnClickListener(new View.OnClickListener() {
|
||||
/**
|
||||
* 菜单
|
||||
*/
|
||||
Button mBtnRecommend = findViewById(R.id.recommed);
|
||||
mBtnRecommend.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (AblUtil.isAccessibilityServiceOpen(Login_DebugActivity.this)) {
|
||||
AblStepHandler.getInstance().setStop(false);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_1);
|
||||
} else {
|
||||
ToastUtils.showShort("请先开启辅助服务");
|
||||
}
|
||||
Intent intent = new Intent(Login_DebugActivity.this, WeChatPlate.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
view.findViewById(R.id.fu_btn_2).setOnClickListener(new View.OnClickListener() {
|
||||
Button mBtnChannel = findViewById(R.id.channel);
|
||||
mBtnChannel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
|
||||
windowManager.removeView(view);
|
||||
Intent intent = new Intent(Login_DebugActivity.this,WeChatChannelActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
view.findViewById(R.id.fu_btn_3).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
AblStepHandler.getInstance().setStop(true);
|
||||
}
|
||||
});
|
||||
view.findViewById(R.id.fu_btn_4).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
AblService.getInstance().disableSelf();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return view;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
package com.derry.wechat;
|
||||
package com.derry.wechat.steps;
|
||||
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
import com.levine.abllib.AblStepBase;
|
||||
import com.levine.abllib.AblStepHandler;
|
||||
import com.levine.abllib.AblSteps;
|
||||
import com.levine.abllib.callback.AniCallBack;
|
||||
import com.levine.abllib.callback.AnisCallBack;
|
||||
import com.levine.abllib.utils.AblViewUtil;
|
||||
|
||||
import com.derry.wechat.abllib.AblStepBase;
|
||||
import com.derry.wechat.abllib.AblStepHandler;
|
||||
import com.derry.wechat.abllib.AblSteps;
|
||||
import com.derry.wechat.abllib.callback.AniCallBack;
|
||||
import com.derry.wechat.abllib.callback.AnisCallBack;
|
||||
import com.derry.wechat.abllib.utils.AblViewUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -106,6 +107,7 @@ public class TestAblStep1 extends AblStepBase {//微信8.0.7
|
||||
AblViewUtil.scrollVertical(3,1);//滑动
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_4);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
159
wechat/src/main/java/com/derry/wechat/steps/TestAblStep2.java
Normal file
159
wechat/src/main/java/com/derry/wechat/steps/TestAblStep2.java
Normal file
@@ -0,0 +1,159 @@
|
||||
package com.derry.wechat.steps;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Message;
|
||||
import android.view.accessibility.AccessibilityNodeInfo;
|
||||
|
||||
import com.derry.wechat.abllib.AblService;
|
||||
import com.derry.wechat.abllib.AblStepBase;
|
||||
import com.derry.wechat.abllib.AblStepHandler;
|
||||
import com.derry.wechat.abllib.AblSteps;
|
||||
import com.derry.wechat.abllib.utils.AblViewUtil;
|
||||
import com.derry.wechat.weutil.WeData;
|
||||
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* DYX 2021-12-2
|
||||
*/
|
||||
public class TestAblStep2 extends AblStepBase {
|
||||
@Override
|
||||
public void onStep(int step, Message msg) {
|
||||
int color = WeData.getColor(863,2046);
|
||||
int red = Color.red(204);
|
||||
int green = Color.green(204);
|
||||
int blue = Color.blue(204);
|
||||
switch (step){
|
||||
case AblSteps.STEP_10:
|
||||
AblViewUtil.findAndPerformActionTextView("发现");
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_11);
|
||||
break;
|
||||
case AblSteps.STEP_11:
|
||||
AblViewUtil.findAndPerformActionTextView("视频号");
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_12);
|
||||
break;
|
||||
case AblSteps.STEP_12://点击浏览设置
|
||||
AblViewUtil.clickScreen(18,1);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_13);
|
||||
break;
|
||||
case AblSteps.STEP_13:
|
||||
AblViewUtil.findAndPerformActionTextView("我的关注");
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_14);
|
||||
break;
|
||||
case AblSteps.STEP_14://点击关注对象
|
||||
AblViewUtil.clickScreen(4,3);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_15);
|
||||
break;
|
||||
case AblSteps.STEP_15://点击主页视频稿件
|
||||
AblViewUtil.clickScreen(3,10);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_16);
|
||||
break;
|
||||
case AblSteps.STEP_16://点赞
|
||||
if (color == red && color == blue && color == green ){
|
||||
AblViewUtil.clickScreen(16,18);
|
||||
}
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_20);
|
||||
break;
|
||||
case AblSteps.STEP_17://判断是否在评论页面
|
||||
if (AblViewUtil.isContainText("作者")){
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_22);
|
||||
} else {
|
||||
AblViewUtil.back();
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_24);
|
||||
}
|
||||
break;
|
||||
case AblSteps.STEP_18:
|
||||
mypaste();
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_23);
|
||||
break;
|
||||
case AblSteps.STEP_19://关闭评论页面
|
||||
AblViewUtil.clickScreen(1,6);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_21);
|
||||
break;
|
||||
case AblSteps.STEP_20://点击评论
|
||||
AblViewUtil.clickScreen(18,18);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_17);
|
||||
break;
|
||||
case AblSteps.STEP_21://下滑至下一个视频
|
||||
AblViewUtil.scrollVertical(15,2);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_16);
|
||||
break;
|
||||
case AblSteps.STEP_22:
|
||||
AblViewUtil.clickScreen(5,18);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_18);
|
||||
break;
|
||||
case AblSteps.STEP_23:
|
||||
AblViewUtil.clickScreen(18,12);
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_19);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
protected void mypaste(){
|
||||
AccessibilityNodeInfo rootNode = AblService.getInstance().getRootInActiveWindow();
|
||||
if (rootNode != null) {
|
||||
//查找到聚焦的文本
|
||||
AccessibilityNodeInfo accessibilityNodeInfo = rootNode.findFocus(AccessibilityNodeInfo.FOCUS_INPUT);
|
||||
boolean isFocuse = accessibilityNodeInfo.isFocused();
|
||||
// System.out.println("isFocuse..............................." + isFocuse);
|
||||
// System.out.println("accessibilityNodeInfo.getClassName()..............................." + accessibilityNodeInfo.getClassName());
|
||||
// Bundle arguments = new Bundle();
|
||||
// arguments.putCharSequence(AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE, "android");
|
||||
// accessibilityNodeInfo.performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, arguments);
|
||||
|
||||
ClipboardManager clipboard = (ClipboardManager)AblService.getInstance().getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("", myhuashu());
|
||||
clipboard.setPrimaryClip(clip);
|
||||
//焦点(n是AccessibilityNodeInfo对象)
|
||||
accessibilityNodeInfo.performAction(AccessibilityNodeInfo.ACTION_FOCUS);
|
||||
accessibilityNodeInfo.performAction(AccessibilityNodeInfo.ACTION_PASTE);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
private String myhuashu(){
|
||||
String text = "";
|
||||
int i = (int)(1+Math.random()*(10-1+1));
|
||||
switch (i){
|
||||
case 1:
|
||||
text = ".这个视频不错,有创意,我很喜欢";
|
||||
break;
|
||||
case 2:
|
||||
text = ".我去 没想到这个还可以这样玩";
|
||||
break;
|
||||
case 3:
|
||||
text = "你好 视频不错哦";
|
||||
break;
|
||||
case 4:
|
||||
text = "作品越来越好了 加油";
|
||||
break;
|
||||
case 5:
|
||||
text = "会一直关注你的哦";
|
||||
break;
|
||||
case 6:
|
||||
text = "来看你了,要多多走动哦";
|
||||
break;
|
||||
case 7:
|
||||
text = "哈哈";
|
||||
break;
|
||||
case 8:
|
||||
text = "点赞了";
|
||||
break;
|
||||
case 9:
|
||||
text = "支持";
|
||||
break;
|
||||
case 10:
|
||||
text = "可以可以";
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.derry.wechat.steps;
|
||||
|
||||
import android.os.Message;
|
||||
|
||||
import com.derry.wechat.abllib.AblService;
|
||||
import com.derry.wechat.abllib.AblStepBase;
|
||||
import com.derry.wechat.abllib.AblStepHandler;
|
||||
import com.derry.wechat.abllib.AblSteps;
|
||||
import com.derry.wechat.abllib.utils.AblViewUtil;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* dyx 2021-12-6
|
||||
*/
|
||||
public class TestAblStep3 extends AblStepBase {
|
||||
@Override
|
||||
public void onStep(int step, Message msg) {
|
||||
switch (step){
|
||||
case AblSteps.STEP_24:
|
||||
if (AblViewUtil.isContainText("执行任务")){
|
||||
AblStepHandler.getInstance().setStop(true);
|
||||
} else {
|
||||
AblViewUtil.back();
|
||||
AblStepHandler.sendMsg(AblSteps.STEP_24);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package com.derry.wechat.weutil;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.provider.Settings;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.core.app.ActivityCompat;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* DYX 2021-12-3
|
||||
*/
|
||||
public class WeChatDeviceUtils {
|
||||
private static final String UUID_FILE_NAME = "android10biaoshi";
|
||||
private static final String TODO = null;
|
||||
public static String getUniqueId(Context context){
|
||||
@SuppressLint("HardwareIds") String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
Log.e("设备号加密前为:",androidID);//红米7==b5b6d728393424b8 小米8==48d70d2f60d2ac2b
|
||||
// String id = androidID + Build.SERIAL;
|
||||
String id = androidID;
|
||||
try {
|
||||
return toMD5(id);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String toMD5(String text) throws NoSuchAlgorithmException {
|
||||
//获取摘要器 MessageDigest
|
||||
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
|
||||
//通过摘要器对字符串的二进制字节数组进行hash计算
|
||||
byte[] digest = messageDigest.digest(text.getBytes());
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < digest.length; i++) {
|
||||
//循环每个字符 将计算结果转化为正整数;
|
||||
int digestInt = digest[i] & 0xff;
|
||||
//将10进制转化为较短的16进制
|
||||
String hexString = Integer.toHexString(digestInt);
|
||||
//转化结果如果是个位数会省略0,因此判断并补0
|
||||
if (hexString.length() < 2) {
|
||||
sb.append(0);
|
||||
}
|
||||
//将循环结果添加到缓冲区
|
||||
sb.append(hexString);
|
||||
}
|
||||
//返回整个结果
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 适配安卓10(Q)(API29)及以上
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getIMEI(Context context) {
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
String UUIDStr = readSD();
|
||||
if (UUIDStr == null || UUIDStr.isEmpty()) {//如果为空或者空字符串就生成UUID创建文件并写入UUID
|
||||
String uuid = new Date().getTime() + "_AndroidQ_" + UUID.randomUUID().toString();
|
||||
|
||||
String s = writeSD(uuid);
|
||||
return s;
|
||||
} else {
|
||||
return UUIDStr;
|
||||
}
|
||||
} else {
|
||||
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
return TODO;
|
||||
}
|
||||
@SuppressLint({"MissingPermission", "HardwareIds"}) String imei = telephonyManager.getDeviceId();
|
||||
|
||||
return imei;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存文件到SD卡(写入SD卡需要权限,在AndroidManifest.xml中设置android.permission.WRITE_EXTERNAL_STORAGE)
|
||||
*/
|
||||
public static String writeSD(String content) {
|
||||
//文件输出流
|
||||
FileOutputStream out = null;
|
||||
//设置文件路径
|
||||
File file = new File(Environment.getExternalStorageDirectory(), UUID_FILE_NAME);
|
||||
try {
|
||||
out = new FileOutputStream(file);
|
||||
out.write(content.getBytes());
|
||||
return content;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
} finally {
|
||||
try {
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 从SD卡中读取文件(读取SD卡需要权限,在AndroidManifest.xml中设置android.permission.READ_EXTERNAL_STORAGE)
|
||||
*/
|
||||
public static String readSD() {
|
||||
//文件输入流
|
||||
FileInputStream in = null;
|
||||
//设置文件路径
|
||||
File file = new File(Environment.getExternalStorageDirectory(), UUID_FILE_NAME);
|
||||
try {
|
||||
in = new FileInputStream(file);
|
||||
//使用缓冲来读
|
||||
byte[] buf = new byte[1024];//每1024字节读一次
|
||||
StringBuilder builder = new StringBuilder();
|
||||
while (in.read(buf) != -1) {
|
||||
builder.append(new String(buf).trim());
|
||||
}
|
||||
return builder.toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
} finally {
|
||||
try {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.derry.wechat.weutil;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* DYX 2021-12-3
|
||||
*/
|
||||
public class WeChatSPUtils {
|
||||
public static void setSP(Context context, String key, Object object) {
|
||||
String type = object.getClass().getSimpleName();
|
||||
String packageName = context.getPackageName();
|
||||
SharedPreferences sp = context.getSharedPreferences(packageName, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor edit = sp.edit();
|
||||
if ("String".equals(type)) {
|
||||
edit.putString(key, (String) object);
|
||||
} else if ("Integer".equals(type)) {
|
||||
edit.putInt(key, (Integer) object);
|
||||
} else if ("Boolean".equals(type)) {
|
||||
edit.putBoolean(key, (Boolean) object);
|
||||
} else if ("Float".equals(type)) {
|
||||
edit.putFloat(key, (Float) object);
|
||||
} else if ("Long".equals(type)) {
|
||||
edit.putLong(key, (Long) object);
|
||||
}
|
||||
edit.apply();
|
||||
}
|
||||
|
||||
public static Object getSp(Context context, String key, Object defaultObject) {
|
||||
String type = defaultObject.getClass().getSimpleName();
|
||||
String packageName = context.getPackageName();
|
||||
SharedPreferences sp = context.getSharedPreferences(packageName, Context.MODE_PRIVATE);
|
||||
if ("String".equals(type)) {
|
||||
return sp.getString(key, (String) defaultObject);
|
||||
} else if ("Integer".equals(type)) {
|
||||
return sp.getInt(key, (Integer) defaultObject);
|
||||
} else if ("Boolean".equals(type)) {
|
||||
return sp.getBoolean(key, (Boolean) defaultObject);
|
||||
} else if ("Float".equals(type)) {
|
||||
return sp.getFloat(key, (Float) defaultObject);
|
||||
} else if ("Long".equals(type)) {
|
||||
return sp.getLong(key, (Long) defaultObject);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void cleanAllSP(Context context) {
|
||||
String packageName = context.getPackageName();
|
||||
SharedPreferences sp = context.getSharedPreferences(packageName, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.clear();
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
44
wechat/src/main/java/com/derry/wechat/weutil/WeData.java
Normal file
44
wechat/src/main/java/com/derry/wechat/weutil/WeData.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.derry.wechat.weutil;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.media.Image;
|
||||
import android.media.ImageReader;
|
||||
import android.util.Log;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public class WeData {
|
||||
static ImageReader reader;
|
||||
private static Bitmap bitmap;
|
||||
|
||||
public static int getColor(int x, int y) {
|
||||
if (reader == null) {
|
||||
Log.d("", "getColor: reader is null");
|
||||
return -1;
|
||||
}
|
||||
|
||||
Image image = reader.acquireLatestImage();
|
||||
|
||||
if (image == null) {
|
||||
if (bitmap == null) {
|
||||
Log.d("", "getColor: image is null");
|
||||
return -1;
|
||||
}
|
||||
return bitmap.getPixel(x, y);
|
||||
}
|
||||
int width = image.getWidth();
|
||||
int height = image.getHeight();
|
||||
final Image.Plane[] planes = image.getPlanes();
|
||||
final ByteBuffer buffer = planes[0].getBuffer();
|
||||
int pixelStride = planes[0].getPixelStride();
|
||||
int rowStride = planes[0].getRowStride();
|
||||
int rowPadding = rowStride - pixelStride * width;
|
||||
if (bitmap == null) {
|
||||
bitmap = Bitmap.createBitmap(width + rowPadding / pixelStride, height, Bitmap.Config.ARGB_8888);
|
||||
}
|
||||
bitmap.copyPixelsFromBuffer(buffer);
|
||||
image.close();
|
||||
|
||||
return bitmap.getPixel(x, y);
|
||||
}
|
||||
}
|
||||
18
wechat/src/main/res/drawable/btn_style.xml
Normal file
18
wechat/src/main/res/drawable/btn_style.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="false">
|
||||
<shape>
|
||||
<corners android:radius="26dp"/>
|
||||
<solid android:color="@color/black"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="26dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</selector>
|
||||
BIN
wechat/src/main/res/drawable/wechat.png
Normal file
BIN
wechat/src/main/res/drawable/wechat.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
18
wechat/src/main/res/layout/activity_we_chat_channel.xml
Normal file
18
wechat/src/main/res/layout/activity_we_chat_channel.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.derry.wechat.Activity.WeChatChannelActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/wechat_channel_start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="执行任务"
|
||||
android:textColor="@color/purple_200"
|
||||
android:background="@drawable/btn_style"/>
|
||||
</RelativeLayout>
|
||||
@@ -5,159 +5,13 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/zu_9308"
|
||||
tools:ignore="ExtraText">
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="56dp"
|
||||
android:layout_marginLeft="27dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/recommed"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/recommend"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="121dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:text="通讯录好友"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="56dp"
|
||||
android:layout_marginLeft="114dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/share"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9309"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="85dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="121dp"
|
||||
android:layout_marginLeft="106.5dp"
|
||||
android:text="直播间/视频分享"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="704.5dp"
|
||||
android:layout_marginLeft="27dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/trick"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9309"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="769.5dp"
|
||||
android:layout_marginLeft="37dp"
|
||||
android:text="话术设置"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="704.5dp"
|
||||
android:layout_marginLeft="114dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/system"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9309"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="769.5dp"
|
||||
android:layout_marginLeft="124dp"
|
||||
android:text="系统设置"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="704.5dp"
|
||||
android:layout_marginLeft="201dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/cut"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9310"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="771dp"
|
||||
android:layout_marginLeft="211dp"
|
||||
android:text="切换平台"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="94.85dp"
|
||||
android:layout_height="74.11dp"
|
||||
android:layout_marginTop="605.34dp"
|
||||
android:layout_marginLeft="270.58dp"
|
||||
android:src="@mipmap/way5398"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/wechat_add_start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="执行任务"
|
||||
android:textColor="@color/purple_200"
|
||||
android:background="@drawable/btn_style"/>
|
||||
</RelativeLayout>
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<com.getbase.floatingactionbutton.FloatingActionsMenu
|
||||
android:layout_width="wrap_content"
|
||||
@@ -12,35 +12,37 @@
|
||||
tools:ignore="UnusedAttribute"
|
||||
app:fab_addButtonSize="normal"
|
||||
app:fab_labelsPosition="right"
|
||||
android:outlineAmbientShadowColor="@color/white"
|
||||
app:fab_addButtonColorNormal="@color/black"
|
||||
app:fab_addButtonColorPressed="@color/white"
|
||||
app:fab_addButtonPlusIconColor="@color/black">
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fu_btn_1"
|
||||
app:fab_title="开始"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fab_size="mini"
|
||||
app:fab_icon="@drawable/ic_baseline_play_arrow_24"/>
|
||||
app:fab_addButtonPlusIconColor="@color/white">
|
||||
<!-- <com.getbase.floatingactionbutton.FloatingActionButton-->
|
||||
<!-- android:id="@+id/fu_btn_1"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:fab_size="mini"-->
|
||||
<!-- app:fab_icon="@drawable/ic_baseline_play_arrow_24"-->
|
||||
<!-- app:fab_colorNormal="@color/black"/>-->
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fu_btn_2"
|
||||
app:fab_title="关闭悬浮窗"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fab_size="mini"
|
||||
app:fab_icon="@drawable/ic_baseline_phonelink_erase_24"/>
|
||||
app:fab_icon="@drawable/ic_baseline_phonelink_erase_24"
|
||||
app:fab_colorNormal="@color/black"/>
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fu_btn_3"
|
||||
app:fab_title="服务停止"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fab_size="mini"
|
||||
app:fab_icon="@drawable/ic_baseline_stop_24"/>
|
||||
app:fab_icon="@drawable/ic_baseline_stop_24"
|
||||
app:fab_colorNormal="@color/black"/>
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fu_btn_4"
|
||||
app:fab_title="关闭服务"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fab_size="mini"
|
||||
app:fab_icon="@drawable/ic_baseline_power_settings_new_24"/>
|
||||
app:fab_icon="@drawable/ic_baseline_power_settings_new_24"
|
||||
app:fab_colorNormal="@color/black"/>
|
||||
</com.getbase.floatingactionbutton.FloatingActionsMenu>
|
||||
</LinearLayout>
|
||||
@@ -1,45 +1,190 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="30dp"
|
||||
>
|
||||
<Button
|
||||
android:id="@+id/btn_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="开启服务"
|
||||
tools:ignore="HardcodedText" />
|
||||
<Button
|
||||
android:id="@+id/btn_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="开启悬浮窗"
|
||||
tools:ignore="HardcodedText" />
|
||||
<Button
|
||||
android:id="@+id/btn_3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="开启悬浮窗权限"
|
||||
tools:ignore="HardcodedText" />
|
||||
<Button
|
||||
android:id="@+id/btn_4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="开始"
|
||||
tools:ignore="HardcodedText" />
|
||||
<Button
|
||||
android:id="@+id/btn_5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="停止"
|
||||
tools:ignore="HardcodedText" />
|
||||
android:background="@mipmap/zu_9308"
|
||||
tools:ignore="ExtraText">
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="56dp"
|
||||
android:layout_marginLeft="27dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/recommed"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/recommend"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="启用前,请关闭微信通知,将省电模式设置为无限制,给予自启动权限"
|
||||
tools:ignore="HardcodedText" />
|
||||
</LinearLayout>
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="121dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:text="通讯录好友"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="56dp"
|
||||
android:layout_marginLeft="114dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/share"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9309"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="85dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="121dp"
|
||||
android:layout_marginLeft="106.5dp"
|
||||
android:text="直播间/视频分享"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="56dp"
|
||||
android:layout_marginLeft="200dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/channel"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/recommend"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="121dp"
|
||||
android:layout_marginLeft="199dp"
|
||||
android:text="视频号点赞评论"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="704.5dp"
|
||||
android:layout_marginLeft="27dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/trick"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9309"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="769.5dp"
|
||||
android:layout_marginLeft="37dp"
|
||||
android:text="话术设置"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="704.5dp"
|
||||
android:layout_marginLeft="114dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/system"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9309"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="769.5dp"
|
||||
android:layout_marginLeft="124dp"
|
||||
android:text="系统设置"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="704.5dp"
|
||||
android:layout_marginLeft="201dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/cut"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9310"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="771dp"
|
||||
android:layout_marginLeft="211dp"
|
||||
android:text="切换平台"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="94.85dp"
|
||||
android:layout_height="74.11dp"
|
||||
android:layout_marginTop="605.34dp"
|
||||
android:layout_marginLeft="270.58dp"
|
||||
android:src="@mipmap/way5398"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,45 +1,190 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="30dp"
|
||||
>
|
||||
<Button
|
||||
android:id="@+id/btn_1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="开启服务"
|
||||
tools:ignore="HardcodedText" />
|
||||
<Button
|
||||
android:id="@+id/btn_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="开启悬浮窗"
|
||||
tools:ignore="HardcodedText" />
|
||||
<Button
|
||||
android:id="@+id/btn_3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="开启悬浮窗权限"
|
||||
tools:ignore="HardcodedText" />
|
||||
<Button
|
||||
android:id="@+id/btn_4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="开始"
|
||||
tools:ignore="HardcodedText" />
|
||||
<Button
|
||||
android:id="@+id/btn_5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="停止"
|
||||
tools:ignore="HardcodedText" />
|
||||
android:background="@mipmap/zu_9308"
|
||||
tools:ignore="ExtraText">
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="56dp"
|
||||
android:layout_marginLeft="27dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/recommed"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/recommend"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="启用前,请关闭微信通知,将省电模式设置为无限制,给予自启动权限"
|
||||
tools:ignore="HardcodedText" />
|
||||
</LinearLayout>
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="121dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:text="通讯录好友"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="56dp"
|
||||
android:layout_marginLeft="114dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/share"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9309"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="85dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="121dp"
|
||||
android:layout_marginLeft="106.5dp"
|
||||
android:text="直播间/视频分享"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="56dp"
|
||||
android:layout_marginLeft="200dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/channel"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/recommend"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="121dp"
|
||||
android:layout_marginLeft="199dp"
|
||||
android:text="视频号点赞评论"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="704.5dp"
|
||||
android:layout_marginLeft="27dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/trick"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9309"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="769.5dp"
|
||||
android:layout_marginLeft="37dp"
|
||||
android:text="话术设置"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="704.5dp"
|
||||
android:layout_marginLeft="114dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/system"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9309"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="769.5dp"
|
||||
android:layout_marginLeft="124dp"
|
||||
android:text="系统设置"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="704.5dp"
|
||||
android:layout_marginLeft="201dp"
|
||||
android:background="@drawable/mybutton"
|
||||
tools:ignore="RtlHardcoded">
|
||||
<Button
|
||||
android:id="@+id/cut"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="#00000000"/>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="38.4dp"
|
||||
android:layout_height="38.4dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@mipmap/zu_9310"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="771dp"
|
||||
android:layout_marginLeft="211dp"
|
||||
android:text="切换平台"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="HardcodedText,RtlHardcoded,SmallSp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="94.85dp"
|
||||
android:layout_height="74.11dp"
|
||||
android:layout_marginTop="605.34dp"
|
||||
android:layout_marginLeft="270.58dp"
|
||||
android:src="@mipmap/way5398"
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -10,4 +10,5 @@
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="gray">#b8b8b8</color>
|
||||
</resources>
|
||||
12
wechat/src/main/res/xml/abl_service.xml
Normal file
12
wechat/src/main/res/xml/abl_service.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:accessibilityEventTypes="typeAllMask"
|
||||
android:accessibilityFeedbackType="feedbackAllMask"
|
||||
android:accessibilityFlags="flagDefault"
|
||||
android:canPerformGestures="true"
|
||||
android:canRequestFilterKeyEvents="true"
|
||||
android:canRetrieveWindowContent="true"
|
||||
android:canRequestTouchExplorationMode="true"
|
||||
android:canRequestEnhancedWebAccessibility="true"
|
||||
android:packageNames="com.ss.android.ugc.aweme"
|
||||
android:notificationTimeout="100" />
|
||||
Reference in New Issue
Block a user