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
{{ message }}
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.
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:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: