Skip to content

Commit

Permalink
Version 0.3.0.pre6
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasmaturana committed Sep 28, 2012
1 parent ce0fef7 commit 1ddcfd3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ staging
instrumentation_backend/.settings
instrumentation_backend/assets/foo.bar
*.png
ruby-gem/pkg
*.swp
**/.DS_STORE
ruby-gem/pkg
ruby-gem/lib/calabash-android/lib/TestServer.apk
.rbenv-version
calabash-android-*.gem
14 changes: 10 additions & 4 deletions ruby-gem/bin/calabash-android-build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,23 @@ def calabash_build(app)
FileUtils.cp(unsigned_test_apk, "TestServer.apk")
FileUtils.cp(File.join(File.dirname(__FILE__), '..', 'test-server/AndroidManifest.xml'), "AndroidManifest.xml")

system %Q{ruby -pi.bak -e "gsub(/#targetPackage#/, '#{package_name(app)}')" AndroidManifest.xml}

system("#{ENV["ANDROID_HOME"]}/platform-tools/aapt package -M AndroidManifest.xml -I #{android_platform}/android.jar -F dummy.apk")
unless system %Q{ruby -pi.bak -e "gsub(/#targetPackage#/, '#{package_name(app)}')" AndroidManifest.xml}
raise "Could not replace package name in manifest"
end

unless system("#{ENV["ANDROID_HOME"]}/platform-tools/aapt package -M AndroidManifest.xml -I #{android_platform}/android.jar -F dummy.apk")
raise "Could not create dummy.apk"
end

Zip::ZipFile.new("dummy.apk").extract("AndroidManifest.xml","customAndroidManifest.xml")
Zip::ZipFile.open("TestServer.apk") do |zip_file|
zip_file.add("AndroidManifest.xml", "customAndroidManifest.xml")
end
end
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"]}"
system(cmd)
unless system(cmd)
raise "Could not sign test server"
end
end
puts "Done signing the test server. Moved it to #{test_server_file_name}"
end
Expand Down
2 changes: 1 addition & 1 deletion ruby-gem/lib/calabash-android/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Calabash
module Android
VERSION = "0.3.0.pre5"
VERSION = "0.3.0.pre6"
end
end

0 comments on commit 1ddcfd3

Please sign in to comment.