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,14 +500,12 @@ Java.use("android.app.Activity").onCreate.overload('android.os.Bundle').implemen
#### TODOs #### 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 ```js
const fields = invokeObjectMethodNoArgs(env.handle, classHandle, env.javaLangClass().getDeclaredFields); let fieldJsName = env.stringFromJni(fieldName);
... while (jsMethods.hasOwnProperty(fieldJsName)) {
let fieldJsName = env.stringFromJni(fieldName); fieldJsName = '_' + fieldJsName;
while (jsMethods.hasOwnProperty(fieldJsName)) { }
fieldJsName = '_' + fieldJsName;
}
``` ```
- Add GIFs & docs - Add GIFs & docs