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

v2 API calls #6

Open
MikeMannox opened this issue Nov 28, 2017 · 7 comments
Open

v2 API calls #6

MikeMannox opened this issue Nov 28, 2017 · 7 comments

Comments

@MikeMannox
Copy link

MikeMannox commented Nov 28, 2017

I wanted to see if I figure out how the Google Wifi Android App queries for attached devices - (which I couldn't find), but I did find a whole bunch of API calls.

The Class I inspected was: com.google.api.services.accesspoints.v2.AccessPoints

Some of these seem interesting, although I could not see what queries and args are being passed.

Maybe you might have an idea...

// accesspoints
HttpMethods.DELETE, "v2/accesspoints/{apId}"
HttpMethods.GET, "v2/accesspoints/{apId}/hardwareBundleSetupInfo"
HttpMethods.POST, "v2/accesspoints/{apId}/localSpeedTest"
HttpMethods.POST, "v2/accesspoints/{clientApId}/meshSpeedTest"
HttpMethods.POST, "v2/accesspoints/{apId}/reboot"
HttpMethods.PUT, "v2/accesspoints/{apId}/bridgeMode"
HttpMethods.PUT, "v2/accesspoints/{apId}/lighting"
HttpMethods.PUT, "v2/accesspoints/{apId}/room"
HttpMethods.POST, "v2/accesspoints/{apId}/wifiblasterSpeedTest"

// apSoftware
HttpMethods.GET, "v2/apSoftware/{lastDismissedApVersion}/releaseNotes"

HttpMethods.GET, "v2/appSoftware/{appVersion}/clientTypes/{clientType}/status"

// connectedhome
HttpMethods.PUT, "v2/connectedhome/adapters/{adapterId}/activate"
HttpMethods.PUT, "v2/connectedhome/adapters/{adapterId}/deactivate"
HttpMethods.GET, "v2/connectedhome/adapters"
HttpMethods.PUT, "v2/connectedhome/{groupId}/cloudAction"

// groups
HttpMethods.POST,"v2/groups/{groupId}/blockingSchedules"
HttpMethods.POST,"v2/groups/{groupId}/blockingSchedules/{id}"
HttpMethods.DELETE, "v2/groups/{groupId}/blockingSchedules/{blockingScheduleId}"
HttpMethods.POST,"v2/groups/{groupId}/contentFilteringPolicies"
HttpMethods.DELETE, "v2/groups/{groupId}/contentFilteringPolicies/{contentFilteringPolicyId}"
HttpMethods.POST,"v2/groups/{groupId}/contentFilteringPolicies:updateMultiple"
HttpMethods.DELETE, "v2/groups/{groupId}"
HttpMethods.DELETE, "v2/groups/{groupId}/portForwarding"
HttpMethods.DELETE, "v2/groups/{groupId}/prioritizedStation"
HttpMethods.GET, "v2/groups/{groupId}"
HttpMethods.GET, "v2/groups/{groupId}/backhaulOfChildNodes"
HttpMethods.GET, "v2/groups/{groupId}/historicalUsage"
HttpMethods.GET, "v2/groups/{groupId}/meshConfiguration"
HttpMethods.GET, "v2/groups/{groupId}/meshSpeedTestResults"
HttpMethods.GET, "v2/groups/{groupId}/realtimeMetrics"
HttpMethods.GET, "v2/groups/{groupId}/speedTestResults"
HttpMethods.GET, "v2/groups/{groupId}/status"
HttpMethods.GET, "v2/groups/{groupId}/wifiblasterSpeedTestResults"
HttpMethods.POST, "v2/groups/{groupId}/insightCards/{cardId}/action"
HttpMethods.DELETE, "v2/groups/{groupId}/insightCards/{cardId}"
HttpMethods.GET, "v2/groups/{groupId}/insightCards/{cardId}"
HttpMethods.GET, "v2/groups/{groupId}/insightCards"
HttpMethods.GET, "v2/groups"
HttpMethods.POST, "v2/groups/{groupId}/managers"
HttpMethods.DELETE, "v2/groups/{groupId}/managers/{managerId}"
HttpMethods.POST, "v2/groups/{groupId}/portForwarding"
HttpMethods.POST, "v2/groups/{groupId}/psks"
HttpMethods.POST, "v2/groups/{groupId}/reboot"
HttpMethods.POST, "v2/groups/{groupId}/rebootWhenUpdateReady"
HttpMethods.POST, "v2/groups/{groupId}/startLogUpload"
HttpMethods.POST, "v2/groups/{groupId}/stationSets"
HttpMethods.DELETE, "v2/groups/{groupId}/stationSets/{stationSetId}"
HttpMethods.GET, "v2/groups/{groupId}/stationSets/{stationSetId}/stationActivity"
HttpMethods.POST, "v2/groups/{groupId}/stationSets/{stationSetId}"
HttpMethods.DELETE, "v2/groups/{groupId}/stations/{stationId}/stationName"
HttpMethods.GET, "v2/groups/{groupId}/stations"
HttpMethods.POST, "v2/groups/{groupId}/stations/operations/macAddresses"
HttpMethods.PUT, "v2/groups/{groupId}/stations/{stationId}/staticIp"
HttpMethods.PUT, "v2/groups/{groupId}/stations/{stationId}/stationName"
HttpMethods.PUT, "v2/groups/{groupId}/apSoftwareChannel"
HttpMethods.PUT, "v2/groups/{groupId}/dataCollection"
HttpMethods.PUT, "v2/groups/{groupId}/defaultPrioritizedStation"
HttpMethods.PUT, "v2/groups/{groupId}/dnsConfig"
HttpMethods.PUT, "v2/groups/{groupId}/guestWirelessConfig"
HttpMethods.PUT, "v2/groups/{groupId}/ipv6"
HttpMethods.PUT, "v2/groups/{groupId}/lanAddresses"
HttpMethods.PUT, "v2/groups/{groupId}/meshNetwork"
HttpMethods.PUT, "v2/groups/{groupId}/prioritizedStation"
HttpMethods.PUT, "v2/groups/{groupId}/stationBlocking"
HttpMethods.PUT, "v2/groups/{groupId}/upnpConfig"
HttpMethods.PUT, "v2/groups/{groupId}/wirelessConfig"
HttpMethods.POST, "v2/groups/{groupId}/wanSpeedTest"

// operations
HttpMethods.GET, "v2/operations/{operationId}"
HttpMethods.GET, "v2/operations/{operationId}/psks"
HttpMethods.GET, "v2/operations/{operationId}/macAddresses"

HttpMethods.POST, "v2/registrationTickets"

//userPreferences
HttpMethods.GET, "v2/userPreferences"
HttpMethods.PUT, "v2/userPreferences"
HttpMethods.PUT, "v2/userPreferences/resendConfirmationEmail"

HttpMethods.GET, "v2/oobeflow"

// the following log comment was in the class:
ajx.b(z, "You are currently running with version %s of google-api-client. You need at least version 1.15 of google-api-client to run version 1.22.0-SNAPSHOT of the Google Access Points API (Autopush) library.", bfi.c);

And one v1

"https://www.googleapis.com/", "wificonfig/v1/devices/"
// no clue how this is used

I hope it helps in some way

@olssonm
Copy link
Owner

olssonm commented Nov 30, 2017

Thanks for the info and input!

I don't have an Android device to check them out, but you mean that all these calls are made from the Android Google Wifi App to the Wifi-unit itself? That's quite odd actually, I haven't seen or detected and v2-calls at all over here.

Just to make sure, we're talking about this app: https://play.google.com/store/apps/details?id=com.google.android.apps.access.wifi.consumer&hl=en and this Google product: https://store.google.com/product/google_wifi?

@MikeMannox
Copy link
Author

MikeMannox commented Nov 30, 2017

Yes, this is the same APK and same product.

As I mentioned I was looking for a way to read the attached devices list. Whilst looking around inside the app I discovered the above URL's inside the class.

You don't necessarily need an Android device to read what is in the APK.

Visit ApkMirror and download the App

Download & install JADX and you can have a look around yourself.

I hope this helps :)

@lycca
Copy link

lycca commented Jan 26, 2018

Hi Mike,

I bought a few Google Wifi’s, which have an old 8688.0.0 version of firmware from the test image channel (instead of the usual stable channel) and having field updateRequired = 0.

It seems that some kind of write protection / restriction were in force in the test image firmware, preventing the execution of Recovery Mode when trying to flash a newer stable image firmware.

Since I am not familiar with CrOS development, could you please advise the procedure for me to flash the Google Wifi to 9334.x.x steady channel image (downloaded from OnHub Recovery Utility).

Below is my posting seeking for help in Google Help Forum, for your reference:

https://groups.google.com/a/chromium.org/forum/m/#!topic/chromium-os-dev/98yOPE3UEBo

https://productforums.google.com/forum/#!topic/googlewifi/etya6Mqeo-Y

https://productforums.google.com/forum/#!topic/googlewifi/-AvwS-S-h2Q

https://productforums.google.com/forum/#!topic/googlewifi/IH16V17l6J4

I also attached the status page of the Google Wifi (http://192.168.86.1/api/v1/status) below for your information, many thanks!

{
softwareStatus = {
updateChannel = "testimage-channel";
updateProgress = 0;
updateRequired = 0;
updateStatus = 1;
version = "8688.0.0";
};
systemStatus = {
deviceId = "ed6640ea-ccbd-8c48-a02f-6c9102300f44";
hardware = 4;
hardwareId = "GALE A2A-A2A-E3A-A4Q-A9C";
uptime = 19893;
};
wanStatus = {
captivePortal = 0;
ethernetLink = 1;
invalidCredentials = 0;
online = 1;
pppoeDetected = 0;
};
}

@adriancampos
Copy link

I found the line
prodAccesspointsApiHost = "accesspoints.googleapis.com" in com.google.android.apps.access.wifi.consumer.config.Config.
Combined with your "v2" endpoints listed above (ex: https://accesspoints.googleapis.com/v2/userPreferences), I get a response:

"Request had invalid authentication credentials..."

To get an authorization token, I'm guessing we need to make a request to https://accounts.google.com/o/oauth2/v2/auth as described in https://developers.google.com/identity/protocols/OAuth2InstalledApp, pretending to be the app. I haven't been able to pull the parameters (specifically client_id) for that from the app, but I assume they're in there in some form.

Any suggestions?

@forresthopkinsa
Copy link

@adriancampos Did you ever figure that out?

@JamesHawkinss
Copy link

@forresthopkinsa

Hi there, apologies for picking up on this dead issue.

I've just implemented many of these API endpoints in a Node.js wrapper, which shows how to authenticate etc: https://github.com/JamesHawkinss/google-wifi-api-node

Hope this proves useful. I have plans to develop a web dashboard for showing basic Google Wifi information, as I don't like having to use the mobile app.

@AngeloD2022
Copy link

I am working to reverse the RPC version of this API.

Authentication, as well as many of the HTTP methods, are implemented in C++ in this repository.

If anyone has any information relating to the new (RPC) API version, please let me know! :)

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

No branches or pull requests

7 participants