SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
20.37k stars 2.43k forks source link

[Feauture Request] Adding the ability to manage Auto Update option through a specific URL Scheme #2140

Open neerro opened 2 months ago

neerro commented 2 months ago

Operating system

Android

System version

anyVersion & anyTypeOfDevices

Installation type

Others

If you are using a graphical client, please provide the version of the client.

No response

Version

No response

Description

Dear @nekohasekai,

I would like to propose an enhancement to the application’s functionality that will allow users to manage auto-update parameters when importing profiles via remote links in the format sing-box://import-remote-profile?url=urlEncodedURL#urlEncodedName.

Currently, the ability to modify auto-update parameters (enable/disable and interval) is only available through the user interface. This limits user flexibility as they cannot predefine these parameters in the link.

Proposed Changes: Support for parameters in the URL:

Implement the ability to pass auto-update parameters through the URL. For example: Auto Update Enabled sing-box://import-remote-profile?url=urlEncodedURL&autoUpdate=true&autoUpdateInterval=60#urlEncodedName or it may be leave as it is: sing-box://import-remote-profile?url=urlEncodedURL#urlEncodedName. Auto UpdateDisabled sing-box://import-remote-profile?url=urlEncodedURL&autoUpdate=false&autoUpdateInterval=0#urlEncodedName

Modifying profile handling logic:

In the method that handles profile imports, add logic to extract the autoUpdate and interval parameters from the URL. Set the corresponding values in the TypedProfile object.

This will add flexibility and simplify the use of the application for users who prefer to set up their profiles in advance.

Reproduction

There is no error. It is a Feauture Request.

Logs

No response

Supporter

Integrity requirements

ahlixinjie commented 5 days ago

agreed. now only graphic client implement this. Also need this for bin