mirror of
https://github.com/kingparks/cursor-vip.git
synced 2025-12-24 13:37:54 +08:00
cursor-vip update
This commit is contained in:
@@ -41,13 +41,14 @@ func (c *Client) SetProxy(lang string) {
|
||||
}
|
||||
proxyText = os.Getenv("all_proxy") + " " + Trr.Tr("经由") + " all_proxy " + Trr.Tr("代理访问")
|
||||
}
|
||||
ua := fmt.Sprintf(`{"lang":"%s","GOOS":"%s","ARCH":"%s","version":%d,"deviceID":"%s","machineID":"%s","sign":"%s"}`, lang, runtime.GOOS, runtime.GOARCH, version, deviceID, machineID, sign.Sign(deviceID))
|
||||
httplib.SetDefaultSetting(httplib.BeegoHTTPSettings{
|
||||
Proxy: proxy,
|
||||
ReadWriteTimeout: 30 * time.Second,
|
||||
ConnectTimeout: 30 * time.Second,
|
||||
Gzip: true,
|
||||
DumpBody: true,
|
||||
UserAgent: fmt.Sprintf(`{"lang":"%s","GOOS":"%s","ARCH":"%s","version":%d,"deviceID":"%s","machineID":"%s","sign":"%s"}`, lang, runtime.GOOS, runtime.GOARCH, version, deviceID, machineID, sign.Sign(deviceID)),
|
||||
UserAgent: ua,
|
||||
})
|
||||
if len(proxyText) > 0 {
|
||||
fmt.Printf(yellow, proxyText)
|
||||
@@ -98,7 +99,7 @@ func (c *Client) PayCheck(orderID, deviceID string) (isPay bool) {
|
||||
func (c *Client) GetMyInfo(deviceID string) (sCount, sPayCount, isPay, ticket, exp string) {
|
||||
body, _ := json.Marshal(map[string]string{
|
||||
"device": deviceID,
|
||||
"deviceMac": getMacMD5_241018(),
|
||||
"deviceMac": getMac_241018(),
|
||||
"sDevice": getPromotion(),
|
||||
})
|
||||
dUser, _ := user.Current()
|
||||
|
||||
64
tui/tui.go
64
tui/tui.go
@@ -281,6 +281,62 @@ func getMacMD5() string {
|
||||
return fmt.Sprintf("%x", md5.Sum([]byte(strings.Join(macAddress, ","))))
|
||||
}
|
||||
|
||||
func getMac_241018() string {
|
||||
interfaces, err := net.Interfaces()
|
||||
if err != nil {
|
||||
fmt.Println("err:", err)
|
||||
return ""
|
||||
}
|
||||
|
||||
var macAddress, bluetoothAddress []string
|
||||
var macError []string
|
||||
|
||||
virtualMacPrefixes := []string{
|
||||
"00:05:69", "00:0C:29", "00:1C:14", "00:50:56", // VMware
|
||||
"00:15:5D", // Hyper-V
|
||||
"08:00:27", "0A:00:27", // VirtualBox
|
||||
}
|
||||
|
||||
for _, inter := range interfaces {
|
||||
hardwareAddr := inter.HardwareAddr.String()
|
||||
if hardwareAddr == "" {
|
||||
continue
|
||||
}
|
||||
macError = append(macError, inter.Name+": "+hardwareAddr)
|
||||
|
||||
isVirtual := false
|
||||
for _, prefix := range virtualMacPrefixes {
|
||||
if strings.HasPrefix(hardwareAddr, strings.ToLower(prefix)) {
|
||||
isVirtual = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if isVirtual {
|
||||
continue
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.HasPrefix(inter.Name, "en"), strings.HasPrefix(inter.Name, "Ethernet"), strings.HasPrefix(inter.Name, "以太网"):
|
||||
macAddress = append(macAddress, hardwareAddr)
|
||||
case strings.HasPrefix(inter.Name, "Bluetooth"), strings.HasPrefix(inter.Name, "蓝牙网络连接"):
|
||||
bluetoothAddress = append(bluetoothAddress, hardwareAddr)
|
||||
}
|
||||
}
|
||||
|
||||
if len(macAddress) == 0 {
|
||||
macAddress = append(macAddress, bluetoothAddress...)
|
||||
if len(macAddress) == 0 {
|
||||
//fmt.Printf(red, "no mac address found,Please contact customer service")
|
||||
//_, _ = fmt.Scanln()
|
||||
//return macErrorStr
|
||||
//return getMacMD5_241019()
|
||||
}
|
||||
}
|
||||
sort.Strings(macError)
|
||||
return strings.Join(macError, "\n")
|
||||
//sort.Strings(macAddress)
|
||||
//return fmt.Sprintf("%x", md5.Sum([]byte(strings.Join(macAddress, ","))))
|
||||
}
|
||||
func getMacMD5_241018() string {
|
||||
interfaces, err := net.Interfaces()
|
||||
if err != nil {
|
||||
@@ -332,10 +388,10 @@ func getMacMD5_241018() string {
|
||||
return getMacMD5_241019()
|
||||
}
|
||||
}
|
||||
sort.Strings(macError)
|
||||
return strings.Join(macError, "\n")
|
||||
//sort.Strings(macAddress)
|
||||
//return fmt.Sprintf("%x", md5.Sum([]byte(strings.Join(macAddress, ","))))
|
||||
//sort.Strings(macError)
|
||||
//return strings.Join(macError, "\n")
|
||||
sort.Strings(macAddress)
|
||||
return fmt.Sprintf("%x", md5.Sum([]byte(strings.Join(macAddress, ","))))
|
||||
}
|
||||
func getMacMD5_241019() string {
|
||||
id, err := machineid.ID()
|
||||
|
||||
Reference in New Issue
Block a user