Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 40 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Repository Guidelines

## Project Structure & Module Organization
- Source: `src/` (ES modules, SCSS). Key areas: `src/components/`, `src/pages/`, `src/lib/`, `src/plugins/` (Cordova plugins), `src/styles/`.
- Web assets: `www/` (entry `index.html`, build output in `www/build/`, css/js subfolders).
- Config: `webpack.config.js`, `.babelrc`, `biome.json`, `config.xml`.
- Utilities: `utils/` (build, start, setup scripts; language and tooling helpers).

## Build, Test, and Development Commands
- `pnpm run setup`: Install deps, add Android platform, create build dirs, add plugins.
- `pnpm run start -- android d`: Build and run on device/emulator (default dev). For release-like: `pnpm run start -- android p`.
- `pnpm run build`: Build app (defaults to dev). Production example: `pnpm run build -- paid prod`. F-Droid variant: `pnpm run build -- paid prod fdroid`.
- `pnpm run clean -- android android`: Recreate Android platform.
- `pnpm run plugin -- <id> [path]`: Reinstall a Cordova plugin.
- Linting/format: `pnpm run lint`, `pnpm run format`, `pnpm run check` (Biome).

## Coding Style & Naming Conventions
- Formatting: Biome enforced; indent with tabs (`biome.json`). Run `npm run format` before commits.
- Language: ESM JavaScript, SCSS; prefer imports from `src` root (webpack `resolve.modules: ["node_modules", "src"]`).
- Naming: camelCase for files/dirs (e.g., `fileSystem`, `quickTools`), PascalCase for classes/components, kebab-case for SCSS partials when applicable.

## Testing Guidelines
- No formal test runner configured. Provide clear manual verification steps for Android (device/emulator), including affected screens, repro steps, and expected/actual behavior.
- Attach logs when relevant (see issue templates mention of `Acode.log`). Screenshots or screen recordings are encouraged for UI changes.

## Commit & Pull Request Guidelines
- Commits: Follow conventional style when possible (`feat:`, `fix:`, `chore(scope):`, etc.), reference issues (`(#123)`).
- PRs: Include a concise summary, linked issues, screenshots for UI, and test/verification steps. Note any Cordova plugin or config changes.
- Keep diffs focused; run `npm run lint` and ensure `www/build/` is generated by the pipeline, not committed.

## Security & Configuration Tips
- Building for F-Droid: pass `fdroid` as the third arg to `build` to toggle plugin set.
- Do not commit secrets/keystores. Android signing is handled outside the repo; keep `keystore.jks` private.

# When you need to call tools from the shell, use this rubric:

- Find Files: `fd`
- Find Text: `rg` (ripgrep)
- Select among matches: pipe to `fzf`
- JSON: `jq`
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
# Change Log

## v1.11.6 (965)

* fix: Terminal in F-Droid flavour by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1478
* feat: update target SDK to API 35 and fix edge-to-edge compatibility by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1486
* improve German translation by @brian200508 in https://github.com/Acode-Foundation/Acode/pull/1487
* Translation: Update hu-hu.json by @summoner001 in https://github.com/Acode-Foundation/Acode/pull/1489
* chore(update IAP library to lateset version) by @deadlyjack in https://github.com/Acode-Foundation/Acode/pull/1405
* feat: font manager ui for managing custom fonts by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1491
* feat: add package updated time display on plugin page by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1494
* chore: update id-id.json by @hyperz111 in https://github.com/Acode-Foundation/Acode/pull/1495
* fix: document provider by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1497
* feat(sponsor page) by @deadlyjack in https://github.com/Acode-Foundation/Acode/pull/1496
* fix: load custom fonts on restart by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1499
* Update hu-hu.json by @summoner001 in https://github.com/Acode-Foundation/Acode/pull/1498
* fix: resolve GitHub URI preview issues in server by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1501
* fix: plugins page scrolling by @deadlyjack in https://github.com/Acode-Foundation/Acode/pull/1505
* [chore] bump workflow dependencies to latest versions by @Jvr2022 in https://github.com/Acode-Foundation/Acode/pull/1506
* fix: load base app stylesheet in custom editor tab by @deadlyjack in https://github.com/Acode-Foundation/Acode/pull/1507
* update src/lang/pt-br.json by @sebastianjnuwu in https://github.com/Acode-Foundation/Acode/pull/1510
* Add code formatter keybind by @UnschooledGamer in https://github.com/Acode-Foundation/Acode/pull/1511
* Added hyphen in quicktools and more strings for i18n by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1516
* chore(i18n): update id-id.json with new strings by @hyperz111 in https://github.com/Acode-Foundation/Acode/pull/1521
* chore(i18n): update hu-hu.json with new strings by @summoner001 in https://github.com/Acode-Foundation/Acode/pull/1520
* Add/Update Bengali (bn-BD) Translation File by @thebadhonbiswas in https://github.com/Acode-Foundation/Acode/pull/1522
* feat: take confirmation before uninstalling terminal by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1528
* fix ui issue by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1527
* fix: disable changing editor theme when system is selected by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1529
* fix: svg render issue by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1530
* fix: encoding detection by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1533
* fix: big screen ui and global search worker issue by @deadlyjack in https://github.com/Acode-Foundation/Acode/pull/1534
* fix: improved terminal mounts by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1537
* chore(i18n): refine Russian (ru-ru.json) localization with updated and new strings by @Nein-Ich-wurde-Gewinnen in https://github.com/Acode-Foundation/Acode/pull/1541
* Fixed Plugin installation issues(in some cases) by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1546
* feat: add option to auto detect encoding by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1547
* fix: ftp infinite loading by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1552
* fix: tab active state when switching tab with api by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1557
* fix: resize of terminal and some small patches by @bajrangCoder in https://github.com/Acode-Foundation/Acode/pull/1562
* fix: fdroid builds by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1565

## v1.11.5 (963)

* Alpine Linux Backend by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/1401
Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8' ?>
<widget id="com.foxdebug.acode" android-versionCode="963" version="1.11.5"
<widget id="com.foxdebug.acode" android-versionCode="965" version="1.11.6"
xmlns="http://www.w3.org/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
Expand Down
49 changes: 44 additions & 5 deletions hooks/post-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ enableStaticContext();
patchTargetSdkVersion();


function getTmpDir() {
const tmpdirEnv = process.env.TMPDIR;

if (tmpdirEnv) {
try {
fs.accessSync(tmpdirEnv, fs.constants.R_OK | fs.constants.W_OK);
return tmpdirEnv;
} catch {
// TMPDIR exists but not accessible
}
}

try {
fs.accessSync("/tmp", fs.constants.R_OK | fs.constants.W_OK);
return "/tmp";
} catch {
console.log("Error: No usable temporary directory found (TMPDIR or /tmp not accessible).");
return null;
// process.exit(1);
}
}

function patchTargetSdkVersion() {
const prefix = execSync('npm prefix').toString().trim();
const gradleFile = path.join(prefix, 'platforms/android/app/build.gradle');
Expand All @@ -49,15 +71,32 @@ function patchTargetSdkVersion() {

if (sdkRegex.test(content)) {
let api = "35";
const froidFlag = path.join(prefix, 'fdroid.bool');

if (fs.existsSync(froidFlag)) {
const fdroid = fs.readFileSync(froidFlag, 'utf-8').trim();
if (fdroid == "true") {
const tmp = getTmpDir();
if (tmp == null) {
console.warn("---------------------------------------------------------------------------------\n\n\n\n");
console.warn(`⚠️ fdroid.bool not found`);
console.warn("⚠️ Fdroid flavour will be built");
api = "28";
console.warn("\n\n\n\n---------------------------------------------------------------------------------");
} else {
const froidFlag = path.join(getTmpDir(), 'fdroid.bool');

if (fs.existsSync(froidFlag)) {
const fdroid = fs.readFileSync(froidFlag, 'utf-8').trim();
if (fdroid == "true") {
api = "28";
}
} else {
console.warn("---------------------------------------------------------------------------------\n\n\n\n");
console.warn(`⚠️ fdroid.bool not found`);
console.warn("⚠️ Fdroid flavour will be built");
api = "28";
console.warn("\n\n\n\n---------------------------------------------------------------------------------");
//process.exit(1);
}
}


content = content.replace(sdkRegex, 'targetSdkVersion ' + api);
fs.writeFileSync(gradleFile, content, 'utf-8');
console.log('[Cordova Hook] ✅ Patched targetSdkVersion to ' + api);
Expand Down
11 changes: 3 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.foxdebug.acode",
"displayName": "Acode",
"version": "1.11.5",
"version": "1.11.6",
"description": "Acode is a code editor for android",
"scripts": {
"lang": "node ./utils/lang.js",
Expand Down Expand Up @@ -36,10 +36,9 @@
"cordova-sqlite-storage": {},
"cordova-plugin-websocket": {},
"cordova-plugin-buildinfo": {},
"com.foxdebug.acode.rk.exec.terminal": {},
"com.foxdebug.acode.rk.exec.proot": {},
"cordova-plugin-system": {},
"cordova-plugin-browser": {},
"cordova-plugin-system": {}
"com.foxdebug.acode.rk.exec.terminal": {}
},
"platforms": [
"android"
Expand All @@ -64,7 +63,6 @@
"@types/url-parse": "^1.4.11",
"autoprefixer": "^10.4.21",
"babel-loader": "^10.0.0",
"com.foxdebug.acode.rk.exec.proot": "file:src/plugins/proot",
"com.foxdebug.acode.rk.exec.terminal": "file:src/plugins/terminal",
"cordova-android": "^14.0.1",
"cordova-clipboard": "^1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ yarn setup
2. Build the project:

```shell
yarn build <free|paid> <p|prod|d|dev> [fdroid]
yarn build <free|paid> <p|prod|d|dev> [fdroid] <apk/bundle>
```

**Note**: Add the fdroid flag only if you want to build the F-Droid-compatible version of Acode.
Expand Down
2 changes: 2 additions & 0 deletions src/components/collapsableList.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export default function collapsableList(

[$title, $mainWrapper].forEach(defineProperties);

$mainWrapper.dataset.id = `${Math.random().toString(36).substring(2, 15)}`;

return $mainWrapper;

function onUlScroll() {
Expand Down
56 changes: 2 additions & 54 deletions src/components/contextmenu/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,7 @@ body.no-animation {
border: solid 1px transparent;
border: solid 1px var(--popup-border-color);

@media (min-width: 769px) {
min-width: 260px;
max-width: 400px;
min-height: 48px;
box-shadow: 0 0 8px var(--box-shadow-color);
}

@media (min-width: 1024px) {
min-width: 300px;
max-width: 480px;
min-height: 56px;
box-shadow: 0 0 16px var(--box-shadow-color);
}

& + .mask {
&+.mask {
z-index: 110;
}

Expand Down Expand Up @@ -109,48 +95,10 @@ body.no-animation {
pointer-events: none;
opacity: 0.5;
}

@media (min-width: 769px) {
height: 56px;
font-size: 1.05em;

&.notice::after {
font-size: 1.3em;
}

.text {
.value {
font-size: 0.85em;
}
}

.icon {
font-size: 1.1em;
}
}

@media (min-width: 1024px) {
height: 64px;
font-size: 1.1em;

&.notice::after {
font-size: 1.4em;
}

.text {
.value {
font-size: 0.9em;
}
}

.icon {
font-size: 1.2em;
}
}
}

&.hide {
transition: all 100ms ease;
opacity: 0;
}
}
}
36 changes: 1 addition & 35 deletions src/components/searchbar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,4 @@
opacity: 0;
transform: translate(0, -100%, 0);
}

@media (min-width: 769px) {
height: 60px;

input {
margin: 8px;
border-radius: 6px;
font-size: 1.1em;
padding: 0 12px;
}

.icon {
height: 60px;
width: 60px;
font-size: 1.4em;
}
}

@media (min-width: 1024px) {
height: 70px;

input {
margin: 10px;
border-radius: 8px;
font-size: 1.2em;
padding: 0 16px;
}

.icon {
height: 70px;
width: 70px;
font-size: 1.6em;
}
}
}
}
2 changes: 1 addition & 1 deletion src/components/sidebar/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import toast from "components/toast";
import "./style.scss";
import toast from "components/toast";
import Ref from "html-tag-js/ref";
import actionStack from "lib/actionStack";
import auth, { loginEvents } from "lib/auth";
Expand Down
Loading