ReVanced / revanced-manager

💊 Application to use ReVanced on Android
https://revanced.app
GNU General Public License v3.0
16.51k stars 706 forks source link

feat: Add APK Downloading System with Plugin Architecture #722

Open Aunali321 opened 1 year ago

Aunali321 commented 1 year ago

Type

Functionality

Issue

Currently, there is no system in place for downloading APK files. It would be beneficial to have a flexible and extensible system in place that can be used to download APK files from different sources. This would allow developers to add support for new sources without having to modify the core codebase.

Feature

To address this, I propose adding a interface, IApkDownloadProvider, that defines a standard set of methods for downloading APK files. This interface can be implemented by developers as plugins to provide support for downloading from different sources.

The IApkDownloadProvider interface should at least include the following method:

getApkInfo(url: packageName): Promise<ApkInfo> - Retrieves information about the APK file using the package name, such as its version number, size, and download link.

In addition, the main codebase should include a DownloadManager class that acts as a central point for managing the download of APK files. This class should expose methods for adding and removing download providers, as well as starting and stopping downloads.

Motivation

With this system in place, developers can easily add support for new APK download sites by creating new plugins that implement the IApkDownloadProvider interface. This will make the codebase more modular and flexible, while also providing a better user experience for users who want to download APK files from different sources.

Additional context

No response

Acknowledgements

oSumAtrIX commented 1 year ago

I don't think downloadApk will be necessary. ApkInfo should have a direct url to the download link.

Aunali321 commented 1 year ago

Tracking branch - apk-scraper

Ushie commented 1 year ago

There must be consideration for metadata, things such as:

These are needed for the downloadable apps to be integrateable with the existing installed apps list, with an indicator and/or a download action button in the ListItem, other than that it should not be treated differently from installed apps.

bradhoschar commented 1 year ago

This is crucial, since revanced is always 1-2 versions behind the latest apks in the play store.

0-BlackSpectrum-0 commented 1 year ago

If not apk download atleast put the supported version out below the app name during app selection, it's too deep and only shows if the installed version doesn't support the patches, if it does but the version is old I won't know, so add the latest supported version as text near the app during selection that'd be helpful!

antifarben commented 1 year ago

A quick and still useful solution could add just a button opening the standard browser with useful search terms. Something like https://duckduckgo.com/?q="com.google.android.youtube"+apk+"18.19.35" and using/showing the suggested version (see also #876).

This way it doesn't need a dedicated scraper that might fail. A browser is probably available everywhere and users can decide about their sources like they prefer.

Ushie commented 1 year ago

Very good idea!

oSumAtrIX commented 1 year ago

If this is considered to be implemented, the search engine should not be hardcoded.

yonggamer commented 5 months ago

how about AuroraStore code

oSumAtrIX commented 5 months ago

Aurora store serves splits from PlayStore

yonggamer commented 5 months ago

what if you combine it with APKEditor

oSumAtrIX commented 5 months ago

Then it becomes a bigger problem, requires more RAM, time to convert it to a full APK, more patching time and luck so it doesn't fail

yonggamer commented 5 months ago

can a cach file help?

yonggamer commented 5 months ago

or split the the tasks and write to internal storage inbetween tasks?

oSumAtrIX commented 5 months ago

Split support won't be added this way. An interface will be provided where you can implement your own downloader if you want to.