This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void wakeUpAndUnlock(Context context){ | |
| // 屏锁管理器 | |
| KeyguardManager km= (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); | |
| KeyguardManager.KeyguardLock kl = km.newKeyguardLock("unLock"); | |
| // 解锁 | |
| kl.disableKeyguard(); | |
| // 获取电源管理器对象 | |
| PowerManager pm=(PowerManager) context.getSystemService(Context.POWER_SERVICE); | |
| // 获取PowerManager.WakeLock对象,后面的参数|表示同时传入两个值,最后的是LogCat里用的Tag | |
| PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding=utf-8 | |
| # @File : CheckDangerousPermissions.py | |
| # @Desc : 检查应用需动态申请的危险权限并打印到控制台 | |
| # @Author : Forgo7ten | |
| # @Time : 2021/11/3 | |
| # 预存危险权限列表 | |
| permissions_list = [] | |
| # 输入文件 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** 调用示范 **/ | |
| public class MainActivity extends AppCompatActivity { | |
| private PermissionsUtil permissionsUtil; | |
| /** | |
| * 动态申请权限 | |
| */ | |
| private void requestPermission() { | |
| String[] permissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.READ_PHONE_STATE, Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.RECORD_AUDIO}; | |
| permissionsUtil = PermissionsUtil.with(this) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding=utf-8 | |
| # @File : removeSameRow.py | |
| # @Desc : 检测文件中相同行,并去重 | |
| # @Author : Forgo7ten | |
| # @Time : 2021/11/3 | |
| # 原始文件名 | |
| readFilePath = "./original.txt" | |
| # 输出文件名 |
NewerOlder