abra 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -0
- data/README.md +8 -0
- data/lib/abra/version.rb +1 -1
- data/lib/apk.rb +14 -0
- data/lib/resource.rb +15 -0
- data/lib/tool/linux/aapt +0 -0
- data/lib/tool/macos/aapt +0 -0
- data/lib/tool/windows/aapt.exe +0 -0
- 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: d7797535070616d2e099216ac8960693ea638a05
|
4
|
+
data.tar.gz: 9a0d5222804bcec867f3c8bb081cabe98ffd4565
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb179ddd98eab7e52b72cec9a3383b7e0cc8bee3728760bbd5b328f4439682bebe67f10f0fdf8381bf1517e45a2163184134925e60625e5416cdcdd59a7446e
|
7
|
+
data.tar.gz: 14e950b7cc717330212f95fa1ae621b9663d9ce392d99e1115bc01c0fffd706825ba3be2c240c90f704e5a55310422d5334dbe68e5fb88efd7062ff168c6e081
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -37,6 +37,14 @@ puts "[+] SDK Version: %s." % apk.sdk_version
|
|
37
37
|
puts "[+] API Level: %s." % apk.api_level
|
38
38
|
```
|
39
39
|
|
40
|
+
Extract icon file
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
require 'apk'
|
44
|
+
apk = Abra::APK.new(apk_path)
|
45
|
+
apk.icon_file
|
46
|
+
```
|
47
|
+
|
40
48
|
## Development
|
41
49
|
|
42
50
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/abra/version.rb
CHANGED
data/lib/apk.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require "abra/version"
|
2
2
|
require 'aapt'
|
3
|
+
require 'resource'
|
4
|
+
|
3
5
|
|
4
6
|
module Abra
|
5
7
|
class APK
|
@@ -15,6 +17,18 @@ module Abra
|
|
15
17
|
@label = attrs[:label]
|
16
18
|
@icon = attrs[:icon]
|
17
19
|
@api_level = attrs[:api_level].to_i
|
20
|
+
@resource = Resource.new(@apk)
|
21
|
+
end
|
22
|
+
|
23
|
+
def icon_file
|
24
|
+
if self.icon
|
25
|
+
dst = "/tmp/abra-#{Time.now.to_i.to_s}-#{Process.pid.to_s}-#{("%04d" % rand(9999))}"
|
26
|
+
@resource.extract(self.icon, dst)
|
27
|
+
File.read(dst)
|
28
|
+
File.delete(dst)
|
29
|
+
else
|
30
|
+
nil
|
31
|
+
end
|
18
32
|
end
|
19
33
|
|
20
34
|
def sdk_version
|
data/lib/resource.rb
ADDED
data/lib/tool/linux/aapt
CHANGED
Binary file
|
data/lib/tool/macos/aapt
CHANGED
Binary file
|
data/lib/tool/windows/aapt.exe
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- junzhepan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- lib/aapt.rb
|
74
74
|
- lib/abra/version.rb
|
75
75
|
- lib/apk.rb
|
76
|
+
- lib/resource.rb
|
76
77
|
- lib/tool/linux/aapt
|
77
78
|
- lib/tool/linux/lib64/libc++.so
|
78
79
|
- lib/tool/macos/aapt
|