Skip to content

Instantly share code, notes, and snippets.

setsupervision() {
perl -0pi -e "s/IsSupervised([\s\S]*?)(true|false)/IsSupervised\$1$1/" /var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles/CloudCon
figurationDetails.plist && killall -9 profiled && killall -9 Preferences 2>/dev/null
}
alias supervise='echo -n "Supervising device... "; setsupervision true; echo "done"'
alias unsupervise='echo -n "Unsupervising device... "; setsupervision false; echo "done"'
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google_auth.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
@0xallie
0xallie / ios_ota_sideloading.md
Created January 24, 2021 00:17
OTA sideloading on iOS

Note: This requires a paid developer certificate or an enterprise certificate. A free developer certificate will not work.

Create an Example.plist file with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>items</key>
@0xallie
0xallie / sideload.sh
Created December 18, 2020 19:17
Sideload IPA on jailbroken iOS device (like AppSync Unified, the installed apps will only work when the device is in jailbroken state)
#!/bin/bash
if (( EUID != 0 )); then
printf 'This script must be run as root.\n' >&2
exit 1
fi
if [[ $1 != *.ipa ]]; then
printf 'Usage: %s file.ipa\n' "$0" >&2
exit 1
@0xallie
0xallie / ios_app_signing_no_mac.md
Last active October 8, 2022 20:17
How to create an iOS app signing certificate without a Mac

How to create an iOS app signing certificate without a Mac

  1. openssl genrsa -out development.key 2048
  2. openssl req -new -key development.key -out development.csr -subj / (subject field doesn't matter, it will be overridden anyway)
  3. Go to developer portal (https://developer.apple.com/account/) -> Certificates, Identifiers & Profiles
  4. Create a new certificate, choose "Apple Development", and upload the .csr file
  5. Download the resulting .cer file
  6. Download the Apple WWDR intermediate certificate from https://www.apple.com/certificateauthority/ (the one that expires in 2030: https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer)
  7. openssl x509 -inform der -in development.cer -out development.pem
  8. openssl x509 -inform der -in AppleWWDRCAG3.cer -out AppleWWDRCAG3.pem
#!/bin/bash
echo 'Updating /etc/wsl.conf...'
printf '[network]\ngenerateResolvConf=false\' | sudo tee -a /etc/wsl.conf > /dev/null
echo 'Updating /etc/resolv.conf...'
printf 'nameserver 8.8.8.8' | sudo tee /etc/resolv.conf > /dev/null
echo 'DNS settings updated. Press Enter to terminate WSL. Any unsaved work will be lost!'
read -r < /dev/tty
wsl.exe --shutdown
@0xallie
0xallie / latestwv.sh
Created October 17, 2020 13:25
Get latest Widevine ChromeCDM version
#!/bin/bash
tmpdir=$(mktemp -d)
curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | dpkg-deb -x - "$tmpdir"
strings "$tmpdir/opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so" | grep '^4\.10'
rm -rf "$tmpdir"
@0xallie
0xallie / urlschemes.json
Last active April 27, 2024 04:45
iOS app URL schemes for Icon Themer shortcut
{
"com.8bit.bitwarden": " ",
"com.agilebits.onepassword-ios": "onepassword://",
"com.apple.airport.mobileairportutility": "apmanage://",
"com.apple.appleseed.FeedbackAssistant": "applefeedback://",
"com.apple.AppStore": "itms-apps://itunes.apple.com/",
"com.apple.AppStoreConnect": "shortcuts://run-shortcut?name=Icon%20Themer&input=%7B%22launch%22%3A%22Connect%22%7D",
"com.apple.artistconnect": "shortcuts://run-shortcut?name=Icon%20Themer&input=%7B%22launch%22%3A%22Artists%22%7D",
"com.apple.bnd": "beatsbond://",
"com.apple.Bridge": "com.apple.bridge://x",
@0xallie
0xallie / Namedays.js
Last active April 27, 2024 04:46
iOS 14 Scriptable Namedays widget
async function getCountry() {
let r = new Request('https://ipinfo.io/country')
let s = await r.loadString()
return s.trim()
}
function pad(n) {
return n.toString().padStart(2, '0')
}
#!/bin/sh
if (( EUID != 0 )); then
echo "ERROR: This script must be run as root." >&2
exit 1
fi
files=(
/var/MobileAsset/Assets/com_apple_MobileAsset_SoftwareUpdate
/var/MobileAsset/Assets/com_apple_MobileAsset_SoftwareUpdateDocumentation