Skip to content

Instantly share code, notes, and snippets.

View zqqf16's full-sized avatar
:electron:
Focusing

zqqf16 zqqf16

:electron:
Focusing
View GitHub Profile
- (NSString *)executableUUID {
const struct mach_header *executableHeader = NULL;
for (uint32_t i = 0; i < _dyld_image_count(); i++) {
const struct mach_header *header = _dyld_get_image_header(i);
if (header->filetype == MH_EXECUTE) {
executableHeader = header;
break;
}
}
@zqqf16
zqqf16 / gist:06fa47b4b51fef1008bc
Created March 4, 2016 08:09
PAC rules for Slack
"slack.com",
"slack-imgs.com",
"slack-edge.com",
"slack-msgs.com",
"api.mixpanel.com",
"global.ssl.fastly.net",
"amazonaws.com",
@zqqf16
zqqf16 / ks2apple.py
Last active February 23, 2016 06:01
Convert KSCrash log to Apple format
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import json
import os
from datetime import datetime
from dateutil import parser, tz
def dump_json(obj):
return json.dumps(obj, indent=4,
@zqqf16
zqqf16 / IKEv2.mobileconfig
Last active June 25, 2024 08:14
strongSwan IKEv2 configurations for iOS without certificate
<?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>PayloadContent</key>
<array>
<dict>
<key>IKEv2</key>
<dict>
<key>AuthName</key>
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
from datetime import datetime
FILE_NAME = 'messages.json'
class DataBase(object):
#!/bin/sh
PLIST_BUDDY=/usr/libexec/PlistBuddy
function add_compatibility() {
"$PLIST_BUDDY" -c "Add DVTPlugInCompatibilityUUIDs:10 string $2" \
"$1/Contents/Info.plist"
}
function has_compatibility() {
@zqqf16
zqqf16 / jijin.py
Last active August 29, 2015 14:08
抓取基金收益信息
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import requests
import unicodedata
import re
from datetime import datetime
@zqqf16
zqqf16 / IPSecDemo.m
Last active May 29, 2020 08:11
Start IPSec programmatically in iOS 8
- (void)viewDidLoad
{
[super viewDidLoad];
// init VPN manager
self.vpnManager = [NEVPNManager sharedManager];
// load config from perference
[_vpnManager loadFromPreferencesWithCompletionHandler:^(NSError *error) {
@zqqf16
zqqf16 / gen_manifest.py
Created March 16, 2014 13:53
根据ipa包来生成Manifest的工具
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import sys
import shutil
import zipfile
import biplist
PLIST_STR = '''<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@zqqf16
zqqf16 / get_scheme.sh
Last active November 5, 2018 10:35
Get the URL scheme from ipa file
#!/bin/bash
ipa_name=$1
plist_path=$(unzip -l "$ipa_name" | grep "Payload/[^/]*\/Info.plist" | sed 's/.*\(Payload.*Info.plist\)/\1/g')
#unzip
unzip -jo "$ipa_name" "$plist_path" >/dev/null
#convert to xml1 format
plutil -convert xml1 Info.plist