Skip to content

Commit 81b8ff8

Browse files
deadlyjackAjit KumarRohitKushvaha01UnschooledGamergreptile-apps[bot]
authored
Ajit/fix fetch auth config (#2068)
* Refactor API calls to use fetch instead of ajax and update configuration imports - Replaced ajax calls with fetch in sponsor, sponsors, and themeSetting pages. - Updated constants import to config in various files for better configuration management. - Improved error handling for API responses. - Adjusted logic for premium theme checks based on new config settings. - Enhanced cookie management in the Authenticator plugin for better security. - Fixed minor typos and improved code readability across multiple files. * fix: update BASE_URL to production and enhance plugin loading feedback * fix: update cookie settings to include HttpOnly for enhanced security * fix: hooks not working on free version (#2075) * fix: hooks not working on free version * Update hooks/post-process.js Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update post-process.js --------- * fix: JSON formatting for UI zoom setting description * fix: JSON formatting and update translations * fix: JSON formatting and update translations * feat: IAP_AVAILABLE (#2086) * feat: IAP_AVAILABLE * fix: removed useless logs * feat: added web redirect (#2087) * feat: added web redirect * fix: removed useless code * fix: removed useless code * fix: added try/catch * fix: check owned before launching webpage * feat: added api to get installer package * feat: added installer check * format * fix: undefined error * Update src/lib/config.js Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix: syntax error (#2096) * Refactor plugin installation and purchase handling - Enhanced HandleIntent function to validate plugin installation requests. - Modified getLoggedInUser method to return a Promise. - Removed IAP_AVAILABLE from config and adjusted related logic. - Improved main.js to handle app installation source and define appInstallSource. - Refactored plugin page to streamline plugin installation and purchase logic. - Added external purchase handling in plugin view and buttons. - Updated IAP plugin to track availability status. - Enhanced ListItem component to manage plugin installation and purchase flow. - Introduced shouldAllowExternalPurchase helper function for better purchase logic. * fix: update Android version and improve XML formatting * feat: add login prompt for viewing owned plugins and update language files * fix: formatting * fix --------- Co-authored-by: Ajit Kumar <dellevenjack@gmail> Co-authored-by: Rohit Kushvaha <oldisg131@gmail.com> Co-authored-by: Emmanuel Lobo <76094069+UnschooledGamer@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com>
1 parent 4c83d3f commit 81b8ff8

99 files changed

Lines changed: 2856 additions & 2374 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/settings.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
22
"editor.formatOnSave": true,
3-
"autoimport.doubleQuotes": false,
4-
"java.configuration.updateBuildConfiguration": "disabled",
53
"prettier.requireConfig": true,
6-
"javascript.format.enable": true,
4+
"js/ts.format.enabled": true,
75
"editor.defaultFormatter": "esbenp.prettier-vscode",
86
"prettier.tabWidth": 2,
97
"prettier.useTabs": false,
10-
"javascript.format.semicolons": "insert",
8+
"js/ts.format.semicolons": "insert",
119
"[scss]": {
1210
"editor.defaultFormatter": "vscode.css-language-features"
1311
},
@@ -27,6 +25,13 @@
2725
"attr_quotes": "single"
2826
}
2927
},
28+
"[javascript]": {
29+
"editor.defaultFormatter": "biomejs.biome"
30+
},
31+
"editor.codeActionsOnSave": {
32+
"quickFix.biome": "explicit",
33+
"source.organizeImports.biome": "explicit"
34+
},
3035
"cSpell.words": [
3136
"abap",
3237
"Acode",
@@ -126,6 +131,7 @@
126131
"flac",
127132
"Flix",
128133
"floobits",
134+
"FOXBIZ",
129135
"Foxdebug",
130136
"freemarker",
131137
"gamemaker",
@@ -370,10 +376,9 @@
370376
"wtest",
371377
"wxml",
372378
"wxss",
379+
"xhrs",
380+
"XMLHTTP",
373381
"xquery",
374382
"Zeek"
375-
],
376-
"[javascript]": {
377-
"editor.defaultFormatter": "biomejs.biome"
378-
}
383+
]
379384
}

CHANGELOG.md

Lines changed: 118 additions & 0 deletions
Large diffs are not rendered by default.

biome.json

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,15 @@
3939
},
4040
"files": {
4141
"includes": [
42-
"**/src/**/*",
43-
"**/utils/**/*.js",
44-
"!**/www/build/**/*",
45-
"**/www/res/**/*.css",
46-
"**/src/plugins/terminal/**",
47-
"!**/ace-builds",
48-
"!**/src/plugins/**/*",
49-
"!**/plugins/**/*",
50-
"!**/hooks/**/*",
51-
"!**/fastlane/**/*",
52-
"!**/res/**/*",
53-
"!**/platforms/**/*"
42+
"src/**/*.js",
43+
"utils/**/*.js",
44+
"src/lang/**/*.json",
45+
"!src/plugins/**/*.js",
46+
"!www/**/*",
47+
"!plugins/**/*",
48+
"!hooks/**/*",
49+
"!fastlane/**/*",
50+
"!platforms/**/*"
5451
]
5552
}
5653
}

bun.lock

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

config.xml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<?xml version='1.0' encoding='utf-8' ?>
2-
<widget id="com.foxdebug.acode" android-versionCode="967" version="1.11.8"
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<widget id="com.foxdebug.acode" android-versionCode="1000" version="1.12.0"
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">
@@ -8,7 +8,7 @@
88
Light weight code editor and web IDE for android.
99
</description>
1010
<author email="ajit@foxdebug.com" href="https://foxdebug.com">
11-
Foxdebug
11+
Foxdebug
1212
</author>
1313
<content src="index.html" />
1414
<access launch-external="yes" origin="*" />
@@ -23,13 +23,14 @@
2323

2424
<platform name="android">
2525
<allow-intent href="market:*" />
26-
<preference name="fullscreen" value="false"/>
27-
<preference name="SplashScreen" value="none"/>
28-
<preference name="ShowTitle" value="true"/>
26+
<preference name="fullscreen" value="false" />
27+
<preference name="SplashScreen" value="none" />
28+
<preference name="ShowTitle" value="true" />
2929
<preference name="DisallowOverscroll" value="true" />
3030
<preference name="BackgroundColor" value="0xFF313131" />
3131
<preference name="AndroidWindowSplashScreenBackground" value="@color/ic_splash_background" />
32-
<preference name="AndroidWindowSplashScreenAnimatedIcon" value="res/android/drawable/ic_launcher_foreground.xml" />
32+
<preference name="AndroidWindowSplashScreenAnimatedIcon"
33+
value="res/android/drawable/ic_launcher_foreground.xml" />
3334
<preference name="AndroidPostSplashScreenTheme" value="@style/Theme.App.Activity" />
3435
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
3536
<preference name="AndroidLaunchMode" value="singleTask" />
@@ -38,8 +39,9 @@
3839
<preference name="GradlePluginKotlinEnabled" value="true" />
3940
<preference name="android-targetSdkVersion" value="36" />
4041

41-
42-
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
42+
43+
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge"
44+
target="/manifest/application">
4345
<application
4446
android:networkSecurityConfig="@xml/network_security_config"
4547
android:hardwareAccelerated="true"
@@ -49,7 +51,8 @@
4951
android:enableOnBackInvokedCallback="false" />
5052
</edit-config>
5153

52-
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
54+
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge"
55+
target="/manifest/application/activity[@android:name='MainActivity']">
5356
<activity android:resizeableActivity="true" />
5457
</edit-config>
5558

hooks/post-process.js

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ enableStaticContext();
3030
patchTargetSdkVersion();
3131
enableKeyboardWorkaround();
3232

33+
function getPackageName() {
34+
const configPath = path.resolve(__dirname, '../config.xml');
35+
if (!fs.existsSync(configPath)) {
36+
console.warn('[Cordova Hook] ⚠️ config.xml not found at', configPath);
37+
throw new Error(`config.xml is missing at ${configPath}`);
38+
}
39+
const content = fs.readFileSync(configPath, 'utf-8');
40+
const match = content.match(/id="([^"]+)"/);
41+
const packageName = match ? match[1] : 'com.foxdebug.acode';
42+
return packageName;
43+
}
44+
3345

3446
function getTmpDir() {
3547
const tmpdirEnv = process.env.TMPDIR;
@@ -107,11 +119,17 @@ function enableLegacyJni() {
107119
const prefix = execSync('npm prefix').toString().trim();
108120
const gradleFile = path.join(prefix, 'platforms/android/app/build.gradle');
109121

110-
if (!fs.existsSync(gradleFile)) return;
122+
if (!fs.existsSync(gradleFile)){
123+
console.warn('[Cordova Hook] ⚠️ build.gradle not found');
124+
return
125+
};
111126

112127
let content = fs.readFileSync(gradleFile, 'utf-8');
113128
// Check for correct block to avoid duplicate insertion
114-
if (content.includes('useLegacyPackaging = true')) return;
129+
if (content.includes('useLegacyPackaging = true')){
130+
console.log('[Cordova Hook] ✅ Legacy JNI packaging already enabled, skipping');
131+
return
132+
};
115133

116134
// Inject under android block with correct Groovy syntax
117135
content = content.replace(/android\s*{/, match => {
@@ -133,12 +151,16 @@ function enableLegacyJni() {
133151
function enableStaticContext() {
134152
try {
135153
const prefix = execSync('npm prefix').toString().trim();
154+
const packageName = getPackageName();
136155
const mainActivityPath = path.join(
137156
prefix,
138-
'platforms/android/app/src/main/java/com/foxdebug/acode/MainActivity.java'
157+
'platforms/android/app/src/main/java',
158+
packageName.replace(/\./g, '/'),
159+
'MainActivity.java'
139160
);
140161

141162
if (!fs.existsSync(mainActivityPath)) {
163+
console.warn('[Cordova Hook] ⚠️ MainActivity.java not found at', mainActivityPath);
142164
return;
143165
}
144166

@@ -150,6 +172,7 @@ function enableStaticContext() {
150172
content.includes('public static Context getContext()') &&
151173
content.includes('weakContext = new WeakReference<>(this);')
152174
) {
175+
console.log('[Cordova Hook] ✅ Static context already enabled, skipping');
153176
return;
154177
}
155178

@@ -181,6 +204,7 @@ function enableStaticContext() {
181204
);
182205

183206
fs.writeFileSync(mainActivityPath, content, 'utf-8');
207+
console.log('[Cordova Hook] ✅ Enabled static context');
184208
} catch (err) {
185209
console.error('[Cordova Hook] ❌ Failed to patch MainActivity:', err.message);
186210
}
@@ -189,19 +213,24 @@ function enableStaticContext() {
189213
function enableKeyboardWorkaround() {
190214
try{
191215
const prefix = execSync('npm prefix').toString().trim();
216+
const packageName = getPackageName();
192217
const mainActivityPath = path.join(
193218
prefix,
194-
'platforms/android/app/src/main/java/com/foxdebug/acode/MainActivity.java'
219+
'platforms/android/app/src/main/java',
220+
packageName.replace(/\./g, '/'),
221+
'MainActivity.java'
195222
);
196223

197224
if (!fs.existsSync(mainActivityPath)) {
225+
console.warn('[Cordova Hook] ⚠️ MainActivity.java not found at', mainActivityPath);
198226
return;
199227
}
200228

201229
let content = fs.readFileSync(mainActivityPath, 'utf-8');
202230

203231
// Skip if already patched
204232
if (content.includes('SoftInputAssist')) {
233+
console.log('[Cordova Hook] ✅ Keyboard workaround already enabled, skipping');
205234
return;
206235
}
207236

jsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"exclude": ["**/node_modules", "**/platforms", "**/www", "www/js/ace/**/*"],
33
"compilerOptions": {
4-
"baseUrl": "./src",
54
"paths": {
6-
"*": ["*"]
5+
"*": ["./src/*"]
76
}
87
},
98
"include": ["src/**/*"],

0 commit comments

Comments
 (0)