自己開發(fā)的App有時(shí)候想簡單的抓包分析數(shù)據(jù),在https有ssl pinning驗(yàn)證的情況下抓包有點(diǎn)麻煩
SessionManager.swift 文件找到下面這個(gè)方法
private func commonInit(serverTrustPolicyManager: ServerTrustPolicyManager?) {
///加上這句話 判斷下自己需要的條件唄
#if !targetEnvironment(simulator) && !DEBUG
session.serverTrustPolicyManager = serverTrustPolicyManager
#endif
delegate.sessionManager = self
delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in
guard let strongSelf = self else { return }
DispatchQueue.main.async { strongSelf.backgroundCompletionHandler?() }
}
}
逆向的同學(xué)也可以簡單hook這附近的方法嚷那,當(dāng)然有越獄機(jī)器的更簡單芜赌,一個(gè)插件全搞定轿秧。