forked from SonicCloudOrg/sonic-ios-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fde5d7
commit 9b0c0f1
Showing
2 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
package entity | ||
|
||
type ( | ||
WIRArgument struct { | ||
WIRMessageDataKey map[string]interface{} `plist:"WIRMessageDataKey,omitempty"` | ||
WIRConnectionIdentifierKey *string `plist:"WIRConnectionIdentifierKey,omitempty"` | ||
WIRPageIdentifierKey *int `plist:"WIRPageIdentifierKey,omitempty"` | ||
WIRIndicateEnabledKey *bool `plist:"WIRIndicateEnabledKey,omitempty"` | ||
WIRSessionIdentifierKey *string `plist:"WIRSessionIdentifierKey,omitempty"` | ||
WIRSenderKey *string `plist:"WIRSenderKey,omitempty"` | ||
WIRAutomaticallyPause *bool `plist:"WIRAutomaticallyPause,omitempty"` | ||
WIRSocketDataKey *string `plist:"WIRSessionIdentifierKey,omitempty"` | ||
SessionCapabilitiesKey *WIRSessionCapabilitiesKey `plist:"WIRSessionCapabilitiesKey,omitempty"` | ||
// 单个appInfo情况下 | ||
WIRApplicationIdentifierKey *string `plist:"WIRApplicationIdentifierKey,omitempty"` | ||
WIRApplicationBundleIdentifierKey *string `plist:"WIRApplicationBundleIdentifierKey,omitempty"` | ||
WIRApplicationNameKey *string `plist:"WIRApplicationNameKey,omitempty"` | ||
WIRAutomationAvailabilityKey AutomationAvailabilityType `plist:"WIRAutomationAvailabilityKey,omitempty"` | ||
WIRIsApplicationActiveKey *int `plist:"WIRIsApplicationActiveKey,omitempty"` | ||
WIRIsApplicationProxyKey *bool `plist:"WIRIsApplicationProxyKey,omitempty"` | ||
WIRIsApplicationReadyKey *bool `plist:"WIRIsApplicationReadyKey,omitempty"` | ||
WIRHostApplicationIdentifierKey *string `plist:"WIRHostApplicationIdentifierKey,omitempty"` | ||
// 多个appInfo情况下 | ||
WIRApplicationDictionaryKey map[string]WIRArgument `plist:"WIRApplicationDictionaryKey,omitempty"` | ||
WIRListingKey map[string]WebInspectorPage `plist:"WIRListingKey,omitempty"` | ||
} | ||
|
||
WIRSessionCapabilitiesKey struct { | ||
AllowInsecureMediaCapture bool `plist:"org.webkit.webdriver.webrtc.allow-insecure-media-capture"` | ||
SppressIceCandidateFiltering bool `plist:"org.webkit.webdriver.webrtc.suppress-ice-candidate-filtering"` | ||
} | ||
|
||
WIRMessageStruct struct { | ||
Argument WIRArgument `plist:"__argument"` | ||
Selector WebInspectorSelectorEnum `plist:"__selector"` | ||
} | ||
) | ||
|
||
type WebInspectorSelectorEnum string | ||
|
||
const ( | ||
// 发送消息类型 | ||
SEND_REPORT_ID WebInspectorSelectorEnum = "_rpc_reportIdentifier:" | ||
SEND_GET_CONNECT_APP WebInspectorSelectorEnum = "_rpc_getConnectedApplications:" | ||
SEND_FORWARD_GET_LISTING WebInspectorSelectorEnum = "_rpc_forwardGetListing:" | ||
SEND_FORWARD_SOCKET_SETUP WebInspectorSelectorEnum = "_rpc_forwardSocketSetup:" | ||
SEND_FORWARD_SOCKET_DATA WebInspectorSelectorEnum = "_rpc_forwardSocketData:" | ||
SEND_FORWARD_INDICATE_WEBVIEW WebInspectorSelectorEnum = "_rpc_forwardIndicateWebView:" | ||
SEND_FORWARD_DID_CLOSE WebInspectorSelectorEnum = "_rpc_forwardDidClose:" | ||
|
||
REQUEST_APPLICATION_LAUNCH WebInspectorSelectorEnum = "_rpc_requestApplicationLaunch" | ||
|
||
// 接收消息类型 | ||
ON_REPORT_CURRENT_STATE WebInspectorSelectorEnum = "_rpc_reportCurrentState:" | ||
ON_REPORT_SETUP WebInspectorSelectorEnum = "_rpc_reportSetup:" | ||
ON_REPORT_DRIVER_LIST WebInspectorSelectorEnum = "_rpc_reportConnectedDriverList:" | ||
ON_REPORT_CONNECTED_APP_LIST WebInspectorSelectorEnum = "_rpc_reportConnectedApplicationList:" | ||
ON_APP_CONNECTED WebInspectorSelectorEnum = "_rpc_applicationConnected:" | ||
ON_APP_UPDATED WebInspectorSelectorEnum = "_rpc_applicationUpdated:" | ||
ON_APP_SENT_LISTING WebInspectorSelectorEnum = "_rpc_applicationSentListing:" | ||
ON_APP_SENT_DATA WebInspectorSelectorEnum = "_rpc_applicationSentData:" | ||
ON_APP_DISCONNECTED WebInspectorSelectorEnum = "_rpc_applicationDisconnected:" | ||
) | ||
|
||
type ( | ||
WebInspectorPage struct { | ||
PageID *int `plist:"WIRPageIdentifierKey,omitempty"` | ||
PageType WebInspectorPageType `plist:"WIRTypeKey,omitempty"` | ||
PageWebUrl *string `plist:"WIRURLKey,omitempty"` | ||
PageWebTitle *string `plist:"WIRTitleKey,omitempty"` | ||
PageAutoationIsPairedKey *bool `plist:"WIRAutomationTargetIsPairedKey,omitempty"` | ||
PageAutomationName *string `plist:"WIRAutomationTargetNameKey,omitempty"` | ||
PageAutomationVersion *string `plist:"WIRAutomationTargetVersionKey,omitempty"` | ||
PageAutomationSessionID *string `plist:"WIRSessionIdentifierKey,omitempty"` | ||
PageAutomationConnectionID *string `plist:"WIRConnectionIdentifierKey,omitempty"` | ||
} | ||
|
||
WebInspectorApplication struct { | ||
ApplicationID *string `plist:"WIRApplicationIdentifierKey,omitempty"` | ||
ApplicationBundle *string `plist:"WIRApplicationBundleIdentifierKey,omitempty"` | ||
ApplicationPID *int | ||
ApplicationName *string `plist:"WIRApplicationNameKey,omitempty"` | ||
ApplicationAvailability AutomationAvailabilityType `plist:"WIRAutomationAvailabilityKey,omitempty"` | ||
ApplicationActive *int `plist:"WIRIsApplicationActiveKey,omitempty"` | ||
ApplicationProxy *bool `plist:"WIRIsApplicationProxyKey,omitempty"` | ||
ApplicationReady *bool `plist:"WIRIsApplicationReadyKey,omitempty"` | ||
ApplicationHost *string `plist:"WIRHostApplicationIdentifierKey,omitempty"` | ||
} | ||
) | ||
|
||
type WebInspectorPageType string | ||
type AutomationAvailabilityType string | ||
|
||
const ( | ||
AUTOMATION WebInspectorPageType = "WIRTypeAutomation" | ||
ITML WebInspectorPageType = "WIRTypeITML" | ||
JAVASCRIPT WebInspectorPageType = "WIRTypeJavaScript" | ||
PAGE WebInspectorPageType = "WIRTypePage" | ||
SERVICE_WORKER WebInspectorPageType = "WIRTypeServiceWorker" | ||
WEB WebInspectorPageType = "WIRTypeWeb" | ||
WEB_PAGE WebInspectorPageType = "WIRTypeWebPage" | ||
AUTOMATICALLY_PAUSE WebInspectorPageType = "WIRAutomaticallyPause" | ||
|
||
NOT_AVAILABLE AutomationAvailabilityType = "WIRAutomationAvailabilityNotAvailable" | ||
AVAILABLE AutomationAvailabilityType = "WIRAutomationAvailabilityAvailable" | ||
AvailabilityUNKNOWN AutomationAvailabilityType = "WIRAutomationAvailabilityUnknown" | ||
) |