Skip to content

Releases: mgks/Android-SmartWebView

Smart WebView 8.0.3

04 Jan 20:14
0062355

Choose a tag to compare

What's Changed

  • Bump qs from 6.14.0 to 6.14.1 in /docmd in #365
  • Bump the all-actions group with 3 updates in #363
  • Bump the all-dependencies group with 3 updates in #364

Full Changelog: 8.0.2...8.0.3

Smart WebView 8.0.2 (Critical Stability Fix)

17 Dec 07:06

Choose a tag to compare

This patch addresses a startup crash affecting users who have not configured Firebase Cloud Messaging.

🐞 Fixes

  • Fixed Startup Crash: Resolved a Fatal Exception that occurred if google-services.json was missing. The app now defensively checks for Firebase availability and gracefully skips initialization if not configured, preventing the IllegalStateException.
  • True Optional FCM: Firebase Cloud Messaging is now strictly optional; the app runs smoothly out-of-the-box without requiring any Google Service configuration files.

Full Changelog: 8.0.1...8.0.2

Smart WebView 8.0.1 (Polish & Stability Patch)

08 Dec 09:17

Choose a tag to compare

Following the major v8.0.0 release, this patch addresses a critical crash on startup and finalizes the documentation and code cleanup to ensure the "Legacy" edition is robust and accurate.

🐞 Critical Fixes

  • Fixed QR Scanner Crash: Resolved a Fatal Exception caused by the QRScannerPlugin attempting to register lifecycle callbacks too late during app startup.
  • Modernized Camera API: Migrated the QR Scanner implementation from the deprecated IntentIntegrator to the modern AndroidX ScanContract, ensuring better compatibility with newer Android versions.

📚 Documentation & Cleanup

  • Docs Overhaul: Updated all documentation files to correctly reference swv.properties as the single source of truth for configuration, removing obsolete references to SmartWebView.java.
  • Code Cleanup: Filtered and removed legacy comments, old labels, and redundant code to leave the codebase clean for future maintainers.
  • UI Polish: Removed residual "Premium" labeling and upsell links from the Playground and Demo pages to reflect the fully open-source nature of the project.

Full Changelog: 8.0.0...8.0.1

Smart WebView 8.0.0 🌟 (The Legacy Release)

02 Dec 16:11

Choose a tag to compare

This is a landmark release and a personal one for me. After nearly a decade of development, I am thrilled to announce that all premium plugins are now free, open-source, and included directly in the project. This is my thank you to the incredible community that has supported Smart WebView over the years.

With this version, the project reaches what I consider its complete and final form. The world of development moves incredibly fast, and it's time to embrace the new challenges and projects this age has to offer. Therefore, v8.0.0 will be the final major feature release for Smart WebView.

My focus will now shift to ensuring long-term stability through critical bug fixes as they arise. I also hope to carry the project's legacy forward by modularizing its most powerful features into standalone libraries for the broader Android ecosystem.

It's been a great journey. Thank you for being a part of it.

— Ghazi

Major Changes

  • All Plugins Now Open-Source! The entire suite of advanced plugins is now available to everyone:
    • AdMob: Integrate Google AdMob banner, interstitial, and rewarded ads.
    • Biometric Authentication: Secure your app with fingerprint or face unlock.
    • QR & Barcode Reader: Natively scan QR codes and barcodes.
    • Image Compression: Reduce image sizes before uploading to save bandwidth.
    • JS Interface: A powerful two-way bridge for seamless communication between your web app and native Android code.

🚀 New Features

  • Custom CSS Injection: You can now apply a custom stylesheet over your loaded web page. Simply create a custom.css file in app/src/main/assets/web/ and enable feature.custom.css=true in swv.properties to hide elements or tweak styles. (Closes #163)
  • Configurable Back Button Behavior: A new option, behavior.back.exits, has been added to swv.properties. When set to true, the hardware back button will exit the app instead of navigating WebView history. (Closes #358)
  • Third-Party Cookie Support: Added a new security.accept.thirdparty.cookies setting in swv.properties to improve compatibility with services like Google reCAPTCHA and social logins. (Closes #357)

🐞 Bug Fixes & Stability Improvements

  • Optimized App Startup Sequence: Refactored the app's initialization process to prevent blocking the main UI thread. Heavy tasks like loading plugins and services are now deferred, resolving a critical issue where the app could hang on the splash screen and significantly improving startup speed.
  • Fixed: UI Dialog Theming: Dialog button text (on Exit Confirmation and Rating prompts) is now clearly visible in the light theme. (Closes #353, #359)
  • Fixed: User Login Sessions Not Saved: Implemented a critical fix to ensure that user login sessions and other cookies are persistently saved when the app is closed.
  • Improved: Modern QR Scanner API: The QR Scanner plugin has been updated to use the latest, non-deprecated AndroidX Activity Result APIs, improving stability and future-proofing the code.
  • Improved: Splash Screen Documentation: The process for customizing the splash screen and welcome screen logos is now clearer and better documented. (Addresses #360)

Android Smart WebView 7.6 🎉

29 Aug 18:51

Choose a tag to compare

New Features & Enhancements

  • Configurable Screenshot & Recents Privacy: Introduced a new global security feature to block screenshots, screen recordings, and content visibility in the "Recent Apps" switcher.
    • This can be enabled app-wide by setting security.block.screenshots=true in swv.properties. (#335)
    • When the Biometric Plugin is active and the global setting is off, this secure mode is dynamically enabled only during the authentication process, providing the best of both security and user convenience.

🔧 Architectural Enhancements

  • Decoupled Rating Plugin: The RatingPlugin has been made fully self-contained by removing its compile-time dependency on strings.xml. The project will now compile successfully even if the rating-specific strings are removed, making the plugin truly optional.
  • Hardened Biometric & AdMob Plugins: Added null-safe checks to the BiometricPlugin and AdMobPlugin. This prevents the app from crashing at runtime if a user has customized their layouts and removed the views these plugins depend on (e.g., security_overlay or msw_ad_container). Instead of crashing, the plugins will now log an error and gracefully disable the dependent feature.
  • Modularized Security Flag Control: The logic for managing the window's FLAG_SECURE has been centralized in MainActivity. This allows core app settings and individual plugins to control the security state without conflicts, making the architecture more robust and extensible.

🐞 Bug Fixes & Stability Improvements

  • Fixed: Invisible Dialog Buttons in Light Theme: Resolved a critical theme issue where the "Yes" / "No" buttons in the exit confirmation dialog were invisible (white text on a white background) when the app was in light mode. Dialog buttons now correctly use the app's accent color and are clearly visible in both light and dark themes.

💖 Get Premium Plugins Access

Includes AdMob (Banner, Rewarded, Interstitial), Biometric Auth, QR Scanner, and more — available to monthly sponsors.

Android Smart WebView 7.5 🔐 (Stable)

07 Aug 20:50

Choose a tag to compare

This is a critical security and stability release that addresses several core issues related to the authentication lifecycle, UI theming, and state preservation. We strongly recommend all users update to this version.

Security & Enhancements

This release introduces a major overhaul of the Biometric Authentication plugin to make it more robust and secure against common bypass methods.

  • Hardened Authentication Lifecycle: The app session is now invalidated whenever the app is paused or sent to the background. This ensures that authentication is required every time the app is brought back to the foreground, closing a critical security loophole that previously allowed bypassing the lock on resume.
  • Secure App Snapshot: The main app window is now flagged as secure (FLAG_SECURE). This prevents the app's content from being visible in the "Recent Apps" switcher or in screenshots, protecting sensitive information when the app is in the background.
  • Robust Auth Cancellation: Fixed a critical flaw where tapping outside the system's authentication prompt would minimize the app. The security overlay now correctly persists, forcing the user to either complete authentication or manually exit the app.
  • Guided Security Setup: If a user has no screen lock (PIN, pattern, fingerprint, etc.) enabled on their device, the "Authenticate" button on the security overlay will now correctly redirect them to the Android Security Settings to set one up.

🐞 Bug Fixes & Stability Improvements

  • Fixed: State Loss on Configuration Change: The WebView no longer reloads to the initial URL after a screen rotation. The user's current page, scroll position, and plugin states are now correctly preserved. (Note: The runtime theme toggle has been temporarily disabled to prevent this issue).
  • Fixed: Status Bar Color: Resolved all inconsistencies with the status bar color, ensuring it correctly matches the app theme in both fullscreen and drawer layouts, across light and dark modes.
  • Fixed: Drawer Layout UI: Corrected theme and layout behavior conflicts to ensure the search menu consistently appears and the WebView is correctly positioned below the toolbar when the header is visible.
  • Fixed: Crash with Mock Locations: The app no longer crashes with a SecurityException when "Allow mock locations" is enabled in Developer Options.
  • Fixed: Missing Image Resource: Resolved a layout inflation error caused by references to a non-existent @raw/front_splash resource. Layouts now use a valid fallback drawable, ensuring splash screens and headers render correctly.
  • Fixed: Menu Crash: Patched a StackOverflowError that would occur if a menu item was selected due to an incorrect recursive call.

🔧 Under the Hood

  • Plugin Lifecycle Enhancement: The PluginInterface and PluginManager have been updated to support the onPause() lifecycle event, allowing plugins to perform actions when the app is backgrounded. This was a necessary change to enable the new security features.
  • Modernized UI Implementation: Refactored the entire theme and layout system to correctly use modern Material Components and handle window insets, providing a stable and consistent UI across all app configurations.

💖 Get Premium Plugins Access

Includes AdMob (Banner, Rewarded, Interstitial), Biometric Auth, QR Scanner, and more — available to monthly sponsors.

Android Smart WebView 7.4 🎉 (Major Release)

15 Jul 12:23

Choose a tag to compare

This release marks a major architectural leap forward, focusing on making Smart WebView dramatically easier to configure, more modular, and exceptionally stable. The introduction of a central configuration file simplifies setup to a single file, while a complete overhaul of internal logic and state management resolves numerous potential memory leaks and race conditions.

🚀 Architectural Overhaul

  • True Centralized Configuration (swv.properties):

    • New: All build-time and runtime configurations have been unified into a single file: app/src/main/assets/swv.properties. Users can now control App ID, versioning, SDK targets, URLs, and all feature toggles from one place, without ever touching a Gradle or Java file.
    • Benefit: This dramatically simplifies setup for new users, making the project accessible even to those unfamiliar with native Android development.
  • Robust State Management (Memory Leak Fix):

    • CRITICAL: Refactored all state management to eliminate the use of static Activity or View contexts. This resolves a major potential memory leak that could cause crashes on screen rotation or after prolonged use.
    • New: The PluginManager now acts as a lifecycle-aware singleton, safely holding and providing access to the Activity and WebView context.
  • Core Features Reimagined as Plugins:

    • New: Location, Rating, and Dialog functionalities have been completely re-implemented as standard, modular plugins (LocationPlugin, RatingPlugin, DialogPlugin).
    • Benefit: This decouples them from the MainActivity and Functions classes, making the core codebase cleaner and the features consistently managed through the standard plugin pipeline.

New Features & Enhancements

  • Modern JavaScript Interfaces:

    • New LocationPlugin: Replaces the old cookie-based location sharing with a modern, callback-based JavaScript interface (window.SWVLocation.getCurrentPosition(...)) for more reliable, on-demand location fetching.
    • New DialogPlugin: Introduces a generic, highly configurable interface (window.Dialog.show(...)) for triggering native alert dialogs directly from your web content.
  • Dynamic Theming Engine:

    • The app now automatically detects the system's Light/Dark mode on launch.
    • A theme switch in the navigation drawer allows manual toggling.
    • A robust, two-way communication bridge ensures the native UI and web content themes stay perfectly in sync.
  • Configurable UI Elements:

    • Drawer Header: The top header/toolbar can be completely hidden via the ui.drawer.header property for a true fullscreen experience.
    • Splash Screen: The ui.splash.extend property allows the splash screen to persist until the web page is fully rendered, eliminating white flashes or loading screens.

🐞 Bug Fixes & Stability Improvements

  • CRITICAL: Fixed App-Breaking Crashes:

    • Resolved AdMob Startup Crash: Implemented the standard, most reliable method for providing the AdMob Application ID via a dedicated resource file, fixing a common startup crash.
    • Resolved Unhandled URL Scheme Crash: The app no longer crashes when encountering an unknown or legacy custom URL scheme (like getloc:), instead logging the error gracefully.
  • UI Fixes:

    • Status Bar Control: Fixed a critical bug where the WebView would draw under the system status bar. The status bar now correctly displays a solid color with appropriate light/dark icons, respecting the app's theme.
    • Drawer and Refresh Layout: Fixed a bug where the pull-to-refresh gesture conflicted with opening the navigation drawer.
  • Plugin & JS Interface Reliability:

    • Fixed window.Location Conflict: The Location plugin's JavaScript object was renamed to window.SWVLocation to resolve a critical conflict with the browser's native window.location object, making the feature functional on all websites.
    • Playground UI Fixed: Resolved a JavaScript syntax error and a race condition that prevented the Playground UI from appearing or caused it to disappear on page reloads.

🛠️ Code & Architectural Improvements

  • Decoupled & Organized Code:
    • Removed all hardcoded feature logic (location, ratings) from Functions.java and MainActivity.java, migrating it into the new plugin system.
    • Refactored redundant XML layouts into reusable <include> blocks.
    • Standardized plugin header comments for improved developer experience.
  • Optimized Launch Sequence: The app now initializes via a custom Application class (SWVContext$App), ensuring all configurations are loaded at the earliest possible moment to prevent race conditions.

💖 Get Premium Plugins Access

Includes AdMob (Banner, Rewarded, Interstitial), Biometric Auth, QR Scanner, and more — available to monthly sponsors.

Android Smart WebView 7.3 🎉

09 Jul 23:03

Choose a tag to compare

This release focuses on significant stability improvements, bug fixes, and internal code quality enhancements. We've addressed several long-standing issues reported by the community, making the project more robust and easier to maintain.

A big thank you to our contributors and users for their detailed feedback which made these improvements possible!

✨ New Features & Enhancements

  • Centralized Navigation Configuration: The navigation drawer's menu items are now configured entirely within SmartWebView.java using the new ASWV_DRAWER_MENU map. This separates configuration from logic, making it safer and easier for developers to customize menu links without touching MainActivity.
  • Dynamic Version Handling: The app version (ASWV_VERSION) is no longer a hardcoded string. It is now dynamically pulled from the versionName in build.gradle, ensuring the version reported by plugins is always accurate and managed from a single source of truth. The redundant static variable has been removed.
  • Robust Offline & Error Handling: The app now provides a much more user-friendly experience when network connectivity is lost. Instead of showing a generic browser error, the WebView will now gracefully redirect to the custom offline page (offline.html), preventing the user from getting stuck.

🐞 Bug Fixes

  • Fixed: Navigation Drawer Crash/Failure (#330, #296)
    • The navigation drawer menu (ASWV_LAYOUT = 1) is now fully functional. The logic has been moved from the utility Functions class into MainActivity, resolving the context-related bug that previously caused crashes or silent failures.
  • Fixed: Pull-to-Refresh Conflict (#156)
    • Resolved an issue where the pull-to-refresh gesture would interfere with scrolling inside dropdowns (<select>) or other scrollable elements at the top of the page. The refresh layout is now only enabled when the main WebView is scrolled to the very top.
  • Fixed: Biometric Plugin Initialization Crash (#app-crash-log)
    • Corrected an IllegalArgumentException in the BiometricPlugin that caused the app to crash on startup. The biometric prompt is now initialized correctly.
  • Fixed: Action Bar Menu (onCreateOptionsMenu)
    • The top action bar menu (containing search and exit options for the drawer layout) was previously non-functional. The logic has been moved to MainActivity, making the menu fully operational.
  • Resolved: Persistent Error Loop (#208)
    • The old, unreliable onReceivedError callback has been replaced with modern error handling. This eliminates the "Something Went Wrong!" toast and the page refresh loop that could previously make the app unusable.

🛠️ Code Quality & Maintenance

  • Refactored UI Event Handling: All UI-specific logic for menus (onNavigationItemSelected, onCreateOptionsMenu) has been moved from the Functions.java utility class into MainActivity.java, adhering to better Android development practices.
  • Enabled Service Worker Support (#147): The necessary ServiceWorkerClient is now initialized, enabling full support for web pages that use service workers for performance and offline caching.
  • Redundancy Removed: Cleaned up the codebase by removing the now-unnecessary ASWV_VERSION static variable, simplifying the project.

This update makes Smart WebView a more stable and developer-friendly foundation for your hybrid Android apps. As always, we welcome your feedback and contributions on our GitHub Discussions page.

💖 Premium plugins available for sponsors – Support the project

Android Smart WebView 7.2 🎉 (New UI)

07 Jul 22:45

Choose a tag to compare

This release focuses on architectural robustness, security enhancements, and developer experience improvements.

✨ New Features & Enhancements

  • Dynamic Plugin Loader: Implemented a fail-safe mechanism to dynamically discover and load plugins at runtime. The app no longer has hardcoded dependencies on premium plugins and will not crash if they are missing.
  • Secure Biometric Auth: The Biometric Authentication plugin is now a non-bypassable security gate.
    • The authentication prompt can no longer be dismissed by tapping outside of it.
    • A persistent security overlay blocks the app content until authentication is successful.
    • A "Retry" button is provided for a better user experience on auth failure.
    • The security lock is re-enforced when the app is resumed from the background, closing a major loophole.
  • Improved Playground UI: The plugin test UI is now a floating, collapsible panel that injects into any webpage without relying on the page's structure. It intelligently disables buttons for premium plugins that are not present.
  • Refined File Chooser: The intent for file uploads now correctly respects the accept attribute (e.g., image/* vs. video/*) when presenting camera/camcorder options to the user.
  • Updated Demo Page: The offline.html / index.html demo page has been redesigned with a modern, clean UI.

🐛 Bug Fixes

  • [Fixed] Biometric Auth on Launch: Fixed a persistent and critical bug where biometric authentication would not trigger on app launch even when configured to do so. The new implementation is robust and correctly timed with the app's lifecycle.
  • [Fixed] External Link Crash: Fixed a crash that occurred when opening external links due to an incorrect Context being used.
  • [Improved] Pull-to-Refresh: The pull-to-refresh gesture now correctly reloads the currently viewed page instead of reverting to the initial app URL.
  • [Improved] Silent Diagnostics: Diagnostic tests that run on app launch (in debug mode) are now silent and log to the console instead of showing disruptive alert() pop-ups.
  • [Fixed] Build System: Resolved build errors related to duplicate classes and abstract method implementations that occurred during refactoring.

Android Smart WebView 7.1 🎉 (Plugins Release)

26 Jun 19:44
383fc84

Choose a tag to compare

This is a landmark release for Smart WebView! Version 7.1 introduces a powerful and flexible plugin architecture, transforming Smart WebView from a simple web wrapper into an extensible foundation for building advanced hybrid applications.

This new system allows developers to add complex native features as modular, self-contained units without altering the core project code. This makes customization easier, updates cleaner, and opens the door for a new ecosystem of premium, high-value features.

✨ What's New: The Plugin Architecture

The core of this update is a new set of components designed for maximum extensibility:

🔌 Plugin Manager (PluginManager.java): A central hub that handles the registration, initialization, and lifecycle of all active plugins. It ensures that plugins have safe access to the app's context and WebView instance.

🧩 Standardized Interface (PluginInterface.java): A clear contract that all plugins must implement. It defines essential methods for initialization, event handling (onActivityResult, onRequestPermissionsResult), and WebView interaction (shouldOverrideUrlLoading, onPageFinished).

🚀 Self-Registration: Plugins are now self-registering. By simply including a plugin's source file in the project, its static initializer block automatically registers it with the PluginManager on app startup.

🧪 The Playground (Playground.java): A dedicated class for developers to test, configure, and debug plugins in a sandboxed environment. It includes fail-safe diagnostic tools and a method for injecting a demo UI into the WebView for easy manual testing.

⚙️ Centralized Configuration: Plugins can now be enabled or disabled globally (ASWP_PLUGINS) or individually via the ASWP_PLUGIN_SETTINGS map in SmartWebView.java. This allows for fine-grained control over which features are active.

Example Plugin Included

🍞 ToastPlugin: To demonstrate the new architecture and provide a template for developers, a simple ToastPlugin is included in the open-source project. It shows how to create a plugin, implement the interface, register it, and create a JavaScript bridge.

💎 Premium Plugins Now Available

This new architecture enables us to offer a suite of powerful, ready-to-use premium plugins for GitHub Sponsors. These are designed to drop into your project and work with minimal setup:

  • AdMob: Easily integrate banner, interstitial, and rewarded video ads.
  • Biometric Authentication: Secure your app with fingerprint or face unlock.
  • QR/Barcode Scanner: Add in-app code scanning using the device camera.
  • Image Compression: Automatically compress images before uploading to save bandwidth.
  • JS Bridge: A more robust two-way communication bridge between native code and JavaScript.

🐛 Fixes & Improvements

This release also includes several important fixes and modernizations:

  • [Fixed] File Upload Callback: Resolved a critical issue where the file chooser callback (asw_file_path) could be lost, preventing file uploads from completing. The entire file handling logic has been modernized to use the ActivityResultLauncher, making it more reliable and removing deprecated startActivityForResult calls.
  • [Fixed] FCM Notification Clicks: Corrected an issue where tapping a notification might not properly open the specified URL. The intent handling for notifications is now more robust.
  • [Fixed] Location Service Stability: Improved the GPS tracking logic in GPSTrack.java to handle cases where a location provider is unavailable, preventing potential null pointer exceptions.
  • [Improved] Permission Handling: Refactored permission requests to be more streamlined and context-aware, especially for file and camera access on modern Android versions.
  • [Improved] URL Handling: The logic for distinguishing internal vs. external URLs (aswm_host) has been refined for better accuracy.
  • [Improved] Code Modernization: Updated various parts of the codebase to use modern Android practices, including stricter type checking, better error logging, and improved resource management. The project now targets Android 14 (SDK 35).

For Developers

  • To create your own plugin, simply create a new class that implements PluginInterface and add a static block for self-registration. See ToastPlugin.java for a complete example.
  • The Playground.java class is the best place to start for testing your new plugins. Add your plugin to the diagnostic checks and the demo UI.
  • All plugins are disabled by default if the global ASWP_PLUGINS flag is set to false. You can also toggle individual plugins in the ASWP_PLUGIN_SETTINGS map.

A massive thank you to our community and sponsors for making this evolution possible. We're excited to see what you build with the new plugin system.