Skip to content

Instantly share code, notes, and snippets.

View DargonLee's full-sized avatar
🎯
Focusing

Harlans DargonLee

🎯
Focusing
View GitHub Profile
NSString* getLocalIP() { // 获取wifi ipv4
NSString* result = nil;
struct ifaddrs* interfaces = 0;
struct ifaddrs* temp_addr = 0;
if (0 == getifaddrs(&interfaces)) {
temp_addr = interfaces;
while(temp_addr != NULL) {
if(temp_addr->ifa_addr->sa_family == AF_INET) {
if(!strcmp(temp_addr->ifa_name, "en0")) {
char* ip = inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr);
import threading
import frida
import codecs
import os
from esign.exec_tool import Logger
# 根目录
root_dir = os.path.dirname(os.path.realpath(__file__))
# js脚本目录
script_dir = os.path.join(root_dir, "js/")
static const char kNameKey;
@implementation Person (Test)
- (void)setName:(NSString *)name
{
objc_setAssociatedObject(self, &kNameKey, name, OBJC_ASSOCIATION_COPY_NONATOMIC);
}
- (void)getName
# 定义ANSI转义码颜色常量
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
CYAN='\033[0;36m'
NC='\033[0m' # 恢复默认颜色
# 显示带颜色的文本菜单选项
echo "${GREEN}请选择以下选项:${NC}"
name: build-mac-actions
on: [push]
run-name: ${{ github.actor }} is package mac app actions
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
name: Flutter_iOS
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build_ios:
func rtfDataToHtmlData(data: Data) -> Data? {
let attributedString = NSAttributedString(rtf: data, documentAttributes: nil)!
do {
let htmlData = try attributedString.data(from: NSRange(location: 0, length: attributedString.length), documentAttributes: [NSAttributedString.DocumentAttributeKey.documentType:NSAttributedString.DocumentType.html])
return htmlData
} catch {
}
return nil
}
- (void)addVolumeObserver
{
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *error = nil;
[audioSession setActive:YES error:&error];
if (error) {
NSLog(@"%@", error);
}
[audioSession addObserver:self forKeyPath:@"outputVolume" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:NULL];
if [ "${ACTION}" = "build" ]
then
INSTALL_DIR=${SRCROOT}/Products/${PROJECT_NAME}.framework
DEVICE_DIR=${BUILD_ROOT}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework
SIMULATOR_DIR=${BUILD_ROOT}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
g_build_sdp = "YES"
with open("config.json", "r+") as jsonFile:
data = json.load(jsonFile)
if g_build_sdp == "YES":
data["file-plugin"][1]["force"] = "true"
jsonFile.seek(0) # rewind