update 实名认证校验
This commit is contained in:
@@ -56,6 +56,7 @@ object MyLooper {
|
|||||||
SPUtils.getInstance("limit").clear()
|
SPUtils.getInstance("limit").clear()
|
||||||
SPUtils.getInstance("groupInvite").clear()
|
SPUtils.getInstance("groupInvite").clear()
|
||||||
SPUtils.getInstance("lastImage").clear()
|
SPUtils.getInstance("lastImage").clear()
|
||||||
|
SPUtils.getInstance("myInfo").clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getInstance(): Handler {
|
fun getInstance(): Handler {
|
||||||
|
|||||||
@@ -2,13 +2,11 @@ package org.yameida.worktool.service
|
|||||||
|
|
||||||
import com.blankj.utilcode.util.GsonUtils
|
import com.blankj.utilcode.util.GsonUtils
|
||||||
import com.blankj.utilcode.util.LogUtils
|
import com.blankj.utilcode.util.LogUtils
|
||||||
|
import com.blankj.utilcode.util.SPUtils
|
||||||
import org.yameida.worktool.Constant
|
import org.yameida.worktool.Constant
|
||||||
import org.yameida.worktool.model.ExecCallbackBean
|
import org.yameida.worktool.model.ExecCallbackBean
|
||||||
import org.yameida.worktool.model.WeworkMessageBean
|
import org.yameida.worktool.model.WeworkMessageBean
|
||||||
import org.yameida.worktool.utils.AccessibilityExtraUtil
|
import org.yameida.worktool.utils.*
|
||||||
import org.yameida.worktool.utils.AccessibilityUtil
|
|
||||||
import org.yameida.worktool.utils.Views
|
|
||||||
import org.yameida.worktool.utils.WeworkRoomUtil
|
|
||||||
import java.lang.StringBuilder
|
import java.lang.StringBuilder
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -177,6 +175,14 @@ object WeworkGetImpl {
|
|||||||
LogUtils.v("corp", corp)
|
LogUtils.v("corp", corp)
|
||||||
LogUtils.v("info", info.toString())
|
LogUtils.v("info", info.toString())
|
||||||
}
|
}
|
||||||
|
if (tvList.size > 1) {
|
||||||
|
if (!SPUtils.getInstance("myInfo").getBoolean("realName", false)) {
|
||||||
|
AccessibilityUtil.performClick(tvList[1])
|
||||||
|
getRealName(nickname)
|
||||||
|
} else {
|
||||||
|
LogUtils.d("已实名认证")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Constant.myName = nickname
|
Constant.myName = nickname
|
||||||
@@ -232,6 +238,11 @@ object WeworkGetImpl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!SPUtils.getInstance("myInfo").getBoolean("realName", false)) {
|
||||||
|
getRealName(myInfo.name)
|
||||||
|
} else {
|
||||||
|
LogUtils.d("已实名认证")
|
||||||
|
}
|
||||||
LogUtils.d("我的信息", GsonUtils.toJson(myInfo))
|
LogUtils.d("我的信息", GsonUtils.toJson(myInfo))
|
||||||
val weworkMessageBean = WeworkMessageBean()
|
val weworkMessageBean = WeworkMessageBean()
|
||||||
weworkMessageBean.type = WeworkMessageBean.GET_MY_INFO
|
weworkMessageBean.type = WeworkMessageBean.GET_MY_INFO
|
||||||
@@ -412,4 +423,27 @@ object WeworkGetImpl {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取实名状态
|
||||||
|
*/
|
||||||
|
private fun getRealName(nickname: String) {
|
||||||
|
if (AccessibilityExtraUtil.loadingPage("SettingMineInfoActivity")) {
|
||||||
|
if (AccessibilityUtil.findTextAndClick(getRoot(), "姓名", exact = true)) {
|
||||||
|
val realNameFlag = AccessibilityUtil.findOneByText(getRoot(), "实名认证", exact = true)
|
||||||
|
if (realNameFlag != null) {
|
||||||
|
val notRealName = AccessibilityUtil.findOnceByText(getRoot(), "未认证")
|
||||||
|
val realName = AccessibilityUtil.findOnceByClazz(AccessibilityUtil.findBackNode(realNameFlag, 1), Views.TextView)
|
||||||
|
if (notRealName != null) {
|
||||||
|
LogUtils.d("未实名认证: $nickname")
|
||||||
|
error("未实名认证: $nickname")
|
||||||
|
} else if (realName != null) {
|
||||||
|
LogUtils.d("实名认证: ${realName.text}")
|
||||||
|
log("实名认证: ${realName.text}")
|
||||||
|
SPUtils.getInstance("myInfo").put("realName", true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,13 +4,16 @@ import android.os.Message
|
|||||||
import android.view.accessibility.AccessibilityNodeInfo
|
import android.view.accessibility.AccessibilityNodeInfo
|
||||||
import androidx.core.text.isDigitsOnly
|
import androidx.core.text.isDigitsOnly
|
||||||
import com.blankj.utilcode.util.*
|
import com.blankj.utilcode.util.*
|
||||||
|
import com.hjq.toast.ToastUtils
|
||||||
import org.yameida.worktool.Constant
|
import org.yameida.worktool.Constant
|
||||||
import org.yameida.worktool.Demo
|
import org.yameida.worktool.Demo
|
||||||
|
import org.yameida.worktool.MyApplication
|
||||||
import org.yameida.worktool.activity.GetScreenShotActivity
|
import org.yameida.worktool.activity.GetScreenShotActivity
|
||||||
import org.yameida.worktool.model.WeworkMessageBean
|
import org.yameida.worktool.model.WeworkMessageBean
|
||||||
import org.yameida.worktool.observer.MultiFileObserver
|
import org.yameida.worktool.observer.MultiFileObserver
|
||||||
import org.yameida.worktool.service.WeworkController.mainLoopRunning
|
import org.yameida.worktool.service.WeworkController.mainLoopRunning
|
||||||
import org.yameida.worktool.utils.*
|
import org.yameida.worktool.utils.*
|
||||||
|
import org.yameida.worktool.utils.envcheck.CheckRoot
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.lang.Exception
|
import java.lang.Exception
|
||||||
import java.lang.StringBuilder
|
import java.lang.StringBuilder
|
||||||
@@ -45,6 +48,9 @@ object WeworkLoopImpl {
|
|||||||
getChatroomList()
|
getChatroomList()
|
||||||
if (!mainLoopRunning) break
|
if (!mainLoopRunning) break
|
||||||
getFriendRequest()
|
getFriendRequest()
|
||||||
|
if (!mainLoopRunning) break
|
||||||
|
checkRealName()
|
||||||
|
if (!mainLoopRunning) break
|
||||||
sleep(300)
|
sleep(300)
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@@ -59,10 +65,25 @@ object WeworkLoopImpl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查账号是否已实名
|
||||||
|
*/
|
||||||
|
private fun checkRealName(): Boolean {
|
||||||
|
if (!SPUtils.getInstance("myInfo").getBoolean("realName", false)
|
||||||
|
&& CheckRoot.isDeviceRooted()) {
|
||||||
|
LogUtils.e("账号实名前请先关闭WorkTool主功能!")
|
||||||
|
ToastUtils.show("账号实名前请先关闭WorkTool主功能!")
|
||||||
|
MyApplication.launchIntent()
|
||||||
|
sleep(5000)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 读取通讯录好友请求
|
* 读取通讯录好友请求
|
||||||
*/
|
*/
|
||||||
fun getFriendRequest(): Boolean {
|
private fun getFriendRequest(): Boolean {
|
||||||
val list = AccessibilityUtil.findAllOnceByText(getRoot(), "通讯录", exact = true)
|
val list = AccessibilityUtil.findAllOnceByText(getRoot(), "通讯录", exact = true)
|
||||||
for (item in list) {
|
for (item in list) {
|
||||||
val childCount = item.parent?.parent?.parent?.childCount
|
val childCount = item.parent?.parent?.parent?.childCount
|
||||||
|
|||||||
@@ -18,19 +18,24 @@ public class CheckRoot {
|
|||||||
|
|
||||||
public static boolean isDeviceRooted() {
|
public static boolean isDeviceRooted() {
|
||||||
if (checkDeviceDebuggable()) {
|
if (checkDeviceDebuggable()) {
|
||||||
|
Log.i(LOG_TAG, "isDeviceRooted: checkDeviceDebuggable()");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (checkSuperuserApk()) {
|
if (checkSuperuserApk()) {
|
||||||
|
Log.i(LOG_TAG, "isDeviceRooted: checkSuperuserApk()");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (checkRootPathSU()) {
|
if (checkRootPathSU()) {
|
||||||
|
Log.i(LOG_TAG, "isDeviceRooted: checkRootPathSU()");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (checkRootWhichSU()) {
|
if (checkRootWhichSU()) {
|
||||||
|
Log.i(LOG_TAG, "isDeviceRooted: checkRootWhichSU()");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkAccessRootData()) {
|
if (checkAccessRootData()) {
|
||||||
|
Log.i(LOG_TAG, "isDeviceRooted: checkAccessRootData()");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user