Zebra: Use a whitelist instead of blacklist when checking the clipboard for a repo to add

Created on 18 Nov 2019  路  4Comments  路  Source: zbrateam/Zebra

Is your feature request related to a problem? Please describe.
When opening Zebra to the sources tab with a URL in my clipboard, it prompts to add the URL to Zebra. The current method uses a blacklist of URLs such as youtu.be, reddit.com, etc however a lot of false positives occur due to the blacklist being small.

Describe the solution you'd like
Zebra should use a whitelist of strings (i.e. cydia, apt, repo, beta, etc) to determine whether the clipboard contains a repository instead of the current blacklist which includes well-known domains. The whitelist would result in a more accurate detection of repository URLs located in the clipboard.

Describe alternatives you've considered
Instead of an alert, maybe implement a banner instead so that it doesn't interrupt a user's flow with an extra (unnecessary) tap.

Additional context
Here is the current blacklist.

sources

Most helpful comment

Simply checking for a /Release might suffice enough to present the popup. We don't have to download the file in its entirety (But Release files are small enough that we could) but maybe just a HEAD request that gets us an error code.

All 4 comments

I would prefer a repo validity check that triggers in the background against the URL in the clipboard. This way we don鈥檛 have to keep a hardcoded list of repos - that we don鈥檛 know if we cover 100% of the repos out there.

I wouldn't say a hardcoded list of repos, just URLs with cydia, apt, etc in their name.

Simply checking for a /Release might suffice enough to present the popup. We don't have to download the file in its entirety (But Release files are small enough that we could) but maybe just a HEAD request that gets us an error code.

Implemented in a09e346ce5c21bf8ac5a3e18346d69dd1a4ed777 and we'll see how the performance is in the next beta.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Brixteren picture Brixteren  路  3Comments

worldlydev picture worldlydev  路  6Comments

worldlydev picture worldlydev  路  7Comments

unclehumble picture unclehumble  路  4Comments

ashbruh picture ashbruh  路  4Comments