()
| 45 | } |
| 46 | |
| 47 | async function removePermission() { |
| 48 | try { |
| 49 | let xml = await readFile(pluginXmlPath, 'utf-8'); |
| 50 | |
| 51 | if (!xml.includes('android.permission.MANAGE_EXTERNAL_STORAGE')) { |
| 52 | console.log('Permission not found — nothing to remove.'); |
| 53 | return false; |
| 54 | } |
| 55 | |
| 56 | const cleanedXml = xml.replace(permissionRegex, ''); |
| 57 | await writeFile(pluginXmlPath, cleanedXml, 'utf-8'); |
| 58 | console.log('Permission removed from plugin.xml'); |
| 59 | return true |
| 60 | } catch (err) { |
| 61 | console.error('Failed to remove permission:', err); |
| 62 | return false |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | |
| 67 | function updatePlugin() { |
no test coverage detected