Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
matbrik committed Oct 29, 2024
1 parent f610262 commit 8e0c6c5
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lib/android.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,8 @@ function findString (string, moduleName) {
const size = range.size;
const result = Memory.scanSync(base, size, pattern);
if (result.length > 0) return result;
}).filter((element => element != null)).flat();
return null;
}).filter(element => element !== null).flat();
}

function createAdd (address, register) {
Expand All @@ -574,6 +575,7 @@ function findPatternInModule (pattern, moduleName) {
const size = range.size;
const result = Memory.scanSync(base, size, pattern);
if (result.length != 0) return result;

Check failure on line 577 in lib/android.js

View workflow job for this annotation

GitHub Actions / eslint

Expected '!==' and instead saw '!='
return null;
}).filter(element => element != null).flat();
}

Expand All @@ -587,7 +589,7 @@ function findEnsurePlugIn () {
if (disasm.mnemonic === 'b') {
return new NativePointer(disasm.operands[0].value);
}
}).filter((element => element != null)).flat();
}).filter(element => element !== null).flat();
}

function findPrologue (address) {
Expand Down Expand Up @@ -626,11 +628,13 @@ function tryGetEnvJvmti (vm, runtime) {
let ensurePluginLoaded;
if (Module.findExportByName('libart.so', '_ZN3art7Runtime18EnsurePluginLoadedEPKcPNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE') === null) {
// on some devices calling the ensurePluginLoaded make the app really slow so for is commented
if (false) {

Check failure on line 631 in lib/android.js

View workflow job for this annotation

GitHub Actions / eslint

Unexpected constant condition
const candidates = findEnsurePlugIn();

Check failure on line 632 in lib/android.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 8 spaces but found 7
ensurePluginLoaded = new NativeFunction(candidates[0],

Check failure on line 633 in lib/android.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 8 spaces but found 7
'bool',

Check failure on line 634 in lib/android.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 10 spaces but found 8
['pointer', 'pointer', 'pointer']);

Check failure on line 635 in lib/android.js

View workflow job for this annotation

GitHub Actions / eslint

Expected indentation of 10 spaces but found 8
}
return;
// const candidates = findEnsurePlugIn();
// ensurePluginLoaded = new NativeFunction(candidates[0],
// 'bool',
// ['pointer', 'pointer', 'pointer']);
} else {
ensurePluginLoaded = new NativeFunction(Module.getExportByName('libart.so', '_ZN3art7Runtime18EnsurePluginLoadedEPKcPNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE'),
'bool',
Expand Down Expand Up @@ -1961,7 +1965,8 @@ function findDoCalls () {
return findPrologue(possibleBranch);
}
}
}).filter(element => element!=null).flat();
return null;
}).filter(element => element !== null).flat();
}

function instrumentArtMethodInvocationFromInterpreter () {
Expand Down

0 comments on commit 8e0c6c5

Please sign in to comment.