Skip to content

Releases: mgks/Android-SmartWebView

Android Smart WebView 7.6 🎉

29 Aug 18:51
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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.

Android Smart WebView 7.0 🎉 (Major Release)

03 Jan 11:06
Compare
Choose a tag to compare

Smart WebView v7.0 empowers developers to build even more dynamic and feature-rich hybrid applications. This release focuses on extensibility with a new plugin architecture, alongside improvements to core functionalities. Users will benefit from enhanced performance, streamlined file handling, and other capabilities. The update reflects a commitment to providing a versatile and efficient platform for app development.

Changelog

Major Features and Enhancements:

  • Plugin Architecture:
    • Introduced a new, self-contained plugin architecture enabling developers to extend Smart WebView's functionality without modifying core files.
    • Plugins can register themselves and handle their own lifecycles, permissions, and activity results.
  • File Uploads and Camera Access:
    • Refactored file upload and camera access logic into a dedicated FileProcessing class for improved code organization.
    • Dynamically handles file MIME types based on HTML input accept attributes.
    • Enhanced error handling and user feedback during file selection and camera operations.
  • Firebase Cloud Messaging (FCM):
    • Updated FCM implementation to use the latest Firebase SDK.
    • Resolved issues with token retrieval and onNewToken() not being called.
  • Google Analytics (gtag.js):
    • Dynamically injects the gtag.js script after page load to prevent interference with page loading and improve performance.
  • Permissions:
    • Refactored permission handling to request permissions on demand only when needed.
    • Added support for granular media permissions and the POST_NOTIFICATIONS permission for Android 13 and above.
    • Implemented rationale dialogs for explaining permission requests to the user.
  • Security:
    • Enforced HTTPS by default and optional to disable certificate verification with alert toast in debug mode.
    • Removed the deprecated WRITE_EXTERNAL_STORAGE permission, relying on Scoped Storage for file access.

Other Improvements and Updates:

  • Modernized Codebase:
    • Updated project to target Android 14 (API level 35) and use the latest AndroidX libraries.
    • Adopted Java 17 source and target compatibility.
    • Refactored code for better modularity, readability, and maintainability.
  • Dependency Management:
    • Updated all dependencies to their latest versions.
    • Removed deprecated Firebase dependencies.
  • Bug Fixes:
    • Fixed an issue where the welcome screen would not disappear in certain scenarios.
    • Resolved several issues related to file uploads and camera access.
    • Addressed potential NullPointerExceptions related to context handling in Firebase.
  • Code Cleanup:
    • Removed unused code, variables, and functions.
    • Improved comments and documentation.

API Changes:

  • PluginInterface: Introduced a new PluginInterface with methods for plugin initialization, event handling, and simplified interaction with the WebView.
  • PluginManager: Added a PluginManager class to handle plugin registration, lifecycle events, and communication with plugins.
  • FileProcessing: Added a FileProcessing class to encapsulate file upload and camera access logic.
  • Functions: Removed several methods related to printing, cookies, orientation, file access, permissions, ratings, FCM, and device info. These are either handled elsewhere or no longer needed.
  • SmartWebView: Removed or modified several variables related to configuration, user agent, and permissions, and added variables related to debugging and Google Tag. Also, removed ASWP_OFFLINE logic.
  • MainActivity: Refactored to use the PluginManager and FileProcessing classes. Modified onShowFileChooser(), Callback class, shouldOverrideUrlLoading(), onPageFinished(), onRequestPermissionsResult() and onActivityResult(). Removed unused methods and variables related to permissions and other features now handled by plugins or other classes.
  • Firebase: Refactored to improve context handling, remove unnecessary constructor, and simplify notification handling logic.

New Files:

  • MetaPull.java: Pulls device and SWV release details.
  • FileProcessing.java: Handles file upload and camera access.
  • PluginManager.java: Manages the plugin architecture.
  • PluginInterface.java: Defines the interface for plugins.

Testing:

  • Thoroughly test all features on a variety of devices and Android versions (especially API levels 23, 24, 29 and above) to ensure compatibility and proper functionality.

Migration from v6.x:

  • Developers who have created custom features (now plugins) for Smart WebView v6.x can update their scripts to plugins to conform to the new PluginInterface and register them using the PluginManager.
  • Any code that directly interacted with the removed methods or variables in MainActivity, Functions, or SmartWebView will need to be updated to use the new plugin architecture or the appropriate classes (e.g., FileProcessing and PluginManager).

Android Smart WebView 6.0 (p_0.2) (minor release)

12 Apr 14:26
Compare
Choose a tag to compare

Features Updated:

- Exit Dialog
- Manual Webpage Printing

Change Log:

- Target SDK: API 33 (Android 13)
- Gradle Version Update to 7.4.2
- File Upload Fixed
- Camera Rotation Fixed
- Other Minor Bug Fixes

Report your issues here.

If you liked the project and want to support, feel free to Sponsor me on GitHub :)

Android Smart WebView 5.0 (p_0.1)

15 Sep 13:07
597d8c4
Compare
Choose a tag to compare

This release comes with an interesting news for SWV project followers.

Android Smart WebView p_0.1 is part of the new pro merger channel.
So SWV Pro is now a part of SWV's Official Open Source Project; free for everyone to explore.

Let's talk about features included:

- Live GPS Location Tracking
- File Upload
- Camera Photo Processing
- Firebase Push Notifications
- Google AdMob
- Chromium Tab
- Handling Data Sharing
- Rating System
- Switch Navigation Interface w/ Drawer and Search Bar
- Action Menu
- Ability to add Official SWV Plugins

Change Log:

- Target SDK: API 29 (Android 10)
- New release channel
- Gradle plugin 3.5
- Gradle version 5.5
- Introducing new variable ASWV_EXC_LIST (not active till next release)
- Pullfresh bug fix
- Multi-file upload improvement/fix
- Other minor bug fixes

Report your issues here.

If you liked the project and want to support, feel free to Donate :)

Android Smart WebView 4.0

20 Jun 08:02
Compare
Choose a tag to compare

Android Smart WebView 4.0 comes with certain major changes that will change the course of whole project in coming future. Android support libraries are now replaced with Androidx, Min. SDK requirement changed from 19+ to 21+ and target from 28 to 29 (Android Q).

UPDATE: Few months back I developed SWV Pro to help this repo keep updated with some additional features; but it's tough for me to keep two different variants from same project updated. So I've decided to merger two once 15 copies sold. I hope to get support from you guys making this project better, we've already come so far.

Let's make the best webview there is :)

Update Log:

- Android support library removed to implement Androidx
- Gradle updated
- Min. SDK changed to 21+
- Target version is API 29 (Android Q) now
- No connection/Error page fail-safe created
- Front page updated

Post your issues here.