Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/deadlyjack/acode
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajit Kumar committed Mar 15, 2024
2 parents 257d6eb + 6aa3919 commit 99d1dab
Show file tree
Hide file tree
Showing 73 changed files with 1,619 additions and 639 deletions.
2 changes: 1 addition & 1 deletion .vscode/plugins.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"plugins":["cordova-plugin-buildinfo","cordova-plugin-device","cordova-plugin-file","cordova-plugin-ftp","cordova-plugin-iap","cordova-plugin-server","cordova-plugin-sftp","cordova-clipboard","cordova-plugin-vibration","cordova-plugin-sdcard","cordova-plugin-system","cordova-plugin-browser"]}
{"plugins":["cordova-plugin-buildinfo","cordova-plugin-device","cordova-plugin-file","cordova-plugin-ftp","cordova-plugin-iap","cordova-plugin-sdcard","cordova-plugin-server","cordova-plugin-sftp","cordova-clipboard","cordova-plugin-browser","cordova-plugin-system"]}
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"anyscript",
"applescript",
"ARGB",
"Astro",
"Asuming",
"audiotrack",
"autocorrect",
Expand Down Expand Up @@ -123,6 +124,7 @@
"firebasehosting",
"firestore",
"flac",
"Flix",
"floobits",
"Foxdebug",
"freemarker",
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Change Log

## [1.10.0]

- New
- [x] **Ace editor** | 937
- Updated Ace editor to version 1.32.7
- Fixes
- [x] **UI** | 944
- Fixed status and navigation text color not visible in light theme.
- [x] **Plugin** | 944
- Fixed updates for plugin not showing up.

- Fixes
- [x] **Text selection** | 937
- Fixed context menu not showing up when selecting all text from context menu after click and hold.

## [1.9.0]

- New
Expand Down
2 changes: 0 additions & 2 deletions build-extras.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
ext.cdvCompileSdkVersion = 31

configurations {
all {
exclude module: 'commons-logging'
Expand Down
10 changes: 4 additions & 6 deletions 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="936" version="1.9.0"
<widget id="com.foxdebug.acode" android-versionCode="944" version="1.10.0"
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 Expand Up @@ -29,8 +29,6 @@
<preference name="DisallowOverscroll" value="true" />
<preference name="BackgroundColor" value="0xFF313131" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="33" />
<preference name="AndroidLaunchMode" value="singleTask" />
<preference name="prerendered-icon" value="false" />
<preference name="androidxEnabled" value="true" />
Expand Down Expand Up @@ -70,14 +68,14 @@
</config-file>

<config-file target="AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<!-- <uses-permission android:name="com.termux.permission.RUN_COMMAND" /> -->
</config-file>

<hook type="before_prepare" src="hooks/modify-java-files.js" />
<hook type="before_prepare" src="hooks/post-process.js" />
<hook type="before_prepare" src="hooks/copy-resources.js" />
<hook type="before_prepare" src="hooks/move-files.js" />
<hook type="after_prepare" src="hooks/post-process.js" />
</platform>
</widget>
22 changes: 0 additions & 22 deletions hooks/copy-resources.js

This file was deleted.

1 change: 0 additions & 1 deletion hooks/modify-java-files.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require('./update-mimetype');
const path = require('path');
const fs = require('fs');
const prettier = require('prettier');
Expand Down
139 changes: 109 additions & 30 deletions hooks/post-process.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,118 @@
/* eslint-disable no-console */
const path = require('path');
const fs = require('fs');

const resPath = path.resolve(
const buildFilePath = path.resolve(__dirname, '../build.json');
const copyToPath = path.resolve(__dirname, '../platforms/android/build.json');
const gradleFilePath = path.resolve(__dirname, '../build-extras.gradle');
const androidGradleFilePath = path.resolve(
__dirname,
'../platforms/android/app/src/main/res/'
'../platforms/android/app/build-extras.gradle'
);
const resPath = path.resolve(__dirname, '../platforms/android/app/src/main/res/');
const localResPath = path.resolve(__dirname, '../res/android/');

const splashScreens = [
'mipmap-ldpi',
'mipmap-hdpi-v26',
'mipmap-ldpi-v26',
'mipmap-mdpi-v26',
'mipmap-xhdpi-v26',
'mipmap-xxhdpi-v26',
'mipmap-xxxhdpi-v26',
'drawable-land-hdpi',
'drawable-land-ldpi',
'drawable-land-mdpi',
'drawable-land-xhdpi',
'drawable-land-xxhdpi',
'drawable-land-xxxhdpi',
'drawable-port-hdpi',
'drawable-port-ldpi',
'drawable-port-mdpi',
'drawable-port-xhdpi',
'drawable-port-xxhdpi',
'drawable-port-xxxhdpi',
];

for (let splashScreen of splashScreens) {
const file = path.join(resPath, splashScreen);
if (fs.existsSync(file)) {
fs.rmSync(file, {
recursive: true,
if (
!fs.existsSync(copyToPath)
&& fs.existsSync(buildFilePath)
) fs.copyFileSync(buildFilePath, copyToPath);

if (fs.existsSync(androidGradleFilePath)) fs.unlinkSync(androidGradleFilePath);
fs.copyFileSync(gradleFilePath, androidGradleFilePath);

deleteDirRecursively(resPath, [
path.join('values', 'strings.xml'),
path.join('values', 'colors.xml'),
path.join('values', 'styles.xml'),
'anim',
'xml',
]);
copyDirRecursively(localResPath, resPath);

/**
* Copy directory recursively
* @param {string} src Source directory
* @param {string} dest Destination directory
* @param {string[]} skip Files to not copy
*/
function copyDirRecursively(src, dest, skip = [], currPath = '') {
const exists = fs.existsSync(src);
const stats = exists && fs.statSync(src);
const isDirectory = exists && stats.isDirectory();

if (!exists) {
console.log(`File ${src} does not exist`);
return;
}

if (!fs.existsSync(dest) && isDirectory) {
fs.mkdirSync(dest);
}

if (exists && isDirectory) {
fs.mkdirSync(dest, { recursive: true });
fs.readdirSync(src).forEach((childItemName) => {
const relativePath = path.join(currPath, childItemName);
if (childItemName.startsWith('.')) return;
if (skip.includes(childItemName) || skip.includes(relativePath)) return;
copyDirRecursively(
path.join(src, childItemName),
path.join(dest, childItemName),
skip,
childItemName,
);
});
} else {
fs.copyFileSync(src, dest);

// log
const message = `copied: ${path.basename(src)}`;
console.log('\x1b[32m%s\x1b[0m', message); // green
}
}

/**
* Delete directory recursively
* @param {string} dir Directory to delete
* @param {string[]} except Files to not delete
*/
function deleteDirRecursively(dir, except = [], currPath = '') {
const exists = fs.existsSync(dir);
const stats = exists && fs.statSync(dir);
const isDirectory = exists && stats.isDirectory();

if (!exists) {
console.log(`File ${dir} does not exist`);
return;
}

if (exists && isDirectory) {
let deleteDir = true;
fs.readdirSync(dir).forEach((childItemName) => {
const relativePath = path.join(currPath, childItemName);
if (
childItemName.startsWith('.')
|| except.includes(childItemName)
|| except.includes(relativePath)
) {
console.log('\x1b[33m%s\x1b[0m', `skipped: ${relativePath}`); // yellow
deleteDir = false;
return;
}

deleteDirRecursively(
path.join(dir, childItemName),
except,
childItemName,
);
});
console.log('Removed: ', splashScreen);

if (deleteDir) {
console.log('\x1b[31m%s\x1b[0m', `deleted: ${currPath || path.basename(dir)}`); // red
fs.rmSync(dir, { recursive: true });
}
} else {
console.log('\x1b[31m%s\x1b[0m', `deleted: ${currPath || path.basename(dir)}`); // red
fs.rmSync(dir);
}
}
24 changes: 0 additions & 24 deletions hooks/update-mimetype.js

This file was deleted.

Loading

0 comments on commit 99d1dab

Please sign in to comment.