Skip to content

fix(setup): skip admob plugin for paid apk builds#2118

Merged
UnschooledGamer merged 2 commits into
Acode-Foundation:mainfrom
bajrangCoder:fix/normal-setup-skip-admob
May 21, 2026
Merged

fix(setup): skip admob plugin for paid apk builds#2118
UnschooledGamer merged 2 commits into
Acode-Foundation:mainfrom
bajrangCoder:fix/normal-setup-skip-admob

Conversation

@bajrangCoder
Copy link
Copy Markdown
Member

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 19, 2026

Greptile Summary

This PR adds a isPaidVersion() helper to utils/setup.js that reads the widget ID from config.xml and skips installing the admob Cordova plugin when the build matches the paid app ID (com.foxdebug.acode). The previous reviewer concerns — unhandled readFileSync exceptions and single-quote regex support — are fully addressed in this revision.

  • utils/setup.js: New isPaidVersion() reads config.xml with a try-catch and a descriptive error; regex now accepts both single- and double-quoted id attributes; shouldSkipAdmob gates admob installation in the plugin loop.
  • bun.lock: Adds the proot plugin as a workspace dependency, which appears unrelated to the admob/paid-build change.

Confidence Score: 5/5

The change is safe to merge; the admob-skip logic is straightforward and the failure path (missing config.xml) surfaces a clear error rather than silently misbehaving.

The core logic — read widget ID, compare against a constant, gate plugin installation — is simple and correctly implemented. All three issues raised in prior review rounds are resolved. The only remaining notes are a minor regex strictness opportunity and an unrelated lock-file entry, neither of which affects correctness.

No files require special attention; the unrelated proot entry in bun.lock is worth a quick confirmation from the author but poses no risk.

Important Files Changed

Filename Overview
utils/setup.js Adds isPaidVersion() helper that reads config.xml widget ID to conditionally skip admob plugin installation; previous reviewer concerns about exception handling and single-quote regex are addressed.
bun.lock Adds proot plugin entry to the lock file; appears unrelated to the stated admob/paid-build fix.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[setup.js starts] --> B[installDependencies]
    B --> C[cordova platform add android]
    C --> D[cordova plugin add buildinfo / device / file]
    D --> E[isPaidVersion]
    E --> F[readFileSync config.xml]
    F -->|file missing| G[throw descriptive Error]
    F -->|file read| H[regex match widget id]
    H -->|id == com.foxdebug.acode| I[shouldSkipAdmob = true]
    H -->|id != com.foxdebug.acode or no match| J[shouldSkipAdmob = false]
    I --> K[iterate src/plugins]
    J --> K
    K -->|plugin == admob AND shouldSkipAdmob| L[skip admob]
    K -->|other plugins| M[cordova plugin add plugin]
    L --> N[done]
    M --> N
Loading

Reviews (3): Last reviewed commit: "fix" | Re-trigger Greptile

Comment thread utils/setup.js
Comment thread utils/setup.js Outdated
@UnschooledGamer

This comment has been minimized.

Comment thread utils/setup.js
@UnschooledGamer UnschooledGamer changed the title fix(setup): skip admob plugin for normal builds fix(setup): skip admob plugin for paid apk builds May 21, 2026
@UnschooledGamer

This comment has been minimized.

@greptile-apps

This comment has been minimized.

@UnschooledGamer
Copy link
Copy Markdown
Member

@greptile review again

@UnschooledGamer UnschooledGamer merged commit c810172 into Acode-Foundation:main May 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants