Skip to content

Commit

Permalink
Better way to recognize app id
Browse files Browse the repository at this point in the history
  • Loading branch information
dwaan committed Sep 12, 2020
1 parent 8653321 commit c38e532
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ module.exports = (homebridge) => {

class ADBPlugin {
constructor(log, config, api) {
if (!config) {
return;
}
if (!config) {
return;
}

this.log = log;
this.config = config;
Expand Down Expand Up @@ -465,12 +465,13 @@ class ADBPlugin {
stdout[0] = stdout[0].split(" ");
stdout[0] = stdout[0][4];

if (stdout[1].includes("Launcher") || stdout[1].includes("MainActivity") || stdout[1].includes("RecentsTvActivity")) stdout = this.inputs[0].id;
if (stdout[1].includes("Launcher") || stdout[1].substr(0, 13) == ".MainActivity" || stdout[1].includes("RecentsTvActivity")) stdout = this.inputs[0].id;
else stdout = stdout[0];
} else {
stdout = OTHER_APP_ID;
}


if (!err && this.inputs[this.currentAppIndex].id != stdout) {
this.inputs.forEach((input, i) => {
// Home or registered app
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-adb",
"version": "1.0.4",
"version": "1.0.5",
"description": "A simple homebridge plugin to control ADB enabled Android devices",
"main": "index.js",
"engines": {
Expand Down

0 comments on commit c38e532

Please sign in to comment.