Skip to content

Commit

Permalink
Assign nil surely if no signature is found
Browse files Browse the repository at this point in the history
  • Loading branch information
jmatsu committed Oct 7, 2019
1 parent 11e8e31 commit 25252de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/android_apk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ def self.read_signature(apk, filepath)
if exit_status.success? && !certs_hunk.nil?
signatures = certs_hunk.scan(/(?:[0-9a-zA-Z]{2}:?){20}/)
apk.signature = signatures[0].delete(":").downcase if signatures.length == 1
else
apk.signature = nil # make sure being nil
end
end

Expand Down

0 comments on commit 25252de

Please sign in to comment.