Update adb.js

This commit is contained in:
Namhyeon Go 2022-03-02 03:17:42 +09:00 committed by GitHub
parent 36efb8bc07
commit 26bb5dd5e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// LDPlayer API // Android Debug Bridge API
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
var SHELL = require("lib/shell"); var SHELL = require("lib/shell");
@ -29,7 +29,11 @@ function ADBObject() {
}; };
this.getHostname = function(id) { this.getHostname = function(id) {
return SHELL.exec([this.binPath, "-s", id, "shell", "getprop", "net.hostname"]).trim(); return this.getProperty(id, "net.hostname").trim();
};
this.getProperty = function(id, name) {
return SHELL.exec([this.binPath, "-s", id, "shell", "getprop", name]);
}; };
this.disableService = function(id, name) { this.disableService = function(id, name) {