update 优化推送文件;更新兼容版本

This commit is contained in:
gallonyin
2022-10-25 18:25:55 +08:00
parent 28d6004777
commit 22ea9211a3
3 changed files with 10 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ import com.blankj.utilcode.util.SPUtils
object Constant { object Constant {
val AVAILABLE_VERSION = arrayListOf("4.0.2", "4.0.6", "4.0.8", "4.0.10", "4.0.12", "4.0.16") val AVAILABLE_VERSION = arrayListOf("4.0.2", "4.0.6", "4.0.8", "4.0.10", "4.0.12", "4.0.16", "4.0.18", "4.0.19")
const val PACKAGE_NAMES = "com.tencent.wework" const val PACKAGE_NAMES = "com.tencent.wework"
const val LISTEN_CHANNEL_ID = "LISTEN_CHANNEL_ID" const val LISTEN_CHANNEL_ID = "LISTEN_CHANNEL_ID"
const val WEWORK_NOTIFY = "wework_notify" const val WEWORK_NOTIFY = "wework_notify"

View File

@@ -54,6 +54,13 @@ object WeworkLoopImpl {
if (item.parent.childCount > 1) { if (item.parent.childCount > 1) {
LogUtils.d("通讯录有红点") LogUtils.d("通讯录有红点")
AccessibilityUtil.performClick(item) AccessibilityUtil.performClick(item)
val hasRecommendFriend = AccessibilityUtil.findOneByText(getRoot(), "可能的", timeout = Constant.POP_WINDOW_INTERVAL)
if (hasRecommendFriend != null) {
LogUtils.d("有可能认识的人")
AccessibilityUtil.performClick(hasRecommendFriend)
goHome()
return false
}
val addButton = AccessibilityUtil.findOneByText(getRoot(), "添加") val addButton = AccessibilityUtil.findOneByText(getRoot(), "添加")
val backNode = AccessibilityUtil.findBackNode(addButton) val backNode = AccessibilityUtil.findBackNode(addButton)
if (backNode?.className == Views.TextView) { if (backNode?.className == Views.TextView) {

View File

@@ -5,6 +5,7 @@ import android.provider.Settings
import androidx.core.content.FileProvider import androidx.core.content.FileProvider
import com.blankj.utilcode.util.LogUtils import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.Utils import com.blankj.utilcode.util.Utils
import org.yameida.worktool.Constant
import java.io.File import java.io.File
/** /**
@@ -60,6 +61,7 @@ object ShareUtil {
val fileURI = FileProvider.getUriForFile(app, app.packageName + ".fileprovider", file) val fileURI = FileProvider.getUriForFile(app, app.packageName + ".fileprovider", file)
putExtra(Intent.EXTRA_STREAM, fileURI) putExtra(Intent.EXTRA_STREAM, fileURI)
} }
intent.setPackage(Constant.PACKAGE_NAMES)
app.startActivity(Intent.createChooser(intent, "WorkTool文件分享").apply { flags = Intent.FLAG_ACTIVITY_NEW_TASK }) app.startActivity(Intent.createChooser(intent, "WorkTool文件分享").apply { flags = Intent.FLAG_ACTIVITY_NEW_TASK })
LogUtils.e("分享了 $type ${file.absolutePath}") LogUtils.e("分享了 $type ${file.absolutePath}")
return true return true