Skip to content

Commit

Permalink
Changed from toLocaleString() to toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicioslc committed Dec 16, 2019
1 parent b93c9e3 commit 2fc4255
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/adb-manager/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class DeviceHelpers {
): string {
return ConsoleInstance.execConsoleSync(
adbCommands.GET_DEVICE_MODEL(ipAddress)
).toLocaleString()
).toString()
}

static getDeviceModel(
Expand All @@ -45,6 +45,6 @@ export class DeviceHelpers {
): string {
return ConsoleInstance.execConsoleSync(
adbCommands.GET_DEVICE_MODEL(deviceIP)
).toLocaleString()
).toString()
}
}
13 changes: 7 additions & 6 deletions src/adb-manager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ADBChannel extends ConsoleChannel {
const result = this.consoleInstance.execConsoleSync(
adbCommands.CONNECT_IP_AND_PORT(deviceIP)
)
const output = result.toLocaleString()
const output = result.toString()
const deviceName = DeviceHelpers.getDeviceModel(
this.consoleInstance,
deviceIP
Expand Down Expand Up @@ -56,22 +56,23 @@ export class ADBChannel extends ConsoleChannel {
return finalResult
}
async ResetPorts(): Promise<ADBResult> {
var finalResult = new ADBResult(
let finalResult = new ADBResult(
ADBResultState.Error,
'Error while reset TCP IP Ports'
)
try {
const result = this.consoleInstance.execConsoleSync(
adbCommands.RESET_PORTS()
)
const output = result.toLocaleString()
const output = result.toString()
if (output.includes(adbReturns.RESTARTING_PORT())) {
finalResult = new ADBResult(
ADBResultState.DevicesInPortMode,
adbMessages.DEVICES_IN_TCP_MODE()
)
}
} catch (e) {
console.log()
if (e.message.includes(adbReturns.NO_DEVICES_FOUND())) {
finalResult = new ADBResult(
ADBResultState.NoDevices,
Expand All @@ -93,7 +94,7 @@ export class ADBChannel extends ConsoleChannel {
const result = this.consoleInstance.execConsoleSync(
adbCommands.ADB_DISCONNECT_ALL()
)
const output = result.toLocaleString()
const output = result.toString()
if (output.includes(adbReturns.DISCONNECTED_EVERTHING())) {
finalResult = new ADBResult(
ADBResultState.DisconnectedEverthing,
Expand All @@ -111,7 +112,7 @@ export class ADBChannel extends ConsoleChannel {
const result = this.consoleInstance.execConsoleSync(
adbCommands.LIST_ADB_DEVICES()
)
const output = result.toLocaleString()
const output = result.toString()
if (output.includes(adbReturns.LISTING_DEVICES())) {
let ips = output.split(/[\r]|[\n]/gim)
ips = ips.filter(ip => IPHelpers.isAnIPAddress(ip))
Expand Down Expand Up @@ -140,7 +141,7 @@ export class ADBChannel extends ConsoleChannel {
const result = this.consoleInstance.execConsoleSync(
adbCommands.ADB_KILL_SERVER()
)
if (result.toLocaleString() == adbReturns.ADB_KILLED_SUCCESS_RETURN()) {
if (result.toString() == adbReturns.ADB_KILLED_SUCCESS_RETURN()) {
returned = new ADBResult(ADBResultState.Success, 'ADB Server killed')
} else {
throw Error('Internal error ocurred')
Expand Down
4 changes: 2 additions & 2 deletions src/firebase-actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class FirebaseManagerChannel extends ConsoleChannel {
.execConsoleSync(
firebaseCommands.SHELL_SETPROP_FIREBASE_ANALYTICS(appPackageID)
)
.toLocaleString()
.toString()
if (output == '') {
finalResult = new ADBResult(
ADBResultState.Success,
Expand All @@ -25,7 +25,7 @@ export class FirebaseManagerChannel extends ConsoleChannel {

const output: String = this.consoleInstance
.execConsoleSync(firebaseCommands.DISABLE_FIREBASE_ANALYTICS())
.toLocaleString()
.toString()

if (output == '') {
finalResult = new ADBResult(ADBResultState.Success, `Disabled debug mode`)
Expand Down

0 comments on commit 2fc4255

Please sign in to comment.