com.akdeniz.googleplaycrawler.GooglePlay.AndroidCheckinResponse Java Examples

The following examples show how to use com.akdeniz.googleplaycrawler.GooglePlay.AndroidCheckinResponse. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GooglePlayAPI.java    From dummydroid with Apache License 2.0 6 votes vote down vote up
/**
 * Performs authentication on "ac2dm" service and match up android id,
 * security token and email by checking them in on this server.
 *
 * This function sets check-inded android ID and that can be taken either by
 * using <code>getToken()</code> or from returned
 * {@link AndroidCheckinResponse} instance.
 *
 */
public AndroidCheckinResponse checkin() throws Exception {

	// this first checkin is for generating android-id
	AndroidCheckinResponse checkinResponse = postCheckin(Utils.generateAndroidCheckinRequest()
			.toByteArray());
	this.setAndroidID(BigInteger.valueOf(checkinResponse.getAndroidId()).toString(16).toUpperCase());
	setSecurityToken((BigInteger.valueOf(checkinResponse.getSecurityToken()).toString(16)));

	String c2dmAuth = loginAC2DM();

	AndroidCheckinRequest.Builder checkInbuilder = AndroidCheckinRequest.newBuilder(Utils
			.generateAndroidCheckinRequest());

	AndroidCheckinRequest build = checkInbuilder
			.setId(new BigInteger(this.getAndroidID(), 16).longValue())
			.setSecurityToken(new BigInteger(getSecurityToken(), 16).longValue())
			.addAccountCookie("[" + getEmail() + "]").addAccountCookie(c2dmAuth).build();
	// this is the second checkin to match credentials with android-id
	return postCheckin(build.toByteArray());
}
 
Example #2
Source File: GooglePlayAPI.java    From raccoon4 with Apache License 2.0 6 votes vote down vote up
/**
 * Performs authentication on "ac2dm" service and match up android id,
 * security token and email by checking them in on this server.
 * 
 * This function sets check-inded android ID and that can be taken either by
 * using <code>getToken()</code> or from returned
 * {@link AndroidCheckinResponse} instance.
 * 
 */
public AndroidCheckinResponse checkin() throws Exception {

	// this first checkin is for generating android-id
	AndroidCheckinResponse checkinResponse = postCheckin(Utils
			.generateAndroidCheckinRequest().toByteArray());
	this.setAndroidID(BigInteger.valueOf(checkinResponse.getGsfId()).toString(
			16));
	setSecurityToken((BigInteger.valueOf(checkinResponse.getSecurityToken())
			.toString(16)));

	String c2dmAuth = loginAC2DM();
	// login();
	// String c2dmAuth= getToken();

	AndroidCheckinRequest.Builder checkInbuilder = AndroidCheckinRequest
			.newBuilder(Utils.generateAndroidCheckinRequest());

	AndroidCheckinRequest build = checkInbuilder
			.setId(new BigInteger(this.getAndroidID(), 16).longValue())
			.setSecurityToken(new BigInteger(getSecurityToken(), 16).longValue())
			.addAccountCookie("[" + getEmail() + "]").addAccountCookie(c2dmAuth)
			.build();
	// this is the second checkin to match credentials with android-id
	return postCheckin(build.toByteArray());
}
 
Example #3
Source File: GooglePlayAPI.java    From Raccoon with Apache License 2.0 6 votes vote down vote up
/**
 * Performs authentication on "ac2dm" service and match up android id,
 * security token and email by checking them in on this server.
 * 
 * This function sets check-inded android ID and that can be taken either by
 * using <code>getToken()</code> or from returned
 * {@link AndroidCheckinResponse} instance.
 * 
 */
public AndroidCheckinResponse checkin() throws Exception {

	// this first checkin is for generating android-id
	AndroidCheckinResponse checkinResponse = postCheckin(Utils.generateAndroidCheckinRequest()
			.toByteArray());
	this.setAndroidID(BigInteger.valueOf(checkinResponse.getAndroidId()).toString(16));
	setSecurityToken((BigInteger.valueOf(checkinResponse.getSecurityToken()).toString(16)));

	String c2dmAuth = loginAC2DM();

	AndroidCheckinRequest.Builder checkInbuilder = AndroidCheckinRequest.newBuilder(Utils
			.generateAndroidCheckinRequest());

	AndroidCheckinRequest build = checkInbuilder
			.setId(new BigInteger(this.getAndroidID(), 16).longValue())
			.setSecurityToken(new BigInteger(getSecurityToken(), 16).longValue())
			.addAccountCookie("[" + getEmail() + "]").addAccountCookie(c2dmAuth).build();
	// this is the second checkin to match credentials with android-id
	return postCheckin(build.toByteArray());
}
 
Example #4
Source File: GooglePlayAPI.java    From dummydroid with Apache License 2.0 5 votes vote down vote up
/**
 * Posts given check-in request content and returns
 * {@link AndroidCheckinResponse}.
 */
public AndroidCheckinResponse postCheckin(byte[] request) throws IOException {

	HttpEntity httpEntity = executePost(CHECKIN_URL, new ByteArrayEntity(request), new String[][] {
			{ "User-Agent", "Android-Checkin/2.0 (generic JRO03E); gzip" },
			{ "Host", "android.clients.google.com" },
			{ "Content-Type", "application/x-protobuffer" } });
	return AndroidCheckinResponse.parseFrom(httpEntity.getContent());
}
 
Example #5
Source File: GooglePlayAPI.java    From raccoon4 with Apache License 2.0 5 votes vote down vote up
/**
 * Posts given check-in request content and returns
 * {@link AndroidCheckinResponse}.
 */
private AndroidCheckinResponse postCheckin(byte[] request) throws IOException {

	HttpEntity httpEntity = executePost(CHECKIN_URL, new ByteArrayEntity(
			request), new String[][] {
			{ "User-Agent", "Android-Checkin/2.0 (generic JRO03E); gzip" },
			{ "Host", "android.clients.google.com" },
			{ "Content-Type", "application/x-protobuffer" } });
	return AndroidCheckinResponse.parseFrom(httpEntity.getContent());
}
 
Example #6
Source File: GooglePlayAPI.java    From Raccoon with Apache License 2.0 5 votes vote down vote up
/**
 * Posts given check-in request content and returns
 * {@link AndroidCheckinResponse}.
 */
private AndroidCheckinResponse postCheckin(byte[] request) throws IOException {

	HttpEntity httpEntity = executePost(CHECKIN_URL, new ByteArrayEntity(request), new String[][] {
			{ "User-Agent", "Android-Checkin/2.0 (generic JRO03E); gzip" },
			{ "Host", "android.clients.google.com" },
			{ "Content-Type", "application/x-protobuffer" } });
	return AndroidCheckinResponse.parseFrom(httpEntity.getContent());
}