java field / method name collision

This commit is contained in:
iddoeldor 2018-10-12 20:50:06 +03:00 committed by GitHub
parent 8beb912320
commit 5b73422ac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -500,10 +500,8 @@ Java.use("android.app.Activity").onCreate.overload('android.os.Bundle').implemen
#### TODOs
- (Java) Get field with which has name as a method ? underscore. [source](https://github.com/frida/frida-java/blob/master/lib/class-factory.js)
- (Java) Get field with which has name as a method ? underscore. [source](https://github.com/frida/frida-java/blob/master/lib/class-factory.js) [PR](https://github.com/frida/frida-java/pull/21)
```js
const fields = invokeObjectMethodNoArgs(env.handle, classHandle, env.javaLangClass().getDeclaredFields);
...
let fieldJsName = env.stringFromJni(fieldName);
while (jsMethods.hasOwnProperty(fieldJsName)) {
fieldJsName = '_' + fieldJsName;