7778 Commits

Author SHA1 Message Date
MohitMali
8c9cdcb6c6 Disabled the universal APK as now we are uploading the dummy bundle for custom apps instead of APK. 2023-10-14 12:48:02 +02:00
MohitMali
8f0d3fff2c We have enabled the universal APK for custom apps because we require this universal APK to create dummy APKs for the Play Store. 2023-10-14 12:48:02 +02:00
MohitMali
11c5b3caa2 Fixed URLConnection not adding headers to the request.
* In this update, we've replaced the `URLConnection` with the OkHttp library, and now headers are being correctly passed in the request. As a result, the Zim file is successfully downloading.
* To integrate OkHttp into our Gradle project, we've moved the OkHttp dependency to our `buildSrc` folder.
2023-10-14 12:48:02 +02:00
Kelson
5e810391f0
Merge pull request #3487 from kiwix/Issue#1602
Reintroduced wifi hotspot feature in custom apps.
2023-10-14 12:47:44 +02:00
MohitMali
ec3095e484 Improved code to show proper error message to the user why the server is failed to start.
* if we run 2 servers at once (if in `app` server is already running then we can not run the server on the `custom` module since we can not run 2 servers on the same IP.) So for this, we have improved our code to show the proper error message so the user will know why the server is not running.
2023-10-14 09:59:39 +02:00
MohitMali
cb73c90bfc Fixed, the book is always unselected on the hosted books screen in custom apps. 2023-10-14 09:59:39 +02:00
MohitMali
8dda3678fb Fixed custom app not displaying Zim information on the Server screen 2023-10-14 09:59:39 +02:00
MohitMali
41be43d292 Fixed ZimHostFragment Open Issue for Both App and Custom Modules.
* We moved our server functionality to the core module to enable its use in both our app and custom modules. However, this change posed a challenge. We had a functionality that, when the user clicks on a notification, it takes them to the hosted book screen. By moving this functionality to the core module, we lost direct access to the navigation graph and `KiwixMainActivity` or `CustomMainActivity`.
* To address this issue, we introduced some abstract variables, such as navGraphId and mainActivity, which we set from both `KiwixMainActivity` and `CustomMainActivity`. This allows us to retrieve the navigation graph ID and the main activity.
* Additionally, we implemented a new function in `CoreApp` to set the currently running `CoreMainActivity`, which we use to obtain the navigation graph ID and main activity to perform the user click on notification.
2023-10-14 09:59:39 +02:00
MohitMali
94d592f545 Reintroduce wifi hotspot feature in custom apps.
* Moved wifi hotspot related files to core module to use hotspot functionality in both app and custom module.
* Moved permission in core manifest to access them in both modules.
* Removed some unnecessary files which is now no longer in use.
2023-10-14 09:59:39 +02:00
Kelson
0b240c6672
Merge pull request #3504 from kiwix/Issue#3426
Fixed, unable to open the support link with default browser.
2023-10-14 09:59:10 +02:00
MohitMali
5e9f183f6a Fixed, unable to open the support link with default browser.
* Fixed, pdf are not opening with default pdf viewer.
* Fixed, sending email are failed with default email service.
* Fixed, opening support link, external urls with default browser.
2023-10-13 18:45:12 +05:30
Kelson
af1cc84e5f
Merge pull request #3501 from kiwix/dwds_publishing_issue
Remove Authentication from URL before downloading.
2023-10-08 07:13:09 +02:00
Gouri Panda
cdd4ce7fae Revert checking the authentication if works 2023-10-08 02:02:35 +05:30
Gouri Panda
0b4b223692 checking the authentication if works 2023-10-08 01:53:14 +05:30
Gouri Panda
852deaf57b changed order of chain request 2023-10-08 01:14:08 +05:30
Gouri Panda
717d593ad3 Fixed the bug that was happening in the ci 2023-10-07 20:05:50 +05:30
MohitMali
3332421c60 Remove Authentication from URL before downloading.
* We have remove the authentication the url to make it normal url because we are adding authentication in headers so does not need to add in url.
* Enhanced getting secret function, if url is encoded then it will fail to get the secret from it so now we are properly decoding the url before extracting the secret key from it.
* To properly test these two functions we have added test cases for it.
2023-10-06 19:08:52 +05:30
Kelson
d399f6fe9f
Merge pull request #3500 from amire80/comma
Improve punctuation in a recently-added message
2023-10-05 16:30:57 +02:00
Amir E. Aharoni
d210cc7ad2 Improve punctuation in a recently-added message 2023-10-05 10:04:54 -04:00
Kelson
03b5f3dfce
Merge pull request #3492 from kiwix/Issue#3491
Fixed, The File transfer feature does not work in android 12, android 13.
2023-10-05 13:01:26 +02:00
MohitMali
51c3ce3d51 Fixed unit coverage 2023-10-05 14:08:24 +05:30
MohitMali
530faa46bb added a test case to evaluate the functionality of LocalFileTransferFragment.
* This test case is designed to verify that the functionality works correctly, especially addressing the issue where `LocalFileTransferFragment` would shut down when attempting to search nearby devices for connection.
2023-10-05 08:14:04 +02:00
MohitMali
e4d27e19a1 Improved code for android 13. 2023-10-05 08:14:04 +02:00
MohitMali
57a95f15d1 Fixed, The File transfer feature does not work in android 12, android 13.
* In Android 13, we previously used `intent.getParcelableArrayExtra` to retrieve the status of `P2P_DEVICE_CHANGED`. However, this method returned null because it's not actually an array. To resolve this issue, we have updated it to use `intent.getParcelableExtra`.
* For Android 12, we used to check the network state through `ConnectivityManager` every time the `WIFI_P2P_CONNECTION_CHANGED_ACTION` action was triggered. However, this approach wasn't reliable, as the action being triggered didn't guarantee a change in the network state. Instead, it sends an intent that we should now check for network changes. As a result, we have modified our code to utilize this intent within the `KiwixWifiP2pBroadcastReceiver`.
2023-10-05 08:14:04 +02:00
Kelson
9edc9d2a96
Merge pull request #3493 from kiwix/dwds_creation
Authentication created for DWDS app
2023-10-04 20:34:03 +02:00
Emmanuel Engelhart
cb20f85915
Fix URL template detection 2023-10-04 20:15:36 +02:00
MohitMali
77f5146d64 Fixed CustomDownloadViewModelTest 2023-10-04 19:17:12 +02:00
MohitMali
e4624b238b Handled download on the first run when no ZIM file is found.
* We are showing a custom error message to the user for this type authentication urls because we does not have any authentication values in our application so it will always fail to download the zim file, so we are showing a error message where we inform to user to reinstall application from the playstore. Since play store application have the zim file in it.
2023-10-04 19:17:12 +02:00
MohitMali
97eaa1a4c7 Review changes done.
* We have removed the dwds dependent code, now we are using `Regex` expression to match if it is authentication url then we are adding `Authorization` in header.
* To ensure this methods works perfectly in every scenario we have added test cases for it.
2023-10-04 19:17:12 +02:00
MohitMali
3136b00e1d Removed hardcoded secret name.
* We have removed the hardcoded secret name from the code, now we are extracting secret name from the url.
* Now we are getting userName and password from single secret.
2023-10-04 19:17:12 +02:00
MohitMali
7e9aee96fa We have fixed the issue of downloading not working in the custom app for the DWDS application. We had added the BasicAuthInterceptor to the NetworkModule, but it is responsible for resolving the URLs. However, for downloading the ZIM files, we need this BasicAuthInterceptor in the OkHttp client of the DownloaderModule which is responsible for downloading zim files. 2023-10-04 19:17:12 +02:00
Gouri Panda
7fc249f709 Authentication created for DWDS app 2023-10-04 19:17:12 +02:00
Kelson
33695723bd
Merge pull request #3496 from computerscienceiscool/patch-1
Update README.md
2023-10-04 14:36:45 +02:00
JJ
1a58589633
Update README.md
Fixed a very small spelling error.
2023-10-04 01:32:32 -07:00
Kelson
d5e98dc5a4
Merge pull request #3484 from kiwix/Issue#2561
Fixed Zimit-generated zim files were partially failing to open.
2023-09-27 06:24:12 +02:00
MohitMali
59834f112f Fixed Zimit-generated zim files were partially failing to open.
* The issue was that we were not properly uninitialized the service worker, which was sometimes causing problems and preventing us from reading the `Zimit-generated` zim files. Therefore, we have now implemented the proper uninitialization of the service worker before loading the URLs for new zim files.
2023-09-20 17:42:41 +05:30
Kelson
27215b0541
Merge pull request #3217 from kiwix/Issue#3216
Adapt latest java-libkiwix wrapper
2023-09-18 19:13:54 +02:00
MohitMali
9ff91bac57 Remove the unnecessary SearchState object since we no longer need it in the SearchFragment. We are now directly obtaining additional search data from the SearchViewModel, which already contains the SearchState. 2023-09-18 19:13:20 +02:00
MohitMali
ec007e4399 Moved the load more data logic to SearchViewModel class to manage separate concerns. 2023-09-18 19:13:20 +02:00
MohitMaliFtechiz
221f84b2bf Improved the "load more" functionality for search and introduced several other enhancements:
* Added logging for cases where the `ZimFileReader` failed to find an entry, failed to load an asset, and more.
* Significantly improved the "load more" functionality: Now, if the user is near the end of the list, we start loading new search results. This enhancement enhances the user experience by reducing wait times for new search results.
* Added references in the `KiwixServer` class to help developers understand why we are keeping the library object.
* Implemented test cases to thoroughly test the `getMimeTypeFromUrl()` function in the ZimFileReader class.
* Enhanced the search functionality by consolidating the use of a single viewModelScope instead of multiple coroutines, reducing the potential for future issues.
2023-09-18 19:13:20 +02:00
MohitMali
1281c0c795 Improved test cases and fixed memory leak in application.
* Previously our test cases were launching the `KiwixMainActivity` twice (firstly it sets the values in preference and then relaunch the activity) before running the test case which was the cause of slow testing and sometimes it caused to memory leak in some api levels so we have refactored our test cases to launch `KiwixMainTest` once per test case.
* `IntroFragmentTest` is failing on api level 24 due to a memory leak because after clicking on getStarted button is going to the LocalLibrary page but somehow `onStart` and `onStop` methods are calling of the `CoreReaderFragment` which stablish the `serviceConnection` but it was happening very quickly so before attaching the binder to `readAloudService` unbindService method called but at this point service was not created but creating was in progress so after going to library screen it allocate memory to `readAloudService` but `ReaderFragment` is no more visible to the user that's why memory leak happened. We have fixed it by unbinding the service in `onDestroyView` method.
2023-09-18 19:13:20 +02:00
MohitMali
fff9196337 Started using new libkiwix from new maven repo org.kiwix/libkiwix. 2023-09-18 19:13:20 +02:00
Emmanuel Engelhart
644521c722 Add library dependence libkiiwx to the README 2023-09-18 19:13:20 +02:00
MohitMali
ad81bbdcf0 Fixed server crashing issue when we open it on web browser 2023-09-18 19:13:20 +02:00
MohitMali
f1889ee1d2 Fixed bugs and enhanced search functionality.
* A bug was introduced after enhancing the search functionality to align with the new `java-libkiwix` wrapper. Initially, when searching for any article in the ZIM file, the loading progress bar was not being displayed. This commit resolves this issue.
* While searching within large ZIM files, the application used to freeze momentarily due to fetching data from the `libkiwix` on the UI thread. We have improved this functionality to provide a seamless user experience.
2023-09-18 19:13:20 +02:00
MohitMali
609e9e268f Improved 'Search' Functionality:
* Added a loading progress bar at the end of the RecyclerView when loading more search results as the user scrolls to the bottom. This indicator informs users that additional results are being loaded. The progress bar appears if there are more results available for the search term, providing users with visibility into ongoing loading.
* Enhanced the search loading process for larger ZIM files by introducing coroutines. This background threading approach prevents the UI thread from being impacted and ensures a smooth scrolling experience for users.
2023-09-18 19:13:20 +02:00
MohitMali
4f2b54e70a Improved SearchFragmentTest:
After addressing the issue documented in https://github.com/kiwix/java-libkiwix/pull/61, we now have the ability to search within zim files that do not have a Xapian index. As a result, we have enhanced our test to utilize pre-existing zim files. This improvement leads to reduced time consumption, improved memory efficiency, and minimized network usage impact.
2023-09-18 19:13:20 +02:00
MohitMali
51ef8af68d Use SuggestionSearch instead of Search for better search functionality.
* Since `Search` is not compatible with those zim files which does not have Xapian index but `SuggestionSearch` have this functionality to search inside those zim files so we have used this.
* Update test cases for test new search functionality.
2023-09-18 19:13:20 +02:00
MohitMali
ed237a4d78 Keep everything in libkiwix/libzim in release variant.
* Updated proguard file to keep the `libkiwix/libzim` classes in release variant.
2023-09-18 19:13:20 +02:00
MohitMali
f29be04eac Improved article loading.
* We are previously checking `hasEntryByPath`, `hasEntryByTitle`, `mainEntry.isRedirect` which are internally calling the same function as we are calling after checking this condition so it would be better to directly use those function to avoid calling same function twice see more details https://github.com/kiwix/java-libkiwix/pull/60.
2023-09-18 19:13:20 +02:00