mirror of
https://github.com/xweiba/location-spoofer.git
synced 2026-09-21 22:30:46 +08:00
fix: 优化启动引导、坐标处理和日志管理
This commit is contained in:
@@ -41,6 +41,18 @@ func wloccore_generateca() (r0, r1 *C.char) {
|
||||
return C.CString(string(cert)), C.CString(string(key))
|
||||
}
|
||||
|
||||
//export wloccore_validateca
|
||||
func wloccore_validateca(certData, keyData *C.char) C.int {
|
||||
if certData == nil || keyData == nil {
|
||||
return 0
|
||||
}
|
||||
if _, err := parseCA([]byte(C.GoString(certData)), []byte(C.GoString(keyData))); err != nil {
|
||||
logEvent("validateca failed: " + err.Error())
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
}
|
||||
|
||||
//export wloccore_startproxy
|
||||
func wloccore_startproxy(certData, keyData *C.char, lat, lon C.double, enabled C.int, accuracy C.int) C.uintptr_t {
|
||||
if certData == nil || keyData == nil {
|
||||
|
||||
+3
-1
@@ -145,7 +145,9 @@ func newProxy(cert *tls.Certificate) *goproxy.ProxyHttpServer {
|
||||
logEvent("CONNECT " + host + " -> MITM (verify)")
|
||||
return mitmAction, host
|
||||
}
|
||||
logEvent("CONNECT " + host + " -> passthrough")
|
||||
// Global Wi-Fi proxy mode sends all HTTPS CONNECT traffic here. Logging
|
||||
// unrelated passthrough hosts creates high-volume noise and can disclose
|
||||
// browsing destinations; diagnostics only retain WLOC and verify traffic.
|
||||
return goproxy.OkConnect, host
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user