|
|
@@ -135,6 +135,24 @@ class GT_Nox_Command{ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
openNox_one(titleName){ |
|
|
|
return new Promise( (resolve, reject) => { |
|
|
|
if(this.titleToNoxIdTable[titleName] === undefined){ |
|
|
|
resolve({ |
|
|
|
err: "noTitle" |
|
|
|
}); |
|
|
|
} |
|
|
|
this.nox_command(titleName); |
|
|
|
GT_Nox_Command.checkOpen(titleName,function(){ |
|
|
|
console.log("YOOOOOOOOOO"); |
|
|
|
resolve({ |
|
|
|
err: undefined, |
|
|
|
data: "ok" |
|
|
|
}); |
|
|
|
}.bind(this)); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
colse_process(closeTitle){ |
|
|
|
if(this.titleToNoxIdTable[closeTitle] === undefined){ |
|
|
@@ -211,12 +229,12 @@ class GT_Nox_Command{ |
|
|
|
* 執行某個App,預設開托蘭 |
|
|
|
* @param {string} appId app的唯一Id |
|
|
|
*/ |
|
|
|
run_app(appId){ |
|
|
|
run_app(title,appId){ |
|
|
|
if(appId === undefined){ |
|
|
|
appId = "com.asobimo.toramonline"; |
|
|
|
} |
|
|
|
|
|
|
|
this.nox_command({package:appId}); |
|
|
|
this.nox_command(title,{package:appId}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -247,7 +265,10 @@ class adb_ctrl{ |
|
|
|
} |
|
|
|
|
|
|
|
openNox(titleArr,cb){ |
|
|
|
this.nox_cmd.openNox.call(this.nox_cmd,titleArr,cb); |
|
|
|
return new Promise( async function(resolve, reject){ |
|
|
|
let status = await this.nox_cmd.openNox_one.call(this.nox_cmd,titleArr); |
|
|
|
resolve(status); |
|
|
|
}.bind(this)); |
|
|
|
} |
|
|
|
|
|
|
|
closeNox(titleArr,cb){ |
|
|
@@ -356,6 +377,7 @@ class adb_ctrl{ |
|
|
|
} |
|
|
|
// console.log(this.nox_table); |
|
|
|
// console.log(this.port_table); |
|
|
|
// console.log(this.title_to_device_table); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -402,6 +424,16 @@ class adb_ctrl{ |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 連結目前所有已開的夜神模擬器 |
|
|
|
*/ |
|
|
|
// async connect_one(titleName){ |
|
|
|
// return new Promise( async function(resolve, reject){ |
|
|
|
// let status = await this.exec_adb( ["connect","127.0.0.1:" + this.title_to_device_table[titleName]] ); |
|
|
|
// resolve(status); |
|
|
|
// }.bind(this)); |
|
|
|
// } |
|
|
|
|
|
|
|
/** |
|
|
|
* 連結目前所有已開的夜神模擬器 |
|
|
|
*/ |
|
|
@@ -462,13 +494,17 @@ class adb_ctrl{ |
|
|
|
// this.nox_cmd.run_app("com.zhuowang.cloneapp:platform.gameplugin.P00"); |
|
|
|
// this.nox_cmd.run_app(); |
|
|
|
} |
|
|
|
|
|
|
|
async open_toram(titleName){ |
|
|
|
this.nox_cmd.run_app(titleName); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
module.exports = adb_ctrl; |
|
|
|
|
|
|
|
// let aa = new adb_ctrl({ |
|
|
|
// nox_path: "F:/Nox", |
|
|
|
// open_count: 1, |
|
|
|
// // nox_path: "F:/Nox", |
|
|
|
// // open_count: 1, |
|
|
|
// }); |
|
|
|
|
|
|
|
// let atkArr = []; |
|
|
@@ -477,11 +513,16 @@ module.exports = adb_ctrl; |
|
|
|
// } |
|
|
|
|
|
|
|
// async function yee(gtadb){ |
|
|
|
// // await gtadb.adb_init.call(gtadb); |
|
|
|
// await gtadb.connect(); |
|
|
|
|
|
|
|
// await gtadb.close_toram("atk01"); |
|
|
|
// await gtadb.close_toram("atk02"); |
|
|
|
// let status = await gtadb.openNox("yee"); |
|
|
|
// console.log("幹"); |
|
|
|
// console.log(status); |
|
|
|
// // await gtadb.adb_init(); |
|
|
|
// // let status = await gtadb.connect_one("yee"); |
|
|
|
|
|
|
|
// // status = await gtadb.connect_one("yee"); |
|
|
|
// // console.log(status); |
|
|
|
// // await gtadb.open_toram("yee"); |
|
|
|
// // await gtadb.disconnect(); |
|
|
|
// } |
|
|
|
|
|
|
|
// yee(aa); |