flobz / psa_car_controller

Control psa car with connected_car v4 API.
GNU General Public License v3.0
415 stars 220 forks source link

app_decoder.py returns "NEED_ACTIVATION" #154

Closed luisleonardo closed 3 years ago

luisleonardo commented 3 years ago

Describe the bug app_decoder.py returns "NEED_ACTIVATION"

APK loading...
Requested API level 29 is larger than maximum we have, returning API level 28 instead.
APK loaded !
MyVauxhall email: dianagabao@gmail.com
MyVauxhall password:
What is your country code ? (ex: FR, GB, DE, ES...)
PT
Traceback (most recent call last):
  File "/psa_car_controller/app_decoder.py", line 84, in <module>
    token = res.json()["accessToken"]
KeyError: 'accessToken'
HOST_BRANDID : https://id-dcr.vauxhall.co.uk/mobile-services sitecode: VX_PT_ESP
{"returnCode":"NEED_ACTIVATION"}

To Reproduce python3 /psa_car_controller/app_decoder.py /config/com.psa.mym.myvauxhall_1.27.1.apk

Environment (please complete the following information):

sbauza commented 3 years ago

I guess you probably need to use the MyCitroen APK instead of the MyVauxhall file. I had the same issue with my e-208 by using the MyVauxhall APK file but then I used the MyPeugeot one which then worked.

luisleonardo commented 3 years ago

I guess you probably need to use the MyCitroen APK instead of the MyVauxhall file. I had the same issue with my e-208 by using the MyVauxhall APK file but then I used the MyPeugeot one which then worked.

Thanks. Tried that and got a different error "No vehicle in your account is compatible with this API, you vehicle is probably too old...". Is this for electric cars only?

APK loading...
Requested API level 29 is larger than maximum we have, returning API level 28 instead.
APK loaded !
MyCitroen email: XXXXXXXXXXXXXX
MyCitroen password:
What is your country code ? (ex: FR, GB, DE, ES...)
PT
get_vehicles:
Traceback (most recent call last):
  File "/psa_car_controller/my_psacc.py", line 176, in get_vehicles
    res = self.api().get_vehicles_by_device()
  File "/psa_car_controller/psa_connectedcar/api/vehicles_api.py", line 1331, in get_vehicles_by_device
    (data) = self.get_vehicles_by_device_with_http_info(**kwargs)  # noqa: E501
  File "/psa_car_controller/psa_connectedcar/api/vehicles_api.py", line 1400, in get_vehicles_by_device_with_http_info
    return self.api_client.call_api(
  File "/psa_car_controller/libs/oauth.py", line 77, in call_api
    raise e
  File "/psa_car_controller/libs/oauth.py", line 59, in call_api
    return self._ApiClient__call_api(resource_path, method,
  File "/psa_car_controller/psa_connectedcar/api_client.py", line 157, in __call_api
    response_data = self.request(
  File "/psa_car_controller/psa_connectedcar/api_client.py", line 347, in request
    return self.rest_client.GET(url,
  File "/psa_car_controller/psa_connectedcar/rest.py", line 234, in GET
    return self.request("GET", url,
  File "/psa_car_controller/psa_connectedcar/rest.py", line 228, in request
    raise ApiException(http_resp=r)
psa_connectedcar.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'X-Backside-Transport': 'FAIL FAIL', 'Connection': 'close', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Content-Type': 'application/hal+json', 'Date': 'Tue, 01 Jun 2021 19:35:37 GMT', 'Expires': '0', 'X-Global-Transaction-ID': 'XXXXXXXXXXXXXX', 'Access-Control-Expose-Headers': 'APIm-Debug-Trans-Id, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Global-Transaction-ID', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Mon, 31-May-2021 19:35:37 GMT, JSESSIONID=XXXXXXXXXXXXXX; path=/, PSACountry=PT;Domain=.groupe-psa.com;Path=/', 'X-RateLimit-Limit': 'name=rate-limit-1,150;', 'X-RateLimit-Remaining': 'name=rate-limit-1,0;'})
HTTP response body: {"uuid":"XXXXXXXXXXXXXX","code":40410,"message":"No vehicule found"}

Your vehicles: []
No vehicle in your account is compatible with this API, you vehicle is probably too old...
flobz commented 3 years ago

Your vehicle is too old. It used an old api.

flobz commented 3 years ago

Look at #57

luisleonardo commented 3 years ago

Your vehicle is too old. It used an old api.

Old? The car was bought new in February 2020! The new model was released like one month ago.

flobz commented 3 years ago

HTTP response body: {"uuid":"XXXXXXXXXXXXXX","code":40410,"message":"No vehicule found"} It's pretty clear, your car doesn't use this API. You can do some network sniffing to find which API mycitroen app used.