Skip to content

Instantly share code, notes, and snippets.

View Forgo7ten's full-sized avatar
😃
I may be slow to respond.

Forgo7ten Forgo7ten

😃
I may be slow to respond.
View GitHub Profile
@Forgo7ten
Forgo7ten / removeSameRow.py
Last active November 8, 2021 14:16
python简单去除txt文本文件中的相同行
# coding=utf-8
# @File : removeSameRow.py
# @Desc : 检测文件中相同行,并去重
# @Author : Forgo7ten
# @Time : 2021/11/3
# 原始文件名
readFilePath = "./original.txt"
# 输出文件名
@Forgo7ten
Forgo7ten / PermissionsUtil-Main.java
Last active November 9, 2021 07:04
Android动态申请权限 工具类
/** 调用示范 **/
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)
@Forgo7ten
Forgo7ten / checkDangerousPermissions.py
Last active November 9, 2021 07:05
检查应用需动态申请的危险权限并打印到控制台
# coding=utf-8
# @File : CheckDangerousPermissions.py
# @Desc : 检查应用需动态申请的危险权限并打印到控制台
# @Author : Forgo7ten
# @Time : 2021/11/3
# 预存危险权限列表
permissions_list = []
# 输入文件
@Forgo7ten
Forgo7ten / wakeUpAndUnlock
Last active November 5, 2021 10:28
Android代码:唤醒手机屏幕并解锁
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 |
@Forgo7ten
Forgo7ten / dex_checksum.py
Created November 8, 2021 14:14
dex文件计算校验和
# coding=utf-8
# @File : dex_checksum.py
# @Desc : 计算dex的checksum
# @Author : https://www.52pojie.cn/thread-1070218-1-1.html
# @Time : 2021/11/8
# Adler-32算法如下步骤实现:
# 1. 定义两个变量varA、varB,其中varA初始化为1,varB初始化为0。
# 2. 读取字节数组的一个字节(假设该字节变量名为byte),计算varA = (varA + byte) mod 65521,然后可以计算出varB = (varA + varB) mod 65521。
# 3. 重复步骤2,直到字节数组全部读取完毕,得到最终varA、varB两个变量的结果。
@Forgo7ten
Forgo7ten / register010Editor.py
Last active August 30, 2024 07:14
010Editor编辑器注册机,适用于Version: 12.0.1
# coding=utf-8
# @File : register010Editor.py
# @Desc : 010Editor编辑器注册机,适用版本Version: 12.0.1
# @Author : Forgo7ten
# @Time : 2021/11/21
import random
import sys
import time
@Forgo7ten
Forgo7ten / 窗口置顶.ahk
Created November 21, 2021 12:48
通过Win+`键使任意窗口置顶、取消置顶 [autohotkey工具](https://autohotkey.com/)
;==================================================
;** 快捷键 Win+` 使当前窗口置顶
;==================================================
#`::
WinSet, AlwaysOnTop, toggle,A
WinGetTitle, getTitle, A
Winget, getTop,ExStyle,A
if (getTop & 0x8)
TrayTip 已置顶, 窗口标题: `n%getTitle%,10,1
else
@Forgo7ten
Forgo7ten / FirstShellTool.java
Created November 23, 2021 00:19
修改dex文件并修复 CheckSum、filesize、sha1;将某文件添加到dex文件的末尾
import java.io.*;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.zip.Adler32;
public class FirstShellTool {
private static final String originApk = "C:\\Users\\Palmer\\Desktop\\classes3.dex";
@Forgo7ten
Forgo7ten / PAC丨GFWlist黑名单模式.json
Created January 7, 2022 12:31
v2rayN-Core路由设置配置
[
{
"outboundTag": "proxy",
"domain": [
"#以下三行是GitHub网站,为了不影响下载速度走代理",
"github.com",
"githubassets.com",
"githubusercontent.com"
]
},
@Forgo7ten
Forgo7ten / auto_save.xml
Last active January 18, 2022 12:59
Keepass触发器配置备份
<?xml version="1.0" encoding="utf-8"?>
<TriggerCollection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Triggers>
<Trigger>
<Guid>gBH/MZ7ynUCRjBBVAZxEbw==</Guid>
<Name>On KeePass start: Auto Save buttons, initialize</Name>
<Events>
<Event>
<TypeGuid>1M7NtUuYT/KmqeJVJh7I6A==</TypeGuid>
<Parameters />