API is broken at Feb 22 2017 3:20pm
Closed this issue · 24 comments
Description:
Unknown exception when logging in
Steps to reproduce:
Use either Google or PTC method to login
Stacktrace
W/System.err: Caused by: java.util.concurrent.ExecutionException: com.google.protobuf.InvalidProtocolBufferException: Contents of buffer are null
W/System.err: at com.pokegoapi.main.RequestHandler$1.get(RequestHandler.java:120)
W/System.err: at com.pokegoapi.main.RequestHandler$1.get(RequestHandler.java:97)
W/System.err: at rx.internal.operators.OnSubscribeToObservableFuture$ToObservableFuture.call(OnSubscribeToObservableFuture.java:74)
W/System.err: at rx.internal.operators.OnSubscribeToObservableFuture$ToObservableFuture.call(OnSubscribeToObservableFuture.java:43)
W/System.err: at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
W/System.err: at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
W/System.err: at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
W/System.err: at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
W/System.err: at rx.Observable.subscribe(Observable.java:9957)
W/System.err: at rx.Observable.subscribe(Observable.java:9924)
W/System.err: at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:445)
W/System.err: at rx.observables.BlockingObservable.first(BlockingObservable.java:168)
W/System.err: at com.pokegoapi.util.AsyncHelper.toBlocking(AsyncHelper.java:45)
W/System.err: ... 8 more
W/System.err: Caused by: com.google.protobuf.InvalidProtocolBufferException: Contents of buffer are null
W/System.err: at com.pokegoapi.main.ServerRequest.getData(ServerRequest.java:89)
W/System.err: at com.pokegoapi.main.RequestHandler.run(RequestHandler.java:381)
W/System.err: ... 1 more
Version:
latest version
Description:
I have the same problem, just a few minutes ago, the API stopped working, I can no longer login with any account (PTC, Google, Token), I attach an image of the exception that I get in the console:
Please, someone who can help us? Or tell us what is going on? Thanks in advance
Version:
I'm using the last commited changes of the API. Thanks in advance!
What API version are you using? When talking about API, that means the Pokemon Go server API, not the PokegoAPI-Java library.
How can I now what version of the Pokemon Go server API I am using?
We are talking about PokegoAPI-Java library, namely this repo, with the latest commit, login fails no matter what
@vagprogrammer if it requires the usage of a hashing key from Bossland, then that is depending on the end point used. If you are not using a hashing key, that means you are using the 0.45 api.
@tommywuhaojie The library uses the api, but there are multiple versions of the library and multiple versions of the api. You have made it clear that you are using the most up to date version of the library. But I'm asking what version of the api are you using. As right now you can choose which version of the api you want to use.
@s7092910 I think that they might be using 0.45 api. This is happening for me too, and I'm using the LegacyHashProvider.
By the looks of that stack-trace, you've compiled from my fork's source, but haven't updated to the latest commit.
@gegy1000 i'm using your fork up to 0e19aa3 and i'm getting Failed to send request: SESSION_INVALIDATED as a response like @pokesniperandroid. I attach an image of the exception that I get in the console:
@gegy1000 same here, getting SESSION_INVALIDATED and I use LegacyHashProvider for hasher
Same here
Hi, i tried using both Legacy Hash(failed) and HashApi (success).
I assuming the Legacy Hash 0.45 has been denied by Niantic Server.
@btremote999 may I know how to use HashApi?
@tommywuhaojie ,
from the example
https://github.com/Grover-c13/PokeGOAPI-Java/blob/Development/sample/src/main/java/com/pokegoapi/examples/ExampleConstants.java
- You need a Hash API key : buy from somewhere
- from the example call getHashProvider() to get the HashProvider
- pass the HashProvider to the api for login
Yes it seems that Niantic has caused 0.45 to reject login. So the Legacy Hash will not work anymore.
@btremote999 please explain more it's not clear at all. regards
@btremote999 I got a hash key but when to try to login I get following error:
FATAL EXCEPTION: Async HTTP Thread
Process: com.ivcalculatorpro, PID: 17939
java.lang.NoSuchMethodError: No virtual method getHeaderFieldLong(Ljava/lang/String;J)J in class Ljava/net/HttpURLConnection; or its super classes (declaration of 'java.net.HttpURLConnection' appears in /system/framework/core-libart.jar)
at com.pokegoapi.util.hash.pokehash.PokeHashKey.setProperties(PokeHashKey.java:57)
at com.pokegoapi.util.hash.pokehash.PokeHashProvider.provide(PokeHashProvider.java:124)
at com.pokegoapi.util.Signature.setSignature(Signature.java:79)
at com.pokegoapi.main.RequestHandler.internalSendServerRequests(RequestHandler.java:199)
at com.pokegoapi.main.RequestHandler.run(RequestHandler.java:376)
at java.lang.Thread.run(Thread.java:833)
Any advice?
Why closed ??
@sino123 try fork @gegy1000 's repo, check for PokeHashKey.java
it has solution to solve it .
method getHeaderFieldLong is not supported for all version, especially android.
this.ratePeriodEnd = this.getHeaderLong(connection, "X-RatePeriodEnd", this.ratePeriodEnd);
/**
* Parses a long header
* @param connection the connection to load the header from
* @param name the header name
* @param defaultValue the default value to use, if parsing fails
* @return the parsed long
*/
private long getHeaderLong(HttpURLConnection connection, String name, long defaultValue) {
try {
return Long.parseLong(connection.getHeaderField(name));
} catch (Exception e) {
return defaultValue;
}
}
@btremote999 I checked PokeHashKey here https://github.com/Grover-c13/PokeGOAPI-Java/blob/Development/library/src/main/java/com/pokegoapi/util/hash/pokehash/PokeHashKey.java but getHeaderLong not in it
@sino123 Yeah, it isn't because it hasn't been updated here yet. You will have to use my fork for the fix, until it is merged.
@btremote999 @sino123 Where can I buy a Hash API key? Could you suggest me some page? I found this: https://talk.pogodev.org/d/55-api-hashing-service-f-a-q
@vagprogrammer Here's what I find: https://talk.pogodev.org/d/51-api-hashing-service-by-pokefarmer
There will be a more uptodated LegacyHasher API? Or here is the end of "free" acces to game's servers?