Skip to content

Instantly share code, notes, and snippets.

View pexcn's full-sized avatar
🇹🇼

Sing Yu Chan pexcn

🇹🇼
  • Earth ⇄ Venus
  • Taiwan
View GitHub Profile

Fix magisk stock backup does not exist

# put stock boot.img into /sdcard/boot.img

# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
@pexcn
pexcn / service.sh
Last active October 18, 2025 15:10
Keep xiaomi camera connected
#!/system/bin/sh
until [ -d "/sdcard/Android" ]; do
sleep 3
done
sleep 10
sh /sdcard/xiaomi-camera-checker.sh >>/sdcard/xiaomi-camera-checker.log 2>&1
@pexcn
pexcn / hh_repart
Last active July 16, 2025 17:51
System partition resize script for Nexus 5.
#!/sbin/sh
#
# Copyright (C) 2018 Unlegacy Android Project
# Copyright (C) 2018 Svyatoslav Ryhel
# Copyright (C) 2019 Nick80835
# Copyright (C) 2019 z3dd3r
#
# Made for Hammerhead
#
@pexcn
pexcn / README.md
Last active May 27, 2025 02:53
Build PixelOS 15 on ArchLinux.
sudo pacman -S --needed base-devel git gnupg flex bison zip curl zlib libx11 mesa libxml2 libxslt unzip fontconfig gcc-multilib ccache bc git-lfs gperf imagemagick protobuf python-protobuf elfutils ncurses lz4 sdl libxml2 lzop rsync squashfs-tools fontconfig imagemagick ttf-dejavu cpio git-lfs freetype2 unzip zip rsync
@pexcn
pexcn / inject-sessdata-into-bbll.md
Last active March 2, 2025 07:44
Inject SESSDATA into BBLL.

Inject SESSDATA into BBLL

Make BBLL debuggable

# disassemble apk
apktool d -o BBLL BBLL-official.apk

# edit AndroidManifest.xml
# add `android:debuggable="true"` into application node
@pexcn
pexcn / battery-health.json
Last active January 4, 2025 05:07
Some hacks for Oxygen OS 11 via Thanox.
[
{
"name": "Battery health",
"description": "当充电状态变化时,显示电池健康度",
"priority": 1,
"delay": 250,
"condition": "powerConnected || powerDisconnected",
"actions": [
"ui.showLongToast(\"电池健康度 \" + su.exe(\"cat /sys/class/power_supply/bms/battery_h\").out[0] + \"\n循环次数 \" + su.exe(\"cat /sys/class/power_supply/battery/cycle_count\").out[0]);"
]
@pexcn
pexcn / shadowsocks-speedtests.md
Last active January 3, 2025 09:49
Shadowsocks 各加密方式的速度测试报告

Shadowsocks 各加密方式的速度测试报告

TL;DR (仅针对当前版本)

  • 若不知道 CPU 是否支持 AES-NI, 则 chacha20-ietf-poly1305 为最稳妥的选择。
  • 若 CPU 支持 AES-NI, 则 shadowsocks-rust 选择 aes-128-gcm, shadowsocks-libev 选择 aes-256-gcm 为最佳。

Unpack Android system.new.dat.br

pacman -S brotli p7zip
curl -L -o /usr/local/bin/sdat2img.py https://github.com/xpirt/sdat2img/raw/master/sdat2img.py && chmod +x sdat2img.py

brotli -d system.new.dat.br
sdat2img.py system.transfer.list system.new.dat system.img
7z -y -bsp0 -bso0 x system.img

Windows 和 macOS 共享蓝牙配对信息

  1. 将设备与 Windows 配对
  2. 重新启动并将设备与 macOS 配对
  3. 打开 "钥匙串访问", 搜索 "bluetooth" 并找到对应的条目
  4. 打开条目,显示密码,提取 plist
  5. 重启使用 SYSTEM 权限打开 Windows 注册表,定位到 HKLM\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\网卡MAC地址\设备地址
  6. 按照以下键值对的对应关系,使用注册表的导入和导出功能修改,最后重启系统

| macOS 键 | Windows 键 | 排序 |

@pexcn
pexcn / README.md
Created August 22, 2024 06:33 — forked from Mnkai/README.md
TDP and turbo parameter modification with MSR on non-overclockable Intel CPU (such as Intel i7-8550U)

TDP and Turbo Parameter Modification with MSR on Non-Overclockable CPUs

Disclaimer

  • Modifying MSR may void your CPU's (or system board's) warranty. Proceed with caution. I am not responsible for any damage caused by this article.
  • MSR addresses vary significantly between CPUs. Check your CPU's MSR address using Intel's documentation.
  • This has only been tested on the Intel i7-8550U (Kaby Lake R).
  • This article is a translation of this article. If you can read Korean, I recommend reading that article instead.

Introduction