mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-12 00:45:14 +00:00
Update adb.js
This commit is contained in:
parent
9ac5d5003f
commit
86f8dcfb7c
16
lib/adb.js
16
lib/adb.js
|
@ -36,15 +36,23 @@ function ADBObject() {
|
|||
};
|
||||
|
||||
this.getProperty = function(id, name) {
|
||||
return SHELL.exec([this.binPath, "-s", id, "shell", "getprop", name]);
|
||||
return this.sendShell(id, ["getprop", name]);
|
||||
};
|
||||
|
||||
this.disableService = function(id, name) {
|
||||
return SHELL.exec([this.binPath, "-s", id, "shell", "svc", name, "disable"]);
|
||||
return this.sendShell(id, ["svc", name, "disable"]);
|
||||
};
|
||||
|
||||
this.enableService = function(id, name) {
|
||||
return SHELL.exec([this.binPath, "-s", id, "shell", "svc", name, "enable"]);
|
||||
return this.sendShell(id, ["svc", name, "enable"]);
|
||||
};
|
||||
|
||||
this.sendShell = function(id, args) {
|
||||
try {
|
||||
return SHELL.exec([this.binPath, "-s", id, "shell"].concat(args));
|
||||
} catch (e) {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -52,6 +60,6 @@ exports.create = function() {
|
|||
return new ADBObject();
|
||||
};
|
||||
|
||||
exports.VERSIONINFO = "Android Debug Bridge Interface (adb.js) version 0.1";
|
||||
exports.VERSIONINFO = "Android Debug Bridge Interface (adb.js) version 0.2";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user