File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 5151* [ ` Hook all method overloads ` ] ( #hook-overloads )
5252* [ ` Register broadcast receiver ` ] ( #register-broadcast-receiver )
5353* [ ` Increase step count ` ] ( #increase-step-count )
54+ * [ ` list classes implements interface with class loaders ` ] ( #list-classes-implements-interface )
5455* File system access hook ` $ frida --codeshare FrenchYeti/android-file-system-access-hook -f com.example.app --no-pause `
5556* How to remove/disable java hooks ? Assign ` null ` to the ` implementation ` property.
5657
@@ -1826,6 +1827,37 @@ TODO
18261827<br >[ ⬆ Back to top] ( #table-of-contents )
18271828
18281829
1830+ #### list classes implements interface
1831+
1832+ ``` js
1833+ function listClassesImplementsInterface (aInterface ) {
1834+ let classLoaders = Java .enumerateClassLoadersSync ()
1835+ Java .enumerateLoadedClassesSync ().forEach (className => {
1836+ for (let i = 0 ; i < classLoaders .length ; i++ ) {
1837+ let classLoader = classLoaders[i]
1838+ Java .classFactory .loader = classLoader
1839+ try {
1840+ let jclass = Java .use (className).class
1841+ let ifaces = jclass .getInterfaces ().toString ()
1842+ jclass = null
1843+ if (ifaces .indexOf (aInterface) != - 1 ) {
1844+ console .log (JSON .stringify ({
1845+ name: className,
1846+ loader: classLoader .toString (),
1847+ interfaces: ifaces
1848+ }))
1849+ break // we found one ClassLoader, that's enough
1850+ }
1851+ } catch (e) {
1852+ // continue to next ClassLoader
1853+ }
1854+ }
1855+ })
1856+ }
1857+ ```
1858+
1859+ <br >[ ⬆ Back to top] ( #table-of-contents )
1860+
18291861
18301862#### Increase step count
18311863
You can’t perform that action at this time.
0 commit comments