@@ -10,26 +10,29 @@ function buildFridaConfig(
1010 caCertContent : string ,
1111 proxyHost : string ,
1212 proxyPort : number ,
13- portsToIgnore : number [ ]
13+ portsToIgnore : number [ ] ,
14+ enableSocks : boolean
1415) {
1516 return configScriptTemplate
1617 . replace ( / (?< = c o n s t C E R T _ P E M = ` ) [ ^ ` ] + (? = ` ) / s, caCertContent . trim ( ) )
1718 . replace ( / (?< = c o n s t P R O X Y _ H O S T = ' ) [ ^ ' ] + (? = ' ) / , proxyHost )
1819 . replace ( / (?< = c o n s t P R O X Y _ P O R T = ) \d + (? = ; ) / , proxyPort . toString ( ) )
20+ . replace ( / (?< = c o n s t P R O X Y _ S U P P O R T S _ S O C K S 5 = ) f a l s e (? = ; ) / , enableSocks . toString ( ) )
1921 . replace ( / (?< = c o n s t I G N O R E D _ N O N _ H T T P _ P O R T S = ) \[ \s * \] (? = ; ) / s, JSON . stringify ( portsToIgnore ) ) ;
2022}
2123
2224export async function buildAndroidFridaScript (
2325 caCertContent : string ,
2426 proxyHost : string ,
2527 proxyPort : number ,
26- portsToIgnore : number [ ]
28+ portsToIgnore : number [ ] ,
29+ enableSocks : boolean
2730) {
2831 const scripts = await Promise . all ( [
2932 fs . readFile ( path . join ( FRIDA_SCRIPTS_ROOT , 'frida-java-bridge.js' ) , { encoding : 'utf8' } ) ,
3033 fs . readFile ( path . join ( FRIDA_SCRIPTS_ROOT , 'config.js' ) , { encoding : 'utf8' } )
3134 . then ( ( configTemplate ) =>
32- buildFridaConfig ( configTemplate , caCertContent , proxyHost , proxyPort , portsToIgnore )
35+ buildFridaConfig ( configTemplate , caCertContent , proxyHost , proxyPort , portsToIgnore , enableSocks )
3336 ) ,
3437 ...[
3538 [ 'native-connect-hook.js' ] ,
@@ -52,13 +55,14 @@ export async function buildIosFridaScript(
5255 caCertContent : string ,
5356 proxyHost : string ,
5457 proxyPort : number ,
55- portsToIgnore : number [ ]
58+ portsToIgnore : number [ ] ,
59+ enableSocks : boolean
5660) {
5761 const scripts = await Promise . all ( [
5862 fs . readFile ( path . join ( FRIDA_SCRIPTS_ROOT , 'frida-objc-bridge.js' ) , { encoding : 'utf8' } ) ,
5963 fs . readFile ( path . join ( FRIDA_SCRIPTS_ROOT , 'config.js' ) , { encoding : 'utf8' } )
6064 . then ( ( configTemplate ) =>
61- buildFridaConfig ( configTemplate , caCertContent , proxyHost , proxyPort , portsToIgnore )
65+ buildFridaConfig ( configTemplate , caCertContent , proxyHost , proxyPort , portsToIgnore , enableSocks )
6266 ) ,
6367 ...[
6468 [ 'ios' , 'ios-connect-hook.js' ] ,
0 commit comments