Skip to content

Instantly share code, notes, and snippets.

@realvjy
realvjy / ChoasLinesShader.metal
Last active March 7, 2026 10:41
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@import Photos;
[PHPhotoLibrary requestAuthorizationForAccessLevel:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus status) {
NSLog(@"PHAuthorizationStatus: %ld", status);
PHFetchOptions *fetchOptions = [[PHFetchOptions alloc] init];
fetchOptions.includeHiddenAssets = YES;
fetchOptions.includeAllBurstAssets = YES;
PHFetchResult<PHAsset *> *result = [PHAsset fetchAssetsWithOptions:fetchOptions];
@NghiaTranUIT
NghiaTranUIT / iosCertTrustManager.py
Created December 12, 2019 04:37
iosCertTrustManager.py
#! /usr/bin/env python
# Script to manage additional trusted root certificate in the IOS simulator
#
# Allows to add/list/delete/export trusted root certificates to the IOS simulator
# TrustStore.sqlite3 file.
#
# Additionally, root certificates added to a device can be listed and exported from
# a device backup
#
@jakeajames
jakeajames / patch.sh
Last active November 6, 2025 16:41
Make h3lix work when installed not-via-Impactor. To be used with the latest h3lix.
if [ $# != 2 ]; then
echo "Usage: $0 /path/to/input_ipa /path/to/output_ipa"
exit 1
fi
if ! [ -f $1 ]; then
echo "'$1' does not exist"
exit 1
fi
@fabianfett
fabianfett / Change Xcode version in GitHub Actions
Created August 21, 2019 09:37
How to change the Xcode version in GitHub Actions
# Change Xcode version in GitHub Actions
As of today (2019-08-21) I haven't found any documentation on changing Xcode versions when
using GitHub actions. So I checked the applications folder and everything we need is
already there. 🤩
```
> ls -n /Applications/ | grep Xcode*
lrwxr-xr-x 1 0 80 30 Aug 2 19:31 Xcode.app -> /Applications/Xcode_10.2.1.app
drwxr-xr-x 3 501 20 96 Oct 20 2018 Xcode_10.1.app
@douglashill
douglashill / KeyboardTableView.swift
Last active March 30, 2023 22:01
A UITableView that allows navigation and selection using a hardware keyboard.
// Douglas Hill, December 2018
// Made for https://douglashill.co/reading-app/
// Find the latest version of this file at https://github.com/douglashill/KeyboardKit
import UIKit
/// A table view that allows navigation and selection using a hardware keyboard.
/// Only supports a single section.
class KeyboardTableView: UITableView {
// These properties may be set or overridden to provide discoverability titles for key commands.

一、 简述

AXML 即 Android Binary XML, 是 Android 应用程序 APK 包中保存 xml 文件数据的一种方式, 可以减小 xml 文件的大小.

本文章与我的另一篇文章手把手教你解析 resources.arsc 是相关联的, resources.arsc 文件是 apk 的资源索引文件, 而 xml 文件是 apk 的资源文件, resources.arsc 保存了 xml 中需要用到的资源的索引, 它们之间有非常强的依赖关系, apk在执行的时候缺一不可.

另外大家在用 AXMLPrinter 去解码 AXML 文件时会看见输出中有很多属性的值都是一串数字, 很难明白是什么意思, 实际上这串数字就是资源的索引 id 值, 需要用这个 id 去 resources.arsc 中查找才能得到具体的字符串, 知道这个属性的值是 @string/XXXX 或者 @drawable/XXXX 等等.

在上面的文章中我介绍了 resources.arsc 文件的解析方式, 本文我来介绍怎样来解析 AXML 文件.

@wavezhang
wavezhang / java_download.sh
Last active March 13, 2026 23:29
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@MightyPork
MightyPork / usb_hid_keys.h
Last active February 26, 2026 21:45
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
# 你可以从该 URL 下载这个配置文件: http://surge.run/config-example/ios.conf
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备
# Version 2.0
[General]
# 日志等级: warning, notify, info, verbose (默认值: notify)
loglevel = notify
# 跳过某个域名或者 IP 段,这些目标主机将不会由 Surge Proxy 处理。(在 macOS
# 版本中,如果启用了 Set as System Proxy, 那么这些值会被写入到系统网络代理
# 设置中.)