Skip to content

Commit

Permalink
Merge 4f2a918 into 24f5cb3
Browse files Browse the repository at this point in the history
  • Loading branch information
beplaya committed Nov 11, 2013
2 parents 24f5cb3 + 4f2a918 commit c192ac3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
10 changes: 7 additions & 3 deletions lib/brazenhead/builder.rb
Expand Up @@ -55,9 +55,13 @@ def driver_path_for(file)
end

def update_test_manifest
replace android_manifest, /\btargetPackage="[^"]+"/, "targetPackage=\"#{the_target}\""
replace android_manifest, /\bpackage="[^"]+"/, "package=\"#{the_target}.brazenhead\""
update_manifest test_apk, android_manifest, manifest_info.target_sdk
begin
replace android_manifest, /\btargetPackage="[^"]+"/, "targetPackage=\"#{the_target}\""
replace android_manifest, /\bpackage="[^"]+"/, "package=\"#{the_target}.brazenhead\""
update_manifest test_apk, android_manifest, manifest_info.target_sdk
rescue ChildProcess::LaunchError
$stderr.print "\nERROR: Could not load manifest with aapt. Perhaps aapt is not in your path?\n"
end
end

def replace(file, match, replacement)
Expand Down
15 changes: 12 additions & 3 deletions lib/brazenhead/signer.rb
Expand Up @@ -7,9 +7,18 @@ module Signer

def sign(apk, keystore)
@keystore = keystore
jarsign(apk)
verify(apk)
process.run(*zipalign(apk), *signed(apk))

begin
jarsign(apk)
verify(apk)
rescue ChildProcess::LaunchError
$stderr.print "\nERROR: Could not execute jarsigner command. Perhaps jarsigner is not in your path?\n"
end
begin
process.run(*zipalign(apk), *signed(apk))
rescue ChildProcess::LaunchError
$stderr.print "\nERROR: Could not execute zipalign command. Perhaps zipalign is not in your path?\n"
end
end

private
Expand Down

0 comments on commit c192ac3

Please sign in to comment.