@@ -4,7 +4,8 @@ import { ICurrentActivityFragment } from "./lib/interfaces.js";
44import {
55 getApplicationContext ,
66 R ,
7- wrapJavaPerform
7+ wrapJavaPerform ,
8+ Java
89} from "./lib/libjava.js" ;
910import {
1011 Activity ,
@@ -16,6 +17,7 @@ import {
1617 Throwable ,
1718 JavaMethodsOverloadsResult ,
1819} from "./lib/types.js" ;
20+ import type { default as JavaTypes } from "frida-java-bridge" ;
1921
2022enum PatternType {
2123 Regex = 'regex' ,
@@ -70,7 +72,7 @@ export const lazyWatchForPattern = (query: string, watch: boolean, dargs: boolea
7072
7173 // This method loops over all enumerate matches and then calls watch
7274 // with the arguments specified in the parent function
73- const watchMatches = ( matches : Java . EnumerateMethodsMatchGroup [ ] ) => {
75+ const watchMatches = ( matches : JavaTypes . EnumerateMethodsMatchGroup [ ] ) => {
7476 matches . forEach ( match => {
7577 match . classes . forEach ( _class => {
7678 _class . methods . forEach ( _method => {
@@ -114,7 +116,7 @@ export const lazyWatchForPattern = (query: string, watch: boolean, dargs: boolea
114116 } , 1000 * 5 ) ;
115117} ;
116118
117- export const javaEnumerate = ( query : string ) : Promise < Java . EnumerateMethodsMatchGroup [ ] > => {
119+ export const javaEnumerate = ( query : string ) : Promise < JavaTypes . EnumerateMethodsMatchGroup [ ] > => {
118120 // If the query is just a classname, strongarm it into a pattern.
119121 if ( getPatternType ( query ) === PatternType . Klass ) {
120122 query = `*${ query } *!*` ;
@@ -270,9 +272,9 @@ export const watch = (pattern: string, dargs: boolean, dbt: boolean, dret: boole
270272 jobs . add ( job ) ;
271273
272274 return new Promise ( ( resolve , reject ) => {
273- javaEnumerate ( pattern ) . then ( ( matches : Java . EnumerateMethodsMatchGroup [ ] ) => {
274- matches . forEach ( ( match : Java . EnumerateMethodsMatchGroup ) => {
275- match . classes . forEach ( ( klass : Java . EnumerateMethodsMatchClass ) => {
275+ javaEnumerate ( pattern ) . then ( ( matches : JavaTypes . EnumerateMethodsMatchGroup [ ] ) => {
276+ matches . forEach ( ( match : JavaTypes . EnumerateMethodsMatchGroup ) => {
277+ match . classes . forEach ( ( klass : JavaTypes . EnumerateMethodsMatchClass ) => {
276278 klass . methods . forEach ( method => {
277279 // Only watch matched methods
278280 watchMethod ( `${ klass . name } .${ method } ` , job , dargs , dbt , dret ) ;
0 commit comments