diff --git a/build.gradle b/build.gradle index 0bacc44..0659e45 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { } group 'com.github.theapache64' -version '0.0.6' +version '0.0.7' repositories { jcenter() diff --git a/src/main/kotlin/com/github/theapache64/gpa/api/Play.kt b/src/main/kotlin/com/github/theapache64/gpa/api/Play.kt index e2afc10..f8c6b80 100644 --- a/src/main/kotlin/com/github/theapache64/gpa/api/Play.kt +++ b/src/main/kotlin/com/github/theapache64/gpa/api/Play.kt @@ -5,6 +5,7 @@ import com.github.theapache64.gpa.core.SearchEngineResultPage import com.github.theapache64.gpa.model.Account import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay import kotlinx.coroutines.withContext object Play { @@ -19,6 +20,7 @@ object Play { password: String, locale: String = PlayUtils.getLocalization(), dispatcher: CoroutineDispatcher = Dispatchers.IO, + loginDelay: Long = 10_000, ): Account = withContext(dispatcher) { // Building GooglePlayAPI @@ -41,6 +43,9 @@ object Play { // Upload device config api.uploadDeviceConfig() + // giving time to sync the device config in google servers. + delay(loginDelay) + Account( username, password, diff --git a/src/test/kotlin/com/github/theapache64/gpa/api/PlayTest.kt b/src/test/kotlin/com/github/theapache64/gpa/api/PlayTest.kt index 5a2460b..a5a005d 100644 --- a/src/test/kotlin/com/github/theapache64/gpa/api/PlayTest.kt +++ b/src/test/kotlin/com/github/theapache64/gpa/api/PlayTest.kt @@ -4,7 +4,6 @@ import com.akdeniz.googleplaycrawler.GooglePlayAPI import com.akdeniz.googleplaycrawler.GooglePlayException import com.github.theapache64.gpa.utils.runBlockingTest import com.theapache64.expekt.should -import kotlinx.coroutines.delay import org.apache.http.client.ClientProtocolException import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.Test @@ -28,8 +27,6 @@ internal class PlayTest { // val account = testAccount account.should.not.`null` api = Play.getApi(account) - println("Waiting for 30 seconds...") - delay(10000) // wait to sync the id in google's blood } @Test