Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ platforms/**/bundle/
**/Config.xcconfig
platforms/ios/**/*.xcuserstate
platforms/ios/**/xcuserdata/
/docs/reviews/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## Unreleased

* Ad-free pass redemption is discontinued; previously earned time remains valid until expiry. The `system.redeemReward` wrapper and native action have been removed. Plugins using that action must stop offering redemption. Internal pass-offer helpers and the `isWatchingRewardedAd` export were also removed.

## v1.13.5

* fix(terminal): stop proot "can't sanitize binding" fd warnings by @RohitKushvaha01 in https://github.com/Acode-Foundation/Acode/pull/2878
Expand Down
28 changes: 22 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,24 @@ implementation. Version, build number and display name are synced from
services work without a distribution certificate.

The target includes `platforms/ios/ads`, Google Mobile Ads/UMP and advertising
metadata. Debug builds use Google's iOS test units. Release builds require
`ACODE_IOS_ADMOB_APP_ID`, `ACODE_IOS_ADMOB_BANNER_ID`,
`ACODE_IOS_ADMOB_INTERSTITIAL_ID` and `ACODE_IOS_ADMOB_REWARDED_ID`.
See [iOS advertising](docs/ios-advertising.md) for consent testing, source provenance
and validation limits. Run the normal script before building `runner` in Xcode;
it prepares `.ios-build/App-Info.plist` and the matching web bundle.
metadata. `ads.json` supplies ad-unit IDs through the web build configuration;
`dev/scripts/iosAds.js` separately writes the app ID and advertising metadata into
`.ios-build/App-Info.plist`. Run the normal script before building `runner` in Xcode
to prepare both the plist and web bundle. The adapted AdMob Plus code retains its
MIT notice in `platforms/ios/ads/AdMobPlus-LICENSE.txt`.

The app gathers UMP consent, then native startup waits for ATT to settle before
starting Mobile Ads; consent is checked again before startup and ad requests.
ATT waits are bounded to 30 seconds. A timeout fails startup without granting
authorization; retry/foreground checks read the OS status, and cancellation never
starts a second prompt while the original OS request is outstanding.
On physical Release builds, a verified StoreKit sandbox/Xcode environment selects
Google demo units. A failed, unverified or timed-out lookup keeps the configured
units; the lookup deadline is three seconds. Verified environments are cached for
the process; failed/unverified lookups retry after a 30-second cooldown, and
concurrent lookups share one request. Debug/simulator selection comes from
the build configuration and SDK test-device behavior. Simulator tests do not
establish TestFlight/App Review environment selection or production ad fill.

The icon picker uses UIKit alternate icons and the existing reward/Pro gates.
`runner.icon` and the fifteen alternate app-icon sets use Acode's existing
Expand All @@ -264,6 +276,10 @@ iPhone and iPad. It uses the local StoreKit Pro fixture to unlock the picker.
Native tests cover packaged icons
and the bridge; shared tests cover reward and purchase gates.

Calling `Bridge.setup()` again intentionally invalidates callbacks from the old
navigation and resets its services before rebuilding them for the supplied WebView.
Normal page navigation calls `reset()` and reuses the same WebView and services.

The `System` file utilities retain Android's result shapes, newline semantics and
nonrecursive deletion while restricting paths to the sandbox or granted Files
folders. Reward-pass state uses Keychain. Android file-edit intents and launcher
Expand Down
8 changes: 0 additions & 8 deletions ads.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
"banner": "ca-app-pub-5911839694379275/9157899592",
"interstitial": "ca-app-pub-5911839694379275/9570937608",
"rewarded": "ca-app-pub-5911839694379275/1633667633",
"academyRewarded": "ca-app-pub-5911839694379275/3893763807",
"academyInterstitial": "ca-app-pub-5911839694379275/7819275372",
"appOpen": "ca-app-pub-5911839694379275/4600740197"
},
"test": {
"appId": "ca-app-pub-3940256099942544~3347511713",
"banner": "ca-app-pub-3940256099942544/6300978111",
"interstitial": "ca-app-pub-3940256099942544/1033173712",
"rewarded": "ca-app-pub-3940256099942544/5224354917",
"academyRewarded": "ca-app-pub-3940256099942544/5224354917",
"academyInterstitial": "ca-app-pub-3940256099942544/1033173712",
"appOpen": "ca-app-pub-3940256099942544/9257395921"
}
},
Expand All @@ -25,17 +21,13 @@
"banner": "ca-app-pub-5911839694379275/7672969208",
"interstitial": "ca-app-pub-5911839694379275/8054492011",
"rewarded": "ca-app-pub-5911839694379275/4550361278",
"academyRewarded": "ca-app-pub-5911839694379275/4716873072",
"academyInterstitial": "ca-app-pub-5911839694379275/5428328674",
"appOpen": "ca-app-pub-5911839694379275/4115247005"
},
"test": {
"appId": "ca-app-pub-3940256099942544~1458002511",
"banner": "ca-app-pub-3940256099942544/2435281174",
"interstitial": "ca-app-pub-3940256099942544/4411468910",
"rewarded": "ca-app-pub-3940256099942544/1712485313",
"academyRewarded": "ca-app-pub-3940256099942544/1712485313",
"academyInterstitial": "ca-app-pub-3940256099942544/4411468910",
"appOpen": "ca-app-pub-3940256099942544/5575463023"
}
}
Expand Down
2 changes: 0 additions & 2 deletions dev/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ function getAdConfig(platform, mode) {
"banner",
"interstitial",
"rewarded",
"academyRewarded",
"academyInterstitial",
"appOpen",
]) {
const id = config[name];
Expand Down
128 changes: 0 additions & 128 deletions docs/ios-advertising.md

This file was deleted.

14 changes: 6 additions & 8 deletions docs/ios-port.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ translation checks. Later focused native checks are recorded below.
StoreKit coverage uses local simulated transactions; it does not verify production
products or the purchase backend. Advertising checks verify the free bridge,
consent gating, load cancellation, banner layout and paid-impression payloads;
the paid app excludes the SDK classes, resources and metadata. See
[iOS advertising](ios-advertising.md) for source provenance, configuration and
remaining live/device checks.
the paid app excludes the SDK classes, resources and metadata.

The simulator suite currently exercises editor startup, safe-area layout, reading,
editing and saving files, watching coordinated writes, worker loading, incoming
Expand Down Expand Up @@ -407,8 +405,8 @@ and cache clearing are supported; clearing the WebView cache keeps app storage.
All sixteen existing app icons are packaged for iPhone and iPad, including Acode's
default artwork. UIKit changes the launcher icon in place. The shared picker
retains reward/Pro requirements and persistence, and omits Android's app-exit
warning on iOS. Reward passes retain the one-hour Quick offer, random four-to-six
hour Focus offer, three-per-day limit and ten-hour cap, with native Keychain state.
warning on iOS. New ad-free passes are discontinued. Existing earned time remains
active until its stored expiry, with native Keychain state preserved.
Native tests verify packaged icon metadata and actual DOM hit targets after
startup. A paid-edition UI test changes and restores the icon through Settings,
acknowledging Apple's confirmation. An iOS-only centering rule keeps WebKit's
Expand Down Expand Up @@ -584,9 +582,9 @@ reproduced the missing scene for all six native formats, and all six AdMob bridg
tests pass with the correction. Live portrait and landscape Split View checks
displayed the full interstitial test image and passed dismissal, though other
landscape runs had an unexplained black creative. The iPhone rendered the full
test image, but its dismissal check timed out after desktop UI targeting failures. See
[iOS advertising](ios-advertising.md) for the distinction between these test-ad
checks and production delivery, consent variants and physical-device validation.
test image, but its dismissal check timed out after desktop UI targeting failures.
These test-ad checks do not establish production delivery, consent variants or
physical-device behavior.

## Remaining native work

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "acode-app",
"displayName": "Acode",
"version": "1.13.6",
"versionCode": 1022,
"versionCode": 1023,
"androidPackageId": "com.foxdebug.acode",
"appleAppId": "app.acode",
"description": "Powerful code editor and terminal for IOS and Android",
Expand Down
6 changes: 6 additions & 0 deletions platforms/android/app/src/free/java/app/acode/ads/AdMob.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class AdMob : Service() {
Actions.AD_IS_LOADED to ::executeAdIsLoaded,
Actions.AD_LOAD to ::executeAdLoad,
Actions.AD_SHOW to ::executeAdShow,
Actions.AD_RECOVER_PRESENTATION to ::executeAdRecoverPresentation,
Actions.AD_HIDE to ::executeAdHide,
Actions.PRIVACY_GATHER_CONSENT to privacy::gatherConsent,
Actions.PRIVACY_GET_STATE to privacy::getState,
Expand Down Expand Up @@ -177,6 +178,11 @@ class AdMob : Service() {
}
}

private fun executeAdRecoverPresentation(ctx: ExecuteContext) {
val id = ctx.optId() ?: return ctx.reject("id is required")
activity.runOnUiThread { ctx.resolve(recoverAdPresentation(activity, id)) }
}

private fun executeAdHide(ctx: ExecuteContext) {
host!!.activity.runOnUiThread {
ctx.optAdOrReject()?.hide(ctx)
Expand Down
18 changes: 18 additions & 0 deletions platforms/android/app/src/free/java/app/acode/ads/AdRecovery.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package app.acode.ads

import android.app.Activity
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import app.acode.ads.ads.Rewarded

internal fun recoverAdPresentation(activity: Activity, id: String): Boolean {
val lifecycle = (activity as? LifecycleOwner)?.lifecycle ?: return false
if (!lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED) ||
!activity.hasWindowFocus() || activity.isFinishing || activity.isDestroyed
) return false
// AdActivity (or an external ad destination) must no longer own the foreground.
val ad = ads[id] ?: return true
if (ad !is Rewarded) return false
ad.onDestroy()
return true
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
// AdMob Plus protocol constants, maintained locally for Acode bridge extensions.
package app.acode.ads

object Actions {
Expand All @@ -8,6 +8,7 @@ object Actions {
const val AD_IS_LOADED = "adIsLoaded"
const val AD_LOAD = "adLoad"
const val AD_SHOW = "adShow"
const val AD_RECOVER_PRESENTATION = "adRecoverPresentation"
const val BANNER_CONFIG = "bannerConfig"
const val CONFIGURE = "configure"
const val PRIVACY_GATHER_CONSENT = "privacyGatherConsent"
Expand Down
Loading
Loading