• Tasker的权限和特殊服务


    Tasker需要开启很多服务和获取很多权限

    通过下面的命令可以详细获取Tasker相关的权限和服务

    adb shell dumpsys package net.dinglisch.android.taskerm

    也可以用下面的命令将所有显示的信息保存到文本文件中

    adb shell dumpsys package net.dinglisch.android.taskerm >tasker.txt

    1.权限有普通权限和特殊权限,大部分权限可以手动通过设置来打开,一部分特殊权限需要使用adb授权.

    a. 常规权限可以通过下面的代码获取

    adb shell pm grant net.dinglisch.android.taskerm android.permission.PACKAGE_USAGE_STATS
    adb shell pm grant net.dinglisch.android.taskerm android.permission.BODY_SENSORS
    adb shell pm grant net.dinglisch.android.taskerm android.permission.WRITE_CALL_LOG
    adb shell pm grant net.dinglisch.android.taskerm android.permission.READ_CALL_LOG
    adb shell pm grant net.dinglisch.android.taskerm android.permission.RECEIVE_SMS
    adb shell pm grant net.dinglisch.android.taskerm android.permission.WRITE_EXTERNAL_STORAGE
    adb shell pm grant net.dinglisch.android.taskerm android.permission.RECORD_AUDIO
    adb shell pm grant net.dinglisch.android.taskerm android.permission.READ_PHONE_STATE
    adb shell pm grant net.dinglisch.android.taskerm android.permission.SEND_SMS
    adb shell pm grant net.dinglisch.android.taskerm android.permission.READ_SMS
    adb shell pm grant net.dinglisch.android.taskerm android.permission.ACCESS_FINE_LOCATION
    adb shell pm grant net.dinglisch.android.taskerm android.permission.ACCESS_COARSE_LOCATION
    adb shell pm grant net.dinglisch.android.taskerm android.permission.CAMERA
    adb shell pm grant net.dinglisch.android.taskerm android.permission.PROCESS_OUTGOING_CALLS
    adb shell pm grant net.dinglisch.android.taskerm android.permission.READ_CONTACTS
    adb shell pm grant net.dinglisch.android.taskerm android.permission.WRITE_CONTACTS
    adb shell pm grant net.dinglisch.android.taskerm android.permission.CALL_PHONE
    adb shell pm grant net.dinglisch.android.taskerm android.permission.READ_CALENDAR
    adb shell pm grant net.dinglisch.android.taskerm android.permission.WRITE_CALENDAR
    adb shell pm grant net.dinglisch.android.taskerm android.permission.CHANGE_CONFIGURATION
    adb shell pm grant net.dinglisch.android.taskerm android.permission.ANSWER_PHONE_CALLS
    adb shell pm grant net.dinglisch.android.taskerm android.permission.SET_MEDIA_KEY_LISTENER
    adb shell pm grant net.dinglisch.android.taskerm android.permission.SYSTEM_ALERT_WINDOW
    adb shell pm grant net.dinglisch.android.taskerm android.permission.SET_PROCESS_LIMIT
    adb shell pm grant net.dinglisch.android.taskerm android.permission.READ_EXTERNAL_STORAGE
    adb shell pm grant net.dinglisch.android.taskerm android.permission.ACCESS_BACKGROUND_LOCATION
    点击查看普通权限代码

    b. 可以通过 (把Tasker安装文件放置到手机存储根目录,代码中的/storage/6C32-2486/  为手机根目录路径,每个手机均不同)

    adb shell pm install -g /storage/6C32-2486/tasker.apk

    或者(把Tasker安装文件放置到adb根目录)

    adb install -g tasker.apk

    这两种adb安装方式直接获取常规权限.

    c. 可以在系统应用设置界面手动赋予权限.

    特殊权限只能通过adb或者root授权:

    adb shell pm grant net.dinglisch.android.taskerm android.permission.WRITE_SECURE_SETTINGS
    adb shell pm grant net.dinglisch.android.taskerm android.permission.DUMP
    adb shell pm grant net.dinglisch.android.taskerm android.permission.READ_LOGS
    adb shell pm grant net.dinglisch.android.taskerm android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER

    2.Tasker需要开启的服务有 无障碍服务(辅助功能) 和 通知管理服务,既可以手动通过系统设置赋权也可以使用下面的adb 命令开启

    settings put secure enabled_accessibility_services net.dinglisch.android.taskerm/.MyAccessibilityService
    settings put secure accessibility_enabled 1
    
    settings put secure enabled_notification_listeners net.dinglisch.android.taskerm/.NotificationListenerService
    settings put secure notification_enabled 1

    3. 除此以外已知的还有 设备管理器,通知使用权,电池优化,应用自启,允许第三方启动,开机启动,助手设置 需要手动开启.

    4. 需要关闭的权限或者服务:涉及到短信的配置,建议关闭系统的短信验证码保护(例如:EMUI)

    Android 10,Tasker 5.9.1 暂不建议开启 WRITE_SECURE_SETTINGS 可以使用下面的命令取消权限
    adb shell pm revoke net.dinglisch.android.taskerm android.permission.WRITE_SECURE_SETTINGS

    注:基于Android 10,Tasker 5.9.1 不同系统版本和应用版本可能略有不同.

    原文链接:
    https://taskerm.com/2020/01/31/how-to-enable-all-permissions-and-services-required-by-tasker-in-pc/
    Tasker配置教程站
    https://taskerm.com/

     
  • 相关阅读:
    黑马程序员:3分钟带你读懂C/C++学习路线
    大学毕业的你,满腔洪荒之力却找不到出口?
    从零基础到精通的前端学习路线
    Python学习笔记(2)——Python的函数、模块、包和库
    Python学习笔记(1)——Python的概述(Python的环境、变量、数据类型、基本运算)
    MATLAB优化——减少for的使用
    初识Python(windows)——下载、安装、使用
    高维数据稀疏表示-什么是字典学习(过完备词典)
    用1天快速上手org-mode(windows系统)
    零基础数据挖掘学习清单
  • 原文地址:https://www.cnblogs.com/zyc63959/p/12196754.html
Copyright © 2020-2023  润新知