Skip to content

Commit d0ee94b

Browse files
committed
Merge Acode-migration main into chore/sync-acode-main-b08fd0bf
Brings in #22, #25, #28 and #30 from main. - src/lang/*.json: kept both sides' new keys (this branch's canvas and error strings, main's FAQ strings). es-sv.json: both sides added the same 10 keys; kept this branch's Spanish translations from the es-sv update. - package.json: kept mermaid removed (replaced by pele on this branch); took main's katex bump and versionCode. - package-lock.json: this branch's lockfile plus main's katex 0.19.0 and commander 15.0.0 entries.
2 parents 8b17bf1 + 9953794 commit d0ee94b

103 files changed

Lines changed: 2853 additions & 386 deletions

File tree

Some content is hidden

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

‎.github/workflows/native-tests.yml‎

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,10 @@ jobs:
118118
name: iOS
119119
needs: changes
120120
if: needs.changes.outputs.ios == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
121-
runs-on: macos-26
121+
runs-on: macos-15
122122
timeout-minutes: 30
123+
env:
124+
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
123125
steps:
124126
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
125127
with:
@@ -134,29 +136,36 @@ jobs:
134136
run: brew install meson ninja llvm lld
135137
- name: Prepare local iOS configuration
136138
run: cp platforms/ios/Config.xcconfig.example platforms/ios/Config.xcconfig
137-
- name: Select iPhone and iPad simulators with working StoreKit testing
139+
- name: Select iPhone and iPad simulators with working StoreKit and icon testing
138140
id: simulator
139141
run: |
140142
node <<'JS'
141143
const { execFileSync } = require('node:child_process');
142144
const { appendFileSync } = require('node:fs');
143145
const { devices } = JSON.parse(execFileSync('xcrun', ['simctl', 'list', 'devices', 'available', '--json']));
144-
// iOS 26.3–26.5 fails SKTestSession configuration in command-line runs:
146+
// 26.2 simulators fail alternate icon changes; 26.3–26.5 fails SKTestSession:
145147
// https://developer.apple.com/forums/thread/826971
146-
const supported = ['iOS-18-6', 'iOS-26-2'].flatMap(version =>
147-
devices[`com.apple.CoreSimulator.SimRuntime.${version}`] || []);
148-
for (const [family, output] of [['iPhone', 'id'], ['iPad', 'ipad']]) {
149-
const device = supported.find(device => device.isAvailable &&
150-
device.deviceTypeIdentifier?.startsWith(`com.apple.CoreSimulator.SimDeviceType.${family}-`));
151-
if (!device) throw new Error(`Install an iOS 18.6 or 26.2 ${family} simulator for integration tests`);
148+
const runtime = 'com.apple.CoreSimulator.SimRuntime.iOS-18-6';
149+
const supported = devices[runtime] || [];
150+
for (const [type, output] of [['iPhone-16-Pro', 'id'], ['iPad-Air-11-inch-M3', 'ipad']]) {
151+
const identifier = `com.apple.CoreSimulator.SimDeviceType.${type}`;
152+
const device = supported.find(device => device.isAvailable && device.deviceTypeIdentifier === identifier);
153+
if (!device) throw new Error(`Missing iOS 18.6 ${type} simulator for integration tests`);
154+
console.log(`Using ${type} on iOS 18.6: ${device.udid}`);
152155
appendFileSync(process.env.GITHUB_OUTPUT, `${output}=${device.udid}\n`);
153156
}
154157
JS
155158
- name: Build and run simulator tests with SSH and FTP fixtures
156159
run: |
157160
python3 -m venv .ios-build/ssh-fixture-venv
158161
.ios-build/ssh-fixture-venv/bin/pip install -r tests/fixtures/ssh/requirements.txt
159-
.ios-build/ssh-fixture-venv/bin/python tests/fixtures/ssh/server.py -- npm run test:ios -- --target=${{ steps.simulator.outputs.id }}
162+
# Temporarily exclude Alpine process exits on hosted runners (run 41789669396).
163+
# Local runs retain these tests; InAppRunnerTests also starts Alpine.
164+
skips=()
165+
for test in AlpineInteractionTests AlpineLspTests AlpinePackageTests AlpineSignalTests AlpineSimdTests AlpineTerminalServerTests AlpineTerminalTests InAppRunnerTests; do
166+
skips+=("-skip-testing:runnerTests/$test")
167+
done
168+
.ios-build/ssh-fixture-venv/bin/python tests/fixtures/ssh/server.py -- npm run test:ios -- --target=${{ steps.simulator.outputs.id }} "${skips[@]}"
160169
- name: Run iPad startup and native UI checks
161170
run: |
162171
checks=()

‎dev/scripts/ios.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function parseOptions(args) {
3737
mode: args.some((arg) => ["p", "prod"].includes(arg)) ? "Release" : "Debug",
3838
action: args.includes("test") ? "test" : "build",
3939
skipWeb: args.includes("--skip-web"),
40+
skipTests: args.filter((arg) => arg.startsWith("-skip-testing:")),
4041
device: args.includes("--device"),
4142
target: args.find((arg) => arg.startsWith("--target="))?.slice(9),
4243
};
@@ -96,6 +97,7 @@ function build(options) {
9697
"NO",
9798
"-collect-test-diagnostics",
9899
"never",
100+
...(options.skipTests || []),
99101
]
100102
: []),
101103
options.action,
@@ -112,7 +114,11 @@ function build(options) {
112114

113115
function launch(options, artifact) {
114116
if (options.device || !options.target) {
115-
run("open", [path.join(root, "platforms/ios/runner.xcodeproj")]);
117+
run("open", [
118+
"-b",
119+
"com.apple.dt.Xcode",
120+
path.join(root, "platforms/ios/runner.xcodeproj"),
121+
]);
116122
console.log(
117123
"In Xcode, select the runner scheme and your iPhone, then press Cmd+R to build and install.",
118124
);

‎dev/sync.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function patchProjectFile(pkg) {
5757
function patchDisplayName(pkg) {
5858
patchFile(infoPlistFile, (content) =>
5959
content.replace(
60-
/(<key>CFBundleDisplayName<\/key>\s*\n\s*<string>)[^<]*(<\/string>)/,
60+
/(<key>CFBundle(?:Display)?Name<\/key>\s*\n\s*<string>)[^<]*(<\/string>)/g,
6161
`$1${pkg.displayName}$2`,
6262
),
6363
);

‎package-lock.json‎

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

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "acode-app",
33
"displayName": "Acode",
44
"version": "1.13.6",
5-
"versionCode": 1016,
5+
"versionCode": 1022,
66
"androidPackageId": "com.foxdebug.acode",
77
"appleAppId": "app.acode",
88
"description": "Powerful code editor and terminal for IOS and Android",
@@ -133,7 +133,7 @@
133133
"filesize": "^11.0.22",
134134
"html-tag-js": "^2.4.16",
135135
"jszip": "^3.10.1",
136-
"katex": "^0.16.47",
136+
"katex": "^0.19.0",
137137
"markdown-it": "^14.3.0",
138138
"markdown-it-anchor": "^9.2.1",
139139
"markdown-it-emoji": "^3.1.0",

‎platforms/android/app/src/main/java/com/foxdebug/acode/auth/Authenticator.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ private void startLogin(JSONObject options, Callback callbackContext) {
116116
.buildUpon()
117117
.appendEncodedPath("login")
118118
.appendQueryParameter("redirect", "app")
119+
.appendQueryParameter("src", "android")
120+
.appendQueryParameter("androidPackage", host.getContext().getPackageName())
119121
.appendQueryParameter("authFlow", "app-code")
120122
.appendQueryParameter("state", state)
121123
.appendQueryParameter("challenge", challenge)

‎platforms/ios/runner.xcodeproj/project.pbxproj‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@
375375
CLANG_WARN_UNREACHABLE_CODE = YES;
376376
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
377377
COPY_PHASE_STRIP = NO;
378-
CURRENT_PROJECT_VERSION = 1016;
378+
CURRENT_PROJECT_VERSION = 1022;
379379
DEBUG_INFORMATION_FORMAT = dwarf;
380380
ENABLE_STRICT_OBJC_MSGSEND = YES;
381381
ENABLE_TESTABILITY = YES;
@@ -443,7 +443,7 @@
443443
CLANG_WARN_UNREACHABLE_CODE = YES;
444444
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
445445
COPY_PHASE_STRIP = NO;
446-
CURRENT_PROJECT_VERSION = 1016;
446+
CURRENT_PROJECT_VERSION = 1022;
447447
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
448448
ENABLE_NS_ASSERTIONS = NO;
449449
ENABLE_STRICT_OBJC_MSGSEND = YES;

‎platforms/ios/runner/Info.plist‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1515
<key>CFBundleInfoDictionaryVersion</key>
1616
<string>6.0</string>
17+
<key>CFBundleName</key>
18+
<string>Acode</string>
1719
<key>CFBundlePackageType</key>
1820
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1921
<key>CFBundleShortVersionString</key>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#if DEBUG
2+
import WebKit
3+
4+
@MainActor
5+
enum SimulatorTestSupport {
6+
static func disableConsent(in scripts: WKUserContentController) {
7+
guard !scripts.userScripts.contains(where: { $0.source.contains("iosConsentFixture") }) else { return }
8+
// Suppress network consent independently of the test's StoreKit entitlements.
9+
scripts.addUserScript(WKUserScript(source: """
10+
Object.defineProperty(window,'admob',{configurable:true,set(value){
11+
value.privacy.gatherConsent=async function iosConsentFixture(){
12+
return {consentStatus:'unknown',canRequestAds:false,privacyOptionsRequired:false};
13+
};
14+
Object.defineProperty(window,'admob',{configurable:true,writable:true,value});
15+
}});
16+
""", injectionTime: .atDocumentStart, forMainFrameOnly: true))
17+
}
18+
}
19+
#endif

‎platforms/ios/runner/WebViewController.swift‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ final class WebViewController: UIViewController {
2424
config.setURLSchemeHandler(AppURLSchemeHandler(), forURLScheme: "acode")
2525

2626
let contentController = WKUserContentController()
27+
#if DEBUG && targetEnvironment(simulator)
28+
if ProcessInfo.processInfo.arguments.contains("-acode-ui-testing") {
29+
SimulatorTestSupport.disableConsent(in: contentController)
30+
}
31+
#endif
2732
WebShadowCaret.install(on: contentController)
2833
contentController.add(WeakScriptMessageHandler(bridge), name: "exec")
2934
config.userContentController = contentController

0 commit comments

Comments
 (0)