Skip to content

fix: hooks not working on free version#2075

Merged
RohitKushvaha01 merged 3 commits into
Acode-Foundation:ajit/fix-fetch-auth-configfrom
RohitKushvaha01:ajit/fix-fetch-auth-config
Apr 29, 2026
Merged

fix: hooks not working on free version#2075
RohitKushvaha01 merged 3 commits into
Acode-Foundation:ajit/fix-fetch-auth-configfrom
RohitKushvaha01:ajit/fix-fetch-auth-config

Conversation

@RohitKushvaha01
Copy link
Copy Markdown
Member

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 29, 2026

Greptile Summary

This PR fixes the Cordova post-process hooks (enableStaticContext, enableKeyboardWorkaround) that were silently skipping on free-variant builds because the MainActivity.java path was hardcoded to com/foxdebug/acode/. A new getPackageName() helper reads the package name from config.xml at build time and constructs the correct path for any variant. Alongside this, the unretained new SoftInputAssist(activity) call in System.java is removed; SoftInputAssist is now injected into MainActivity by the hook, where the instance is properly held as a field.

Confidence Score: 4/5

Safe to merge; the core fix is correct and only P2 quality issues remain.

The fix correctly addresses the root cause (hardcoded package path), and the System.java change is a sound improvement. Only two P2 findings exist: a slightly fragile id regex and a missing guard that produces a confusing error message when config.xml is absent. Neither affects the happy-path behavior.

hooks/post-process.js — regex and error-handling in getPackageName()

Important Files Changed

Filename Overview
hooks/post-process.js Adds dynamic package-name resolution from config.xml so hooks can locate MainActivity.java for any app variant; minor issues with regex fragility and error-message clarity
src/plugins/system/android/com/foxdebug/system/System.java Removes the unretained new SoftInputAssist(activity) call from the plugin's initialize(); initialization is now injected into MainActivity via the post-process hook, which also stores the instance properly

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[post-process.js runs] --> B[getPackageName]
    B --> C{config.xml exists?}
    C -- Yes --> D[Match widget id attribute]
    C -- No --> E[throw — caught by caller]
    D --> F{Match found?}
    F -- Yes --> G[packageName from config.xml]
    F -- No --> H[fallback: com.foxdebug.acode]
    G & H --> I[Build MainActivity.java path]
    I --> J[enableStaticContext patches MainActivity]
    I --> K[enableKeyboardWorkaround patches MainActivity]
    K --> L[SoftInputAssist injected into onCreate]
    M[System.java initialize] -. removed .-> N[new SoftInputAssist activity]
Loading

Reviews (1): Last reviewed commit: "fix: hooks not working on free version" | Re-trigger Greptile

Comment thread hooks/post-process.js
Comment thread hooks/post-process.js
RohitKushvaha01 and others added 2 commits April 29, 2026 14:53
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@RohitKushvaha01 RohitKushvaha01 merged commit 83b1000 into Acode-Foundation:ajit/fix-fetch-auth-config Apr 29, 2026
6 checks passed
@RohitKushvaha01 RohitKushvaha01 deleted the ajit/fix-fetch-auth-config branch April 29, 2026 09:27
deadlyjack added a commit that referenced this pull request May 11, 2026
* 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>
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.

1 participant