apk 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/bin/apk +3 -0
- data/lib/android/aapt.rb +5 -5
- data/lib/apk.rb +2 -2
- data/lib/apk/version.rb +1 -1
- metadata +1 -1
data/Gemfile.lock
CHANGED
data/bin/apk
CHANGED
data/lib/android/aapt.rb
CHANGED
@@ -14,11 +14,11 @@ module Android
|
|
14
14
|
def dump
|
15
15
|
attrs = {}
|
16
16
|
info = aapt('dump badging')
|
17
|
-
package = info.match(/package:\s*(.*)/)[1]
|
18
|
-
attrs[:name] = package.match(/name='(
|
19
|
-
attrs[:version_code] = package.match(/versionCode='(
|
20
|
-
attrs[:version_name] = package.match(/versionName='(
|
21
|
-
attrs[:label] = info.match(/application-label:\s*'(
|
17
|
+
package = info.match(/package:\s*(.*)/)[1] rescue nil
|
18
|
+
attrs[:name] = package.match(/name='([^']*)'/)[1] rescue nil
|
19
|
+
attrs[:version_code] = package.match(/versionCode='([^']*)'/)[1] rescue nil
|
20
|
+
attrs[:version_name] = package.match(/versionName='([^']*)'/)[1] rescue nil
|
21
|
+
attrs[:label] = info.match(/application-label:\s*'([^']*)'/)[1] rescue nil
|
22
22
|
attrs
|
23
23
|
end
|
24
24
|
|
data/lib/apk.rb
CHANGED
@@ -4,7 +4,7 @@ require 'android/resource'
|
|
4
4
|
class APK
|
5
5
|
include Android
|
6
6
|
|
7
|
-
attr_reader :apk, :aapt, :resource
|
7
|
+
attr_reader :apk, :aapt, :resource, :dump
|
8
8
|
|
9
9
|
def initialize(apk_path)
|
10
10
|
@apk = apk_path
|
@@ -19,7 +19,7 @@ class APK
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def method_missing(method, *args, &block)
|
22
|
-
@aapt.dump[method]
|
22
|
+
(@dump ||= @aapt.dump)[method]
|
23
23
|
end
|
24
24
|
|
25
25
|
end
|
data/lib/apk/version.rb
CHANGED