前期准备
code
[%c(SpringBoard) setupwifi];//连接特定Wi-Fi
%new + (void) setupwifi{ NSArray* args = @[@"enable-wifi"]; [KNnoZombieRunobjc noZombieRun:@"/usr/bin/wifiutil" withParams:args]; NSArray* args1 = @[@"disassociate"]; [KNnoZombieRunobjc noZombieRun:@"/usr/bin/wifiutil" withParams:args1]; NSArray* args2 = @[@"associate",@"@PHICOMM_08",@"-p",@"password"]; [KNnoZombieRunobjc noZombieRun:@"/usr/bin/wifiutil" withParams:args2]; }
另外一种实现思路:tweak
- AirPortSettings
//dlopen("/System/Library/PreferenceBundles/AirPortSettings.bundle/AirPortSettings",RTLD_NOW);
See Also
/Users/devzkn/bin/knpost wifiutil 连接特定Wi-Fi -t iosre #原来""的参数,需要自己加上""