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 +4 -4
- data/lib/apk_downloader/api.rb +17 -0
- data/lib/apk_downloader/configuration.rb +1 -1
- data/lib/apk_downloader/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb10ab2d2a9bc0be435f78635532df49154d959b
|
4
|
+
data.tar.gz: bdb2738512b43ab082409ee7e0e441a0dfdf1713
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f019df8be320f9a33fc02c808094a27935d9a0e8fd14a3d2d3b051eed138a2801c7d6ecd79ec1bceaa7f1e0d84e21635361ea7619628e4d5fe624a17a321a2f6
|
7
|
+
data.tar.gz: 262bc697cdfe80b54c954030d0223b2947d8c34d08205f685d6a801bcd90613fa114fbb4301125900433e380dde2c09a356d851e393822c53c778dd3f51efe75
|
data/lib/apk_downloader/api.rb
CHANGED
@@ -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
|
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.
|
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-
|
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:
|