Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Android Studio versions #48

Merged
merged 3 commits into from
Mar 10, 2022
Merged

Added Android Studio versions #48

merged 3 commits into from
Mar 10, 2022

Conversation

JuanFcoMiranda
Copy link
Contributor

Added all versions (branches) for Android Studio,.

@JonasGroeger
Copy link
Owner

JonasGroeger commented Dec 17, 2021

Whats with the gvt URLs: https://redirector.gvt1.com/

@JuanFcoMiranda
Copy link
Contributor Author

Whats with the gvt URLs: https://redirector.gvt1.com/

Those are the links that Google provide, I guess they are like CDNs.

@JonasGroeger
Copy link
Owner

JonasGroeger commented Mar 2, 2022

I wanted to merge this but there is an issue in the preinstall script. It contains a version that does not follow the x.y.z schema but rather x.y.z.q. The Bash function update_package_version in update_packages will only update the x.y.z part but keep the q part in place.

I'd recommend putting the full version into the package.json file so that updating it works flawlessly.

@JuanFcoMiranda
Copy link
Contributor Author

JuanFcoMiranda commented Mar 5, 2022

I have updated the versions and also all the package.json files

@JonasGroeger
Copy link
Owner

LGTM

@JonasGroeger JonasGroeger merged commit 9595dec into JonasGroeger:master Mar 10, 2022
JonasGroeger added a commit that referenced this pull request Mar 10, 2022
This reverts commit 9595dec, reversing
changes made to ab43426.
@JonasGroeger
Copy link
Owner

JonasGroeger commented Mar 10, 2022

Hi @Zpecter !

I noticed this would fail on next run since there is no AS Code @ https://data.services.jetbrains.com/products/releases?code=AS&latest=true&type=release

I reverted your commits for now until there is a proper fix. Do you know the codes for that?

Compare

curl https://data.services.jetbrains.com/products/releases?code=AS&latest=true&type=release
and
curl https://data.services.jetbrains.com/products/releases?code=IIU&latest=true&type=release

The former does not work but the latter does (IntelliJ Idea Ultimate).

@JuanFcoMiranda
Copy link
Contributor Author

Hi, I didn't know that. The problem is that Android Studio, although is based on IntelliJ IDEA, it is not maintained by JetBrains, but by Google, so I don't know how to get that information other than this site:

https://developer.android.com/studio/archive

@JuanFcoMiranda
Copy link
Contributor Author

Hi, I'm creating an API to parse the above url and return a json similar to the one offered by JetBrains.

@JonasGroeger
Copy link
Owner

JonasGroeger commented Mar 27, 2022

It's the only way. Check out update-packages in L55. There is where it would fail.

We need to have an API that provides us with the latest version. Is there something like this? I'd rather not scrape the website.

I noticed there is a "check for updates" menu in Android studio. Maybe intercept the http call with mitmproxy and use that?

@JuanFcoMiranda
Copy link
Contributor Author

JuanFcoMiranda commented Mar 28, 2022

Yes, I think there should be an API too, I even sniffed the connection, but it's encrypted and I only see that is something like this: https://dl.google.com, but I can't find the rest, that's the reason I created my own API by parsing the html from that url.

@JonasGroeger
Copy link
Owner

JonasGroeger commented Mar 29, 2022

I used mitmproxy to intercept the HTTPS calls and found out that they use

https://dl.google.com/android/studio/patches/updates.xml

for the update check. All <channel> with status="release" yields 2 releases:

  • id="AI-1-release" (line 94)
  • id="AI-2-release" (line 42)

Pick the topmost one (AI-2-release) and check the build number if its an update to the currently stored one.<build number="AI- 211.7628.21.2111.8193401" ...>.. If so, update the package.

Now this is where it gets tricky. From the build AI- 211.7628.21.2111.8193401 we cant reconstruct a release version like 2021.1.1.20 that we require to download the package (i.e. https://redirector.gvt1.com/edgedl/android/studio/ide-zips/$version/android-studio-$version-linux.tar.gz).

@JuanFcoMiranda
Copy link
Contributor Author

JuanFcoMiranda commented Mar 29, 2022

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.

2 participants