fixQRScanner.js 912 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. const fs = require("fs");
  2. const path = require("path");
  3. const https = require("https");
  4. module.exports = function (context) {
  5. const projectRoot = context.opts.projectRoot;
  6. let srcPath = path.resolve(
  7. projectRoot,
  8. "platforms",
  9. "android",
  10. "app",
  11. "src",
  12. "main",
  13. "java",
  14. "com",
  15. "bitpay",
  16. "cordova",
  17. "qrscanner",
  18. "QRScanner.java"
  19. );
  20. if (fs.existsSync(srcPath)) {
  21. fs.writeFileSync(
  22. srcPath,
  23. fs
  24. .readFileSync(srcPath)
  25. .toString()
  26. .replace(
  27. "import android.support.v4.app.ActivityCompat;",
  28. "import androidx.core.app.ActivityCompat;"
  29. )
  30. );
  31. }
  32. if (
  33. context.opts.plugin &&
  34. context.opts.plugin.id === "cordova-plugin-code-push"
  35. ) {
  36. }
  37. };