Skip to content

Conversation

iKirby
Copy link
Contributor

@iKirby iKirby commented Apr 29, 2025

Add vivo App Store with search support. This will be useful for Chinese users.

Currently their apis used on the web (h5) version don't require any authentication. Don't know if it will change in the future.

@ImranR98
Copy link
Owner

ImranR98 commented May 5, 2025

Will this work for other countries' versions? For example I found https://appstore.vivo.com.br
If not, the name should be changed so it's clear that this is for the Chinese store only.
If it would work with trivial changes, please make those changes (probably not, at least based on my very light poking around).

Also please use hosts[0] wherever possible instead of hardcoding host strings. See here for a good example: https://github.com/ImranR98/Obtainium/blob/main/lib/app_sources/huaweiappgallery.dart#L27
This is needed for cases where the user decides to force the use of a specific source (source override) even though the URL is not what we expect for that source. I'm guessing this is very unlikely to ever happen for the Vivo store specifically but it should still be supported for consistency.

Third minor thing - vivo should probably by capitalized (Vivo) in all the translation files.

@ImranR98
Copy link
Owner

ImranR98 commented May 5, 2025

Also I see you've added a custom user agent - just checking - the default agent doesn't work?

@iKirby
Copy link
Contributor Author

iKirby commented May 6, 2025

Thanks for your feedback.

I didn't even know vivo has its own app store outside China, because global versions have Google Play pre-installed. I checked the BR site but I can only see subscription services, and the apis and structure is different from the Chinese site, so the support will be Chinese site only. I will add CN to the name.

I don't quite understand the use of hosts[0]. Vivo store's URL contains only their own appId, all other information needs to be retrieved from the api (package name, download URL, etc). If the URL contains a valid appId parameter then it is OK.

As for vivo or Vivo, their website uses vivo everywhere because it's their brand, so I think it should be kept the same.

And about the user agent, the default one works but I think it's better to use a browser user agent, to prevent basic bot detection. I will remove it for now, and add if required in the future.

@wodin
Copy link
Contributor

wodin commented May 6, 2025

@iKirby if I understand correctly, using hosts[0] is a way to allow a user that wants to download from the Brazillian vivo store to use your vivo app source, even if yours was written to support the Chinese vivo store.

So the user would enter the Brazillian vivo store's URL into Obtainium, but then override the source to use your "vivo" app source.

I found this explanation useful:
https://deepwiki.com/search/on-a-pr-to-add-support-for-a-n_486f1496-558f-4f4a-841d-0a55b387b2e3

@ImranR98 please correct me if I am wrong.

@ImranR98
Copy link
Owner

ImranR98 commented May 6, 2025

Yes that's right

@iKirby
Copy link
Contributor Author

iKirby commented May 6, 2025

So the user would enter the Brazillian vivo store's URL into Obtainium, but then override the source to use your "vivo" app source.

But this is not possible. The code I added uses their api to get info, if appId param does not exist in the URL or it is not a valid one in the CN vivo App Store, the source will not work. It works like the Coolapk source. So using hosts[0] is unnecessary and it won't work.

Maybe I should use regex to match the host?

@ImranR98
Copy link
Owner

Nah, you're right, it's unnecessary work. I will add a new allowOverride: false property so that this source (and similar ones) do not show up in the override dropdown.

@ImranR98 ImranR98 merged commit 971b5db into ImranR98:main May 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants