You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lack of Offline Support: The existing Android application requires an active internet connection to function, preventing users from accessing core features when offline.
CORS (Cross-Origin Resource Sharing) Issues: The app encounters CORS-related problems, limiting its ability to interact securely with local or self-hosted resources.
Security Concerns: There are significant security vulnerabilities related to network hijacking, which could lead to data breaches or unauthorized access if the app relies solely on external servers without proper safeguards.
Objective:
Enable Offline Functionality: Allow users to utilize the Android app's core features without needing an internet connection, enhancing accessibility and reliability.
Resolve CORS Issues: Configure WebView appropriately to eliminate CORS-related problems, ensuring secure and flexible interactions with various resources.
Enhance Security: Implement measures to prevent network hijacking and other security threats, ensuring that data interactions remain secure even when offline.
User Experience:
Enhanced Accessibility: Users can now access and use the app's functionalities even without an internet connection, making the app more reliable and user-friendly.
Seamless Experience for Existing Users: Existing users upgrading from older versions will continue using the app without any disruptions, maintaining data integrity and consistent functionality.
Offline Mode for New Installations: New installations will have offline capabilities enabled by default, allowing users to work without constant internet access.
Future Migration Plans: While the new offline solution is available for fresh installations, plans are in place to develop migration strategies to transition existing users to the new offline mode without affecting their current usage.
Technical Changes:
Introduced Capacitor:
Reasoning: Compared to Cordova, Capacitor offers better performance, a more modern architecture, and easier integration with native platforms. Capacitor provides a more robust bridge for web-native interactions, enhancing the app's capabilities and maintainability.
Added CapacitorMainActivity:
Purpose: Isolates the new Capacitor-based implementation from the existing FullscreenActivity, preventing mutual interference and ensuring stable operation for both new and existing users.
Introduced LaunchDecider Class:
Purpose: Manages the app's launch behavior based on whether the user performed a fresh installation or upgraded from a previous version.
Functionality: Utilizes SharedPreferences, PackageInfo, and file existence checks to determine the appropriate launch mode (MODE_ONLINE for existing users and MODE_OFFLINE for new installations).
Implementation: Ensures that users are directed to the correct activity (FullscreenActivity or CapacitorMainActivity) based on their installation status.
Extracted WebViewRequestHandler:
Purpose: Centralizes the handling of WebView requests, including URL loading and request interception, to avoid code duplication across activities.
Functionality: Manages both shouldOverrideUrlLoading and shouldInterceptRequest methods, ensuring consistent behavior and streamlined request processing.
Updated AndroidManifest.xml:
Configuration: Set FullscreenActivity as the default launcher activity and declared CapacitorMainActivity appropriately without a launcher intent filter.
Intent Handling: Ensured that FullscreenActivity manages the transition to CapacitorMainActivity based on the launch decision logic.
Refactored FullscreenActivity:
Integration: Incorporated LaunchDecider to determine the appropriate activity to launch during onCreate.
Stability Fix: Added checks to prevent wvContainer from causing crashes by verifying its initialization before attempting to remove views in onDestroy.
Progress:
Development Progress: 100% completed. The primary functionalities for offline support and CORS resolution have been implemented. See:
I have taken steps to address the longstanding issues related to offline support and CORS in the Android application. These updates are designed to enhance the user experience by enabling offline functionality, resolving security-related CORS issues, and ensuring a smooth transition for existing users. I welcome any questions or feedback from the community to help refine and improve the solution further.
The text was updated successfully, but these errors were encountered:
Thank you very much for opening up this issue! I am currently a bit overwhelmed by the many requests that arrive each week, so please forgive me, if I fail to respond personally. I am still very likely to at least skim read your request and I'll probably try to fix all (real) bugs if possible and I will likely review every single PR being made (please, give me a heads up if you intent to do so) and I will try to work on popular requests (please upvote via thumbs up on the original issue) whenever possible, but trying to respond to every single issue over the last years has been kind of draining and I need to adjust my approach for this project to remain fun for me and to make any progress with actually coding new stuff. Thanks for your understanding!
Problem:
Lack of Offline Support: The existing Android application requires an active internet connection to function, preventing users from accessing core features when offline.
CORS (Cross-Origin Resource Sharing) Issues: The app encounters CORS-related problems, limiting its ability to interact securely with local or self-hosted resources.
Security Concerns: There are significant security vulnerabilities related to network hijacking, which could lead to data breaches or unauthorized access if the app relies solely on external servers without proper safeguards.
Objective:
Enable Offline Functionality: Allow users to utilize the Android app's core features without needing an internet connection, enhancing accessibility and reliability.
Resolve CORS Issues: Configure WebView appropriately to eliminate CORS-related problems, ensuring secure and flexible interactions with various resources.
Enhance Security: Implement measures to prevent network hijacking and other security threats, ensuring that data interactions remain secure even when offline.
User Experience:
Enhanced Accessibility: Users can now access and use the app's functionalities even without an internet connection, making the app more reliable and user-friendly.
Seamless Experience for Existing Users: Existing users upgrading from older versions will continue using the app without any disruptions, maintaining data integrity and consistent functionality.
Offline Mode for New Installations: New installations will have offline capabilities enabled by default, allowing users to work without constant internet access.
Future Migration Plans: While the new offline solution is available for fresh installations, plans are in place to develop migration strategies to transition existing users to the new offline mode without affecting their current usage.
Technical Changes:
Introduced Capacitor:
Added
CapacitorMainActivity
:FullscreenActivity
, preventing mutual interference and ensuring stable operation for both new and existing users.Introduced
LaunchDecider
Class:SharedPreferences
,PackageInfo
, and file existence checks to determine the appropriate launch mode (MODE_ONLINE
for existing users andMODE_OFFLINE
for new installations).FullscreenActivity
orCapacitorMainActivity
) based on their installation status.Extracted
WebViewRequestHandler
:shouldOverrideUrlLoading
andshouldInterceptRequest
methods, ensuring consistent behavior and streamlined request processing.Updated
AndroidManifest.xml
:FullscreenActivity
as the default launcher activity and declaredCapacitorMainActivity
appropriately without a launcher intent filter.FullscreenActivity
manages the transition toCapacitorMainActivity
based on the launch decision logic.Refactored
FullscreenActivity
:LaunchDecider
to determine the appropriate activity to launch duringonCreate
.wvContainer
from causing crashes by verifying its initialization before attempting to remove views inonDestroy
.Progress:
Development Progress: 100% completed. The primary functionalities for offline support and CORS resolution have been implemented. See:
Related Issues:
Conclusion:
I have taken steps to address the longstanding issues related to offline support and CORS in the Android application. These updates are designed to enhance the user experience by enabling offline functionality, resolving security-related CORS issues, and ensuring a smooth transition for existing users. I welcome any questions or feedback from the community to help refine and improve the solution further.
The text was updated successfully, but these errors were encountered: