forked from NetrisTV/ws-scrcpy
-
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
Showing
8 changed files
with
1,128 additions
and
70 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,12 @@ | ||
export default interface DescriptorFields { | ||
"build.version.release": string; | ||
"build.version.sdk": string; | ||
"ro.product.cpu.abi": string; | ||
"product.manufacturer": string; | ||
"product.model": string; | ||
"wifi.interface": string; | ||
udid: string; | ||
state: string; | ||
ip: string; | ||
pid: number; | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import { Device } from './Device'; | ||
import { LogcatClientMessage, LogcatServiceMessage } from 'adbkit/LogcatMessage'; | ||
import { XtermClientMessage } from './XtermMessage'; | ||
import DescriptorFields from "./DescriptorFields"; | ||
|
||
export enum MessageTypes { | ||
'devicelist', | ||
'logcat', | ||
'shell', | ||
} | ||
|
||
export interface Message { | ||
id: number; | ||
type: keyof typeof MessageTypes; | ||
data: Device[] | LogcatServiceMessage | LogcatClientMessage | XtermClientMessage; | ||
data: DescriptorFields[] | XtermClientMessage; | ||
} |
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,56 @@ | ||
import DescriptorFields from "../common/DescriptorFields"; | ||
|
||
export class DeviceDescriptor { | ||
public releaseVersion: string; | ||
public sdkVersion: string; | ||
public cpuAbi: string; | ||
public productManufacturer: string; | ||
public productModel: string; | ||
public wifiInterface: string; | ||
public udid: string; | ||
public state: string; | ||
public ip: string; | ||
public pid: number; | ||
|
||
constructor(fields: DescriptorFields) { | ||
this.releaseVersion = fields["build.version.release"]; | ||
this.sdkVersion = fields["build.version.sdk"]; | ||
this.cpuAbi = fields["ro.product.cpu.abi"]; | ||
this.productManufacturer = fields["product.manufacturer"]; | ||
this.productModel = fields["product.model"]; | ||
this.wifiInterface = fields["wifi.interface"]; | ||
this.udid = fields["udid"]; | ||
this.state = fields["state"]; | ||
this.ip = fields["ip"]; | ||
this.pid = fields["pid"]; | ||
} | ||
|
||
public toJSON(): DescriptorFields { | ||
return { | ||
"build.version.release": this.releaseVersion, | ||
"build.version.sdk": this.sdkVersion, | ||
"ro.product.cpu.abi": this.cpuAbi, | ||
"product.manufacturer": this.productManufacturer, | ||
"product.model": this.productModel, | ||
"wifi.interface": this.wifiInterface, | ||
udid: this.udid, | ||
state: this.state, | ||
ip: this.ip, | ||
pid: this.pid | ||
} | ||
} | ||
|
||
public equals(fields: DescriptorFields) { | ||
return !( | ||
this.udid !== fields["udid"] || | ||
this.state !== fields["state"] || | ||
this.ip !== fields["ip"] || | ||
this.pid !== fields.pid || | ||
this.releaseVersion !== fields["build.version.release"] || | ||
this.sdkVersion !== fields["build.version.sdk"] || | ||
this.cpuAbi !== fields["ro.product.cpu.abi"] || | ||
this.productManufacturer !== fields["product.manufacturer"] || | ||
this.productModel !== fields["product.model"] || | ||
this.wifiInterface !== fields["wifi.interface"]); | ||
} | ||
} |
Oops, something went wrong.