calabash-android 0.3.0.pre5 → 0.3.0.pre6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,17 +10,23 @@ def calabash_build(app)
|
|
10
10
|
FileUtils.cp(unsigned_test_apk, "TestServer.apk")
|
11
11
|
FileUtils.cp(File.join(File.dirname(__FILE__), '..', 'test-server/AndroidManifest.xml'), "AndroidManifest.xml")
|
12
12
|
|
13
|
-
system %Q{ruby -pi.bak -e "gsub(/#targetPackage#/, '#{package_name(app)}')" AndroidManifest.xml}
|
13
|
+
unless system %Q{ruby -pi.bak -e "gsub(/#targetPackage#/, '#{package_name(app)}')" AndroidManifest.xml}
|
14
|
+
raise "Could not replace package name in manifest"
|
15
|
+
end
|
16
|
+
|
17
|
+
unless system("#{ENV["ANDROID_HOME"]}/platform-tools/aapt package -M AndroidManifest.xml -I #{android_platform}/android.jar -F dummy.apk")
|
18
|
+
raise "Could not create dummy.apk"
|
19
|
+
end
|
14
20
|
|
15
|
-
system("#{ENV["ANDROID_HOME"]}/platform-tools/aapt package -M AndroidManifest.xml -I #{android_platform}/android.jar -F dummy.apk")
|
16
|
-
|
17
21
|
Zip::ZipFile.new("dummy.apk").extract("AndroidManifest.xml","customAndroidManifest.xml")
|
18
22
|
Zip::ZipFile.open("TestServer.apk") do |zip_file|
|
19
23
|
zip_file.add("AndroidManifest.xml", "customAndroidManifest.xml")
|
20
24
|
end
|
21
25
|
end
|
22
26
|
cmd = "jarsigner -sigalg MD5withRSA -digestalg SHA1 -signedjar #{test_server_file_name} -storepass #{keystore["keystore_password"]} -keystore \"#{File.expand_path keystore["keystore_location"]}\" #{workspace_dir}/TestServer.apk #{keystore["keystore_alias"]}"
|
23
|
-
system(cmd)
|
27
|
+
unless system(cmd)
|
28
|
+
raise "Could not sign test server"
|
29
|
+
end
|
24
30
|
end
|
25
31
|
puts "Done signing the test server. Moved it to #{test_server_file_name}"
|
26
32
|
end
|
Binary file
|