calabash-android 0.4.3.pre6 → 0.4.3.pre7
Sign up to get free protection for your applications and to get access to all the features.
@@ -81,17 +81,37 @@ def sign_apk(app_path, dest_path)
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def read_keystore_info
|
84
|
+
keystore = default_keystore
|
85
|
+
|
84
86
|
if File.exist? ".calabash_settings"
|
85
87
|
keystore = JSON.parse(IO.read(".calabash_settings"))
|
86
|
-
keystore
|
87
|
-
keystore
|
88
|
-
|
89
|
-
|
90
|
-
|
88
|
+
fail_if_key_missing(keystore, "keystore_location")
|
89
|
+
fail_if_key_missing(keystore, "keystore_password")
|
90
|
+
fail_if_key_missing(keystore, "keystore_alias")
|
91
|
+
keystore["keystore_location"] = File.expand_path(keystore["keystore_location"])
|
92
|
+
end
|
93
|
+
keystore["keystore_location"] = put_in_quotes(remove_quotes(keystore["keystore_location"]))
|
94
|
+
keystore
|
95
|
+
end
|
96
|
+
|
97
|
+
def default_keystore
|
98
|
+
{
|
99
|
+
"keystore_location" => File.expand_path(File.join(ENV["HOME"], "/.android/debug.keystore")),
|
91
100
|
"keystore_password" => "android",
|
92
101
|
"keystore_alias" => "androiddebugkey",
|
93
|
-
|
94
|
-
|
102
|
+
}
|
103
|
+
end
|
104
|
+
|
105
|
+
def fail_if_key_missing(map, key)
|
106
|
+
raise "Found .calabash_settings but no #{key} defined." unless map[key]
|
107
|
+
end
|
108
|
+
|
109
|
+
def remove_quotes(s)
|
110
|
+
s.gsub(/"/, "")
|
111
|
+
end
|
112
|
+
|
113
|
+
def put_in_quotes(s)
|
114
|
+
%Q{"#{s}"}
|
95
115
|
end
|
96
116
|
|
97
117
|
def keytool_path
|
@@ -104,7 +124,7 @@ end
|
|
104
124
|
|
105
125
|
def fingerprint_from_keystore
|
106
126
|
keystore_info = read_keystore_info
|
107
|
-
cmd = "#{keytool_path} -v -list -alias #{keystore_info["keystore_alias"]} -keystore
|
127
|
+
cmd = "#{keytool_path} -v -list -alias #{keystore_info["keystore_alias"]} -keystore #{keystore_info["keystore_location"]} -storepass #{keystore_info["keystore_password"]}"
|
108
128
|
|
109
129
|
log cmd
|
110
130
|
fingerprints = `#{cmd}`
|
Binary file
|