Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/plugins/browser/utils/updatePackage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('path');

const configXML = path.resolve(__dirname, "../../../config.xml");
const menuJava = path.resolve(__dirname, "../../../platforms/android/app/src/main/java/com/foxdebug/browser/Menu.java");
const docProvider = path.resolve(__dirname, "../../../platforms/android/app/src/main/java/com/foxdebug/acode/rk/exec/terminal/AlpineDocumentProvider.java");
const repeatChar = (char, times) => {
let res = "";
while (--times >= 0) res += char;
Expand All @@ -11,11 +12,23 @@ const repeatChar = (char, times) => {

try {
const config = fs.readFileSync(configXML, "utf8");
const fileData = fs.readFileSync(menuJava, "utf8");
const appName = /widget id="([0-9a-zA-Z\.\-_]*)"/.exec(config)[1].split(".").pop();



const docProviderData = fs.readFileSync(docProvider, "utf8");
const newFileData = docProviderData.replace(/(import com\.foxdebug\.)(acode|acodefree)(.R;)/, `$1${appName}$3`);
fs.writeFileSync(docProvider, docProviderData);
Comment thread
RohitKushvaha01 marked this conversation as resolved.
Outdated




const fileData = fs.readFileSync(menuJava, "utf8");
const newFileData = fileData.replace(/(import com\.foxdebug\.)(acode|acodefree)(.R;)/, `$1${appName}$3`);
Comment thread
RohitKushvaha01 marked this conversation as resolved.
Outdated
Comment thread
RohitKushvaha01 marked this conversation as resolved.
Outdated
fs.writeFileSync(menuJava, newFileData);
Comment thread
RohitKushvaha01 marked this conversation as resolved.
Outdated



const msg = `==== Changed package to com.foxdebug.${appName} ====`;

console.log("");
Expand Down