Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Focusing

上山打老虎 zqqf16

:shipit:
Focusing
View GitHub Profile
View get_uuid.m
- (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;
}
}
View gist:06fa47b4b51fef1008bc
"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 Feb 23, 2016
Convert KSCrash log to Apple format
View ks2apple.py
#!/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 Aug 30, 2021
strongSwan IKEv2 configurations for iOS without certificate
View IKEv2.mobileconfig
<?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>
View json_orm.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
from datetime import datetime
FILE_NAME = 'messages.json'
class DataBase(object):
View update_xcode_plugins
#!/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 Aug 29, 2015
抓取基金收益信息
View jijin.py
#!/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
Start IPSec programmatically in iOS 8
View IPSecDemo.m
- (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 Mar 16, 2014
根据ipa包来生成Manifest的工具
View gen_manifest.py
#!/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 Nov 5, 2018
Get the URL scheme from ipa file
View get_scheme.sh
#!/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