apk_downloader 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1639227456509769eff2009236f6065a711324ea
4
- data.tar.gz: c1523b22fdb1eb872c9fe8995d305210aecc61bc
3
+ metadata.gz: cb10ab2d2a9bc0be435f78635532df49154d959b
4
+ data.tar.gz: bdb2738512b43ab082409ee7e0e441a0dfdf1713
5
5
  SHA512:
6
- metadata.gz: cde067a666190525a174176fc165d6dd78f801323d898f1b192ebee57c71811528fc3fbb7853e7e639ed31aabe79059cad8855a6b032005d759d590a220ebdf6
7
- data.tar.gz: 5661631707617afc358e8682d8f6fc0bd0840e8863bce3417992504f9a5dde6ae7c1e2ce4217d164dcc7e102146a8b8051cc98924ead26347bf1e48c68e27c5f
6
+ metadata.gz: f019df8be320f9a33fc02c808094a27935d9a0e8fd14a3d2d3b051eed138a2801c7d6ecd79ec1bceaa7f1e0d84e21635361ea7619628e4d5fe624a17a321a2f6
7
+ data.tar.gz: 262bc697cdfe80b54c954030d0223b2947d8c34d08205f685d6a801bcd90613fa114fbb4301125900433e380dde2c09a356d851e393822c53c778dd3f51efe75
@@ -1,5 +1,6 @@
1
1
  require 'net/http'
2
2
  require 'tempfile'
3
+ require 'pp'
3
4
 
4
5
  module ApkDownloader
5
6
  class Api
@@ -43,6 +44,12 @@ module ApkDownloader
43
44
  post["Accept-Encoding"] = ""
44
45
 
45
46
  response = login_http.request post
47
+
48
+ if ApkDownloader.configuration.debug
49
+ pp "Login response:"
50
+ pp response
51
+ end
52
+
46
53
  if response.body =~ /error/i
47
54
  raise "Unable to authenticate with Google"
48
55
  elsif response.body.include? "Auth="
@@ -138,6 +145,16 @@ module ApkDownloader
138
145
  api_headers.each { |k, v| req[k] = v }
139
146
 
140
147
  resp = @http.request req
148
+
149
+ unless resp.code.to_i == 200 or resp.code.to_i == 302
150
+ raise "Bad status from Play API"
151
+ end
152
+
153
+ if ApkDownloader.configuration.debug
154
+ pp "Request response (#{type}):"
155
+ pp resp
156
+ end
157
+
141
158
  return ApkDownloader::ProtocolBuffers::ResponseWrapper.new.parse(resp.body)
142
159
  end
143
160
  end
@@ -1,5 +1,5 @@
1
1
  module ApkDownloader
2
2
  class Configuration
3
- attr_accessor :android_id, :email, :password
3
+ attr_accessor :android_id, :email, :password, :debug
4
4
  end
5
5
  end
@@ -1,3 +1,3 @@
1
1
  module ApkDownloader
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apk_downloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lindsey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-23 00:00:00.000000000 Z
11
+ date: 2013-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-protocol-buffers
@@ -156,3 +156,4 @@ summary: Uses a spoofed request to trick the Play store into thinking you're an
156
156
  device, allowing you to download APK files directly
157
157
  test_files:
158
158
  - spec/spec_helper.rb
159
+ has_rdoc: