goodm4ven / nativephp-muttasiq-patches
Internal NativePHP Mobile Android build patches used by Muttasiq.
Package info
github.com/GoodM4ven/NATIVE_PLUGIN_muttasiq-patches
Type:nativephp-plugin
pkg:composer/goodm4ven/nativephp-muttasiq-patches
Requires
- php: ^8.2
- nativephp/mobile: ^3.0
README
بسم الله الرحمن الرحيمNativePHP Muttasiq Patches
An internal package for Muttasiq that applies the NativePHP build patches required on top of nativephp/mobile during Android and iOS builds.
This package is not meant to be a broad, general-purpose plugin. It is a small compatibility layer for Muttasiq that replaces manual patch scripts with an official NativePHP plugin hook.
Objectives
- Applies the required
EDGEpatches innativephp/mobileso empty navigation components are not rendered and nested native component trees are preserved correctly. - Patches
MainActivity.ktto improve system bars,safe-areainjection, native back handling, and WebView state behavior. - Patches
WebViewManager.ktto install early request capture forLivewireandFilament, avoiding lost request bodies caused by late JavaScript injection. - Patches
LaravelEnvironment.ktbundle extraction to stream ZIP entries directly to disk (instead of buffering large files in memory), preventing first-launchOutOfMemoryErrorduring Laravel bundle extraction. - Patches iOS
ContentView.swiftto keep Muttasiq's edge-swipe back handling aligned with the app's in-web navigation behavior, while warning if upstream system UI layout expectations change. - Runs as a NativePHP
pre_compilehook, so separate shell patch scripts are no longer needed during builds.
Patches
native-edge: patchesTopBar,BottomNav, andEdgeinternals.native-system-ui: patchesMainActivity.ktfor system bars,safe-area, first-launch reload behavior, and disabled WebView state saving.native-back-handler: upgrades native back button delegation so it can cooperate with the app's navigation logic.native-google-reviews: applies the app-specific Google review handling adjustments inside the activity.native-request-capture: installs reliable early interception forLivewireandFilamentrequests.native-bundle-extract: patchesLaravelEnvironment.ktunzip behavior to use streaming extraction with ZIP slip protection.native-ios-system-ui: verifies the upstream iOS layout structure still exposes the top and bottom native chrome that Muttasiq expects.native-ios-back: patchesContentView.swiftso the native left-edge gesture delegates to the app's web back action before falling back to WebView history.
Installation
composer require goodm4ven/nativephp-muttasiq-patches php artisan vendor:publish --tag=nativephp-plugins-provider --no-interaction php artisan native:plugin:register goodm4ven/nativephp-muttasiq-patches --no-interaction
Usage
This package does not expose a Facade, bridge functions, or native events for app-level consumption. It is a build-time plugin only.
Once registered, NativePHP will invoke the following dispatcher automatically during builds:
php artisan nativephp:muttasiq:patches
That dispatcher is wired through the pre_compile hook declared in nativephp.json, and forwards to the platform-specific commands:
php artisan nativephp:muttasiq:patches-android php artisan nativephp:muttasiq:patches-ios
Development
If you are developing this package locally alongside the main app, wire it into the project as a path repository or local Composer dependency, then rebuild the native project you need:
php artisan native:install android --force --no-interaction php artisan native:run android
php artisan native:install ios --force --no-interaction php artisan native:run ios
Note
Internal package: this package was written primarily for Muttasiq. It may still be reusable elsewhere, but its assumptions currently follow this app's engine behavior and integration constraints.
License
This package is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-only). See LICENSE.