Switch_to_typescript#1
Conversation
|
|
||
| function serialize_parcelable(obj) | ||
| { | ||
| function serialize_parcelable(obj: Java.Wrapper) { |
There was a problem hiding this comment.
don't we know the ret-type of this func? (convertible to Uint8Array? convert it and return a known typescrict value)
| clone_clonable, | ||
| clone_serializable, | ||
| clone_parcelable, | ||
| serialize_parcelable, |
There was a problem hiding this comment.
i'd like this repo to be splitted to subpackages/namespaces (idk how simple will it be to do so), such that we have JavaUtils namespace, and it has a ParcelableUtils module and CloneUtils (and the CloneUtils' funcs that clones parcelables will use ParcelableUtils' funcs)
| @@ -1,10 +1,8 @@ | |||
| function clone_clonable(obj) | |||
| { | |||
| function clone_clonable(obj: Java.Wrapper) { | |||
There was a problem hiding this comment.
i'd like it to be clear that the retval is same-typed as the param
| @@ -1,28 +1,24 @@ | |||
| function file_write_string(file_path, content) | |||
| { | |||
| function file_write_string(file_path: string, content: string | ArrayBuffer | number[]) { | |||
There was a problem hiding this comment.
it really works with such params? cool!
|
|
||
| function file_read_bytes(file_path) | ||
| { | ||
| function file_read_bytes(file_path: string) { |
| @@ -0,0 +1,39 @@ | |||
| function class_exists(class_name: string) { | |||
| return !!Java.classFactory.loader?.find(class_name); | |||
| } | ||
| } | ||
|
|
||
| throw "Error can't find class " + class_name; |
There was a problem hiding this comment.
Aren't there any cool exception-types in typescript?
Just like those ValueError, OSError, ... from python..? 🥲🥲
| @@ -0,0 +1,7 @@ | |||
| function get_object_address(obj: Java.Wrapper) { | |||
There was a problem hiding this comment.
retval type-scrict-ness here really matters! let's not give up on it
There was a problem hiding this comment.
module ProcessUtils in OSUtils namespace?
| @@ -0,0 +1,40 @@ | |||
| import { write_int } from "./patch_memory" | |||
There was a problem hiding this comment.
looks very bad.. I expected from that lang to have import-all feature by default, and not expect devs to add everything to their __all__ export
| @@ -0,0 +1,20 @@ | |||
| function show_toast(message: string) { | |||
| Java.perform(() => { | |||
There was a problem hiding this comment.
I wonder how correct is it to Java.perform here, but not anywhere else...
| const context = Java.use("android.app.ActivityThread").currentApplication().getApplicationContext(); | ||
| const JavaString = Java.use("java.lang.String"); | ||
|
|
||
| ToastWidget.makeText(context, JavaString.$new(message), 1).show(); |
There was a problem hiding this comment.
can we add a typed (something similar to std::chrono::milliseconds) duration param to the show_toast func? (with default value 1sec)
There was a problem hiding this comment.
ResearchUtils module in the JavaUtils namespace?
| let stackTrace = currentThread.getStackTrace(); | ||
|
|
||
| stackTrace.forEach(function(stackTraceElement) { | ||
| // TODO: repalce this any |
| @@ -0,0 +1,17 @@ | |||
| { | |||
| "name": "frida-agent-example", | |||
There was a problem hiding this comment.
we got to have our own cool libname, let's talk about it together
There was a problem hiding this comment.
textfiles must end by a newline !!!
There was a problem hiding this comment.
what is this file? wouldn't we like it to be .gitignored?
No description provided.