| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- const fs = require("fs");
- const path = require("path");
- const https = require("https");
- module.exports = function (context) {
- if (
- context.opts.plugin &&
- context.opts.plugin.id === "cordova-plugin-qrscanner"
- ) {
- const projectRoot = context.opts.projectRoot;
- const cordovaCommon = context.requireCordovaModule("cordova-common");
- const { ConfigParser } = cordovaCommon;
- const appConfig = new ConfigParser(
- path.resolve(projectRoot, "config.xml")
- );
- let projectName = appConfig.name();
- const file = path.resolve(
- projectRoot,
- "platforms",
- "ios",
- projectName,
- "Plugins",
- "cordova-plugin-qrscanner",
- "QRScanner.swift"
- );
- if (fs.existsSync(file)) {
- fs.writeFileSync(
- file,
- fs
- .readFileSync(file)
- .toString()
- .replaceAll(
- "UIApplication.openSettingsURLString",
- "UIApplicationOpenSettingsURLString"
- )
- );
- }
- }
- };
|