File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 "plugins" : {
2525 "cordova-clipboard" : {},
2626 "cordova-plugin-device" : {},
27- "cordova-plugin-file" : {},
27+ "cordova-plugin-file" : {
28+ "ANDROIDX_WEBKIT_VERSION" : " 1.4.0"
29+ },
2830 "cordova-plugin-sftp" : {},
2931 "cordova-plugin-server" : {},
3032 "cordova-plugin-ftp" : {},
Original file line number Diff line number Diff line change 1818 </config-file >
1919
2020 <config-file target =" AndroidManifest.xml" parent =" ./application" >
21- <provider android : name =" androidx.core.content.FileProvider" android : authorities =" com.foxdebug.provider" android : exported =" false" android : grantUriPermissions =" true" >
21+ <provider android : name =" androidx.core.content.FileProvider" android : authorities =" com.foxdebug.acodex. provider" android : exported =" false" android : grantUriPermissions =" true" >
2222 <meta-data android : name =" android.support.FILE_PROVIDER_PATHS" android : resource =" @xml/file_provider" />
2323 </provider >
2424 </config-file >
Original file line number Diff line number Diff line change @@ -14,12 +14,23 @@ module.exports = {
1414
1515 try {
1616 const fileData = fs . readFileSync ( configXML , "utf8" ) ;
17+ const widgetMatch = / < w i d g e t \s + i d = [ ' " ] ( [ ^ ' " ] + ) [ ' " ] / . exec ( fileData ) ;
18+ if ( ! widgetMatch ) {
19+ throw new Error ( "Could not find <widget id> in config.xml" ) ;
20+ }
1721 const manifest = fs . readFileSync ( androidManifest , "utf8" ) ;
18- const ID = reset ? "com.foxdebug" : / w i d g e t i d = " ( [ 0 - 9 a - z A - Z \. \- _ ] * ) " / . exec ( fileData ) [ 1 ] ;
22+ const ID = widgetMatch [ 1 ] ; // always use the real id
23+ //const ID = reset ? "com.foxdebug" : /widget id="([0-9a-zA-Z\.\-_]*)"/.exec(fileData)[1];
24+ // const newFileData = manifest.replace(
25+ // /(android:authorities=")([0-9a-zA-Z\.\-_]*)(")/,
26+ // `$1${reset ? "com.foxdebug" : ID}.provider$3`
27+ // );
1928 const newFileData = manifest . replace (
20- / ( a n d r o i d : a u t h o r i t i e s = " ) ( [ 0 - 9 a - z A - Z \. \- _ ] * ) ( " ) / ,
21- `$1${ reset ? "com.foxdebug" : ID } .provider$3`
29+ // Match the FileProvider provider’s authorities attribute only
30+ / ( < p r o v i d e r [ ^ > ] * a n d r o i d : n a m e = " a n d r o i d x \. c o r e \. c o n t e n t \. F i l e P r o v i d e r " [ ^ > ] * a n d r o i d : a u t h o r i t i e s = " ) [ ^ " ] + ( " ) / ,
31+ `$1${ ID } .provider$2`
2232 ) ;
33+
2334 fs . writeFileSync ( androidManifest , newFileData ) ;
2435
2536 const msg = "==== Changed provider to " + ID + ".provider ====" ;
You can’t perform that action at this time.
0 commit comments