Comments (6)
floaty.checkPermission
可能源自其他 Auto.js 版本的封装方法.
AutoJs6 v6.3.0 增加了 floaty.hasPermission
/ floaty.requestPermission
方法用于获取 "显示在其他应用上层" 权限授予状态及权限请求.
from autojs6.
为啥不和原作者一样啊,用floaty.requestPermission。这样软件适配会好点
from autojs6.
@hduwhyso floaty.requestPermission
已经可用.
from autojs6.
@hduwhyso
floaty.requestPermission
已经可用.
6.4.1还是提示不存在方法checkPermission。floaty.checkPermission()这个命令用不了
from autojs6.
目前AJ6的方法是floaty.hasPermission();能不能和原版一样,也用floaty.checkPermission()这个方法。
from autojs6.
AutoJs6 将继续保持 floaty.hasPermission
方法用于检查权限, 未来 checkPermission
将返回权限状态常量值.
按照 Android 的多数方法签名规律, 总结权限相关的方法如下.
-
checkPermission / checkSelfPermission
- 用于检查权限, 返回权限的状态常量值, 如
android.content.pm.PackageManager.PERMISSION_DENIED
和android.content.pm.PackageManager.PERMISSION_GRANTED
等.
- 用于检查权限, 返回权限的状态常量值, 如
-
hasPermission
- 用于判断是否被授予权限, 使用的一般是
checkPermission() == android.content.pm.PackageManager.PERMISSION_GRANTED
判断方法.
- 用于判断是否被授予权限, 使用的一般是
另外还有几个 AutoJs6 常用的权限相关的方法
-
requestPermission
- 申请权限.
-
revokePermission
- 撤销权限.
-
ensurePermission
- 确保权限授予, 否则将抛出异常.
AutoJs6 将尽量保证与 Auto.js 4.x 保持 API 的一致, 但为了更贴近方法名称的语义, checkPermission 将与原有 API 存在出入.
如果需要兼容其他版本 Auto.js, 可使用类似以下条件语句:
let hasFloatyPermission = context.packageName.includes('autojs6')
? floaty.hasPermission()
: floaty.checkPermission();
console.log(hasFloatyPermission);
from autojs6.
Related Issues (20)
- 『创建快捷方式』添加桌面快捷方式无反应 HOT 2
- 为啥不更新了呀?直接run没事,打包以后应用运行有问题
- java.lang.UnsatisfiedLinkError: dlopen failed: library "libjackpal-termexec2.so" not found
- 弹出框窗口控件有时候调用click不生效,只有在强制sleep一定时间后点击事件才生效
- 能够正常使用的脚本使用定时任务后工作异常
- 连接电脑有问题 HOT 2
- 打包后应用无法试用shizuku服务 HOT 2
- 混淆报错
- 无障碍服务运行一段时间出现故障
- 如何区分应用双开后的2个相同packageName的App HOT 1
- 打包的shizuku失效
- 正则表达式错误?
- 无法修改系统设置
- events.observeNotification()提示通知服务未运行
- 关于TCP Client HOT 1
- 怎么重写或继承java类呢?
- 打包时加入授权代码
- sdcardfs 存储无法保存文件
- 一个及其严重的bug,找不到find方法 HOT 1
- 反馈一个崩溃原因
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autojs6.