Skip to content

Commit 086bc2d

Browse files
committed
Merge remote-tracking branch 'origin/main' into ai-agent
2 parents 79a229b + d84508f commit 086bc2d

File tree

9 files changed

+88
-72
lines changed

9 files changed

+88
-72
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Change Log
22

3+
## v1.11.3 (959)
4+
5+
* feat: added system theme by @RohitKushvaha01
6+
* add: close-inactive-issues.yml by @UnschooledGamer
7+
* Added Executor by @RohitKushvaha01
8+
* fix: Executor Plugin's js module/interface path by @UnschooledGamer
9+
* fix: teardrop goes out of viewport when there is no gutter by @bajrangCoder
10+
* fix: infinite loading screen due to executor by @RohitKushvaha01
11+
* fix: infinite loading when previewing html files by @RohitKushvaha01
12+
* fix: apk related issues
13+
314
## v1.11.2 (958)
415

516
* fix: cors related issues when installing plugins from remote by @bajrangCoder

config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8' ?>
2-
<widget id="com.foxdebug.acode" android-versionCode="958" version="1.11.2"
2+
<widget id="com.foxdebug.acode" android-versionCode="959" version="1.11.3"
33
xmlns="http://www.w3.org/ns/widgets"
44
xmlns:android="http://schemas.android.com/apk/res/android"
55
xmlns:cdv="http://cordova.apache.org/ns/1.0">

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.foxdebug.acode",
33
"displayName": "Acode",
4-
"version": "1.11.2",
4+
"version": "1.11.3",
55
"description": "Acode is a code editor for android",
66
"scripts": {
77
"lang": "node ./utils/lang.js",

src/lib/run.js

Lines changed: 53 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,33 @@ async function run(
599599
// Get the project url
600600
const projectFolder = addedFolder[0];
601601

602-
// Set the root folder to the file parent if no project folder is set
602+
// FIXED: Better root folder determination for Termux URIs
603603
let rootFolder = pathName;
604-
if (projectFolder !== undefined && pathName.includes(projectFolder)) {
604+
605+
// Special handling for Termux URIs - extract the actual root from the URI structure
606+
if (
607+
activeFile &&
608+
activeFile.uri &&
609+
activeFile.uri.includes("com.termux.documents") &&
610+
activeFile.uri.includes("tree/")
611+
) {
612+
// Extract the tree part and decode it to get the actual root path
613+
const treeMatch = activeFile.uri.match(/tree\/([^:]+)/);
614+
if (treeMatch) {
615+
try {
616+
const decodedRoot = decodeURIComponent(treeMatch[1]);
617+
rootFolder = decodedRoot;
618+
console.log(`DEBUG - Termux root folder set to: ${rootFolder}`);
619+
} catch (e) {
620+
console.error("Error decoding Termux root:", e);
621+
}
622+
}
623+
} else if (
624+
projectFolder !== undefined &&
625+
pathName &&
626+
pathName.includes(projectFolder.url)
627+
) {
605628
rootFolder = projectFolder.url;
606-
} else {
607-
rootFolder = pathName;
608629
}
609630

610631
//make the uri absolute if necessary
@@ -634,30 +655,25 @@ async function run(
634655
try {
635656
const [, realPath] = temp.split("::");
636657

637-
// Determine root folder inside :: path
638-
let rootPath = rootFolder;
639-
if (rootFolder.includes("::")) {
640-
rootPath = rootFolder.split("::")[1];
641-
}
658+
console.log(`DEBUG - realPath: ${realPath}`);
659+
console.log(`DEBUG - rootFolder: ${rootFolder}`);
642660

643-
// Normalize both paths to arrays
644-
const realParts = realPath.split("/").filter(Boolean);
645-
const rootParts = rootPath.split("/").filter(Boolean);
661+
// Ensure rootFolder doesn't have trailing slash for comparison
662+
const normalizedRoot = rootFolder.replace(/\/+$/, "");
646663

647-
// Find where the paths start to differ
648-
let diffIndex = 0;
649-
while (
650-
diffIndex < realParts.length &&
651-
diffIndex < rootParts.length &&
652-
realParts[diffIndex] === rootParts[diffIndex]
653-
) {
654-
diffIndex++;
655-
}
664+
// Check if realPath starts with rootFolder
665+
if (realPath.startsWith(normalizedRoot)) {
666+
// Remove the rootFolder from the beginning of realPath
667+
let relativePath = realPath.substring(normalizedRoot.length);
656668

657-
// Return everything after the common root
658-
const relativeParts = realParts.slice(diffIndex);
659-
if (relativeParts.length > 0) {
660-
return relativeParts.join("/");
669+
// Remove leading slash if present
670+
relativePath = relativePath.replace(/^\/+/, "");
671+
672+
console.log(`DEBUG - relativePath: ${relativePath}`);
673+
674+
if (relativePath) {
675+
return relativePath;
676+
}
661677
}
662678
} catch (e) {
663679
console.error("Error handling Termux URI:", e);
@@ -697,26 +713,17 @@ async function run(
697713
}
698714
}
699715

700-
// Now find this rootFolderPath in the afterDoubleColon string
701-
if (afterDoubleColon.includes(rootFolderPath)) {
702-
// Find where to start the relative path
703-
const parts = afterDoubleColon.split("/");
704-
705-
// Find the index of the part that matches or contains rootFolderPath
706-
let startIndex = -1;
707-
for (let i = 0; i < parts.length; i++) {
708-
if (
709-
parts[i].includes(rootFolderPath) ||
710-
rootFolderPath.includes(parts[i])
711-
) {
712-
startIndex = i;
713-
break;
714-
}
715-
}
716-
717-
// If we found a matching part, get everything after it
718-
if (startIndex >= 0 && startIndex < parts.length - 1) {
719-
return parts.slice(startIndex + 1).join("/");
716+
// Use direct string replacement instead of path component comparison
717+
const normalizedRoot = rootFolderPath.replace(/\/+$/, "");
718+
if (afterDoubleColon.startsWith(normalizedRoot)) {
719+
let relativePath = afterDoubleColon.substring(
720+
normalizedRoot.length,
721+
);
722+
// Remove leading slash if present
723+
relativePath = relativePath.replace(/^\/+/, "");
724+
725+
if (relativePath) {
726+
return relativePath;
720727
}
721728
}
722729
}
@@ -761,6 +768,7 @@ async function run(
761768
* Opens the preview in browser
762769
*/
763770
function openBrowser() {
771+
console.log(`Running ${Url.join(pathName, filename)}`);
764772
let url = "";
765773
if (pathName === null && !activeFile.location) {
766774
url = `http://localhost:${port}/__unsaved_file__`;

src/plugins/Executor/index.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/plugins/Executor/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<plugin id="com.foxdebug.acode.exec" version="1.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"><name>Executor</name><js-module name="Executor" src="index.js"><clobbers target="cordova.plugins.Executor" /></js-module><platform name="android"><config-file parent="/*" target="res/xml/config.xml"><feature name="Executor"><param name="android-package" value="com.foxdebug.acode.exec.Executor" /></feature></config-file><config-file parent="/*" target="AndroidManifest.xml"></config-file><source-file src="src/android/Executor.java" target-dir="src/com/foxdebug/acode/exec/Executor" /></platform></plugin>
2+
<plugin id="com.foxdebug.acode.exec" version="1.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"><name>Executor</name><js-module name="Executor" src="www/Executor.js"><clobbers target="cordova.plugins.Executor" /></js-module><platform name="android"><config-file parent="/*" target="res/xml/config.xml"><feature name="Executor"><param name="android-package" value="com.foxdebug.acode.exec.Executor" /></feature></config-file><config-file parent="/*" target="AndroidManifest.xml"></config-file><source-file src="src/android/Executor.java" target-dir="src/com/foxdebug/acode/exec/Executor" /></platform></plugin>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var exec = require('cordova/exec');
2+
3+
module.exports.execute = function (cmd,success,failure) {
4+
exec(success, failure, 'Executor', 'exec', [cmd]);
5+
}

www/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,17 @@
165165

166166
<title>Acode</title>
167167
<!--styles-->
168+
<link rel="stylesheet" href="./css/build/263.css">
169+
<link rel="stylesheet" href="./css/build/31.css">
170+
<link rel="stylesheet" href="./css/build/439.css">
171+
<link rel="stylesheet" href="./css/build/490.css">
172+
<link rel="stylesheet" href="./css/build/626.css">
168173
<link rel="stylesheet" href="./css/build/about.css">
169174
<link rel="stylesheet" href="./css/build/customTheme.css">
170175
<link rel="stylesheet" href="./css/build/donate.css">
171176
<link rel="stylesheet" href="./css/build/fileBrowser.css">
172177
<link rel="stylesheet" href="./css/build/main.css">
173178
<link rel="stylesheet" href="./css/build/plugins.css">
174-
<link rel="stylesheet" href="./css/build/src_pages_quickTools_quickTools_js.css">
175-
<link rel="stylesheet" href="./css/build/src_sidebarApps_extensions_index_js.css">
176-
<link rel="stylesheet" href="./css/build/src_sidebarApps_files_index_js.css">
177-
<link rel="stylesheet" href="./css/build/src_sidebarApps_notification_index_js.css">
178-
<link rel="stylesheet" href="./css/build/src_sidebarApps_searchInFiles_index_js.css">
179179
<link rel="stylesheet" href="./css/build/themeSetting.css">
180180
<!--styles_end-->
181181
</head>

0 commit comments

Comments
 (0)