Thanks to visit codestin.com
Credit goes to github.com

Skip to content

This is an operating system independent implementation of iOS device features. You can run UI tests, launch or kill apps, install apps etc. with it.

License

Notifications You must be signed in to change notification settings

envoidshield/go-ios

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

437 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Based on the code analysis, here are all the functions needed for pairing and their explanations:

Functions Required for Device Pairing

1. Core Pairing Functions

tunnel.PairAndGetHostKey(addr, device, pm)

  • Purpose: Performs the actual secure pairing with the device
  • Returns: Host key for authentication
  • Location: ios/tunnel/tunnel.go:49-79

tunnel.NewPairRecordManager(recordsPath)

  • Purpose: Creates a manager to handle device pair records (certificates/keys)
  • Returns: Pair record manager instance
  • Location: ios/tunnel/ (referenced in main.go:78)

ios.GetDevice(udid)

  • Purpose: Retrieves device information by UDID
  • Returns: Device entry with properties
  • Location: ios/ package

2. Device Connection Functions

ios.ConnectLockdownWithSession(device)

  • Purpose: Establishes secure lockdown connection to device
  • Returns: Lockdown connection for device communication
  • Location: ios/ package

lockdown.SetValueForDomain(domain, key, value)

  • Purpose: Sets device configuration (enables WiFi connections)
  • Parameters: Domain, key, and value to set
  • Location: ios/lockdown_value.go

tunnel.TunnelInfoForDevice(udid, host, port)

  • Purpose: Gets tunnel information for a specific device
  • Returns: Tunnel info with port and configuration
  • Location: ios/tunnel/

3. RSD (Remote Service Discovery) Functions

ios.NewWithAddrPortDevice(address, port, device)

  • Purpose: Creates RSD service connection to device
  • Returns: RSD service instance
  • Location: ios/rsd.go

rsdService.Handshake()

  • Purpose: Performs handshake with device's RSD service
  • Returns: RSD handshake response with service ports
  • Location: ios/rsd.go

ios.GetDeviceWithAddress(udid, address, rsdProvider)

  • Purpose: Gets device with RSD provider information
  • Returns: Enhanced device entry with RSD data
  • Location: ios/ package

4. Key Management Functions

plist.Unmarshal(content, &deviceInfo)

  • Purpose: Parses device plist file to extract keys
  • Returns: Parsed device information map
  • Location: howett.net/plist package

base64.StdEncoding.EncodeToString(keyData)

  • Purpose: Encodes binary key data to base64 string
  • Returns: Base64 encoded key string
  • Location: encoding/base64 package

5. Tunnel Management Functions

tunnel.ListRunningTunnels(host, port)

  • Purpose: Lists all currently running tunnels
  • Returns: Array of tunnel instances
  • Location: ios/tunnel/

tunnel.NewTunnelManager(pm, userspaceTUN)

  • Purpose: Creates tunnel manager for device connections
  • Returns: Tunnel manager instance
  • Location: ios/tunnel/

Short Explanation of Pairing Flow

1. DISCOVERY PHASE
   ├── List available tunnels
   ├── User selects device to pair with
   └── Get device information by UDID

2. CONNECTION PHASE
   ├── Create pair record manager
   ├── Connect to device via lockdown service
   ├── Enable WiFi connections on device
   └── Get tunnel information for device

3. RSD SETUP PHASE
   ├── Create RSD service connection
   ├── Perform RSD handshake
   └── Get device with RSD provider

4. PAIRING PHASE
   ├── Call PairAndGetHostKey() for secure pairing
   ├── Device generates selfIdentity.plist file
   └── Extract private/public keys from plist

5. KEY EXTRACTION PHASE
   ├── Read selfIdentity.plist file
   ├── Parse plist to extract keys
   ├── Encode keys to base64 format
   └── Display device information with keys

6. OPTIONAL API PHASE
   ├── Prompt user for API endpoint
   ├── Prepare JSON payload with keys
   ├── Send POST request to external API
   └── Display response from API

Key Security Elements

  • SRP Protocol: Secure Remote Password for authentication
  • ECDH Key Exchange: Elliptic Curve Diffie-Hellman for key agreement
  • TLS Encryption: Transport Layer Security for secure communication
  • Certificate-based Authentication: Uses device certificates for trust
  • Base64 Encoding: Secure key transmission format

The pairing process establishes a secure trust relationship between the host computer and the iOS device, enabling encrypted communication and device management capabilities.

About

This is an operating system independent implementation of iOS device features. You can run UI tests, launch or kill apps, install apps etc. with it.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 99.6%
  • JavaScript 0.2%
  • Makefile 0.1%
  • Objective-C 0.1%
  • Shell 0.0%
  • Dockerfile 0.0%