From 25252de8a5c82f782e819a4d095c7ced6dcfdf4f Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Mon, 7 Oct 2019 14:24:05 +0900 Subject: [PATCH] Assign nil surely if no signature is found --- lib/android_apk.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/android_apk.rb b/lib/android_apk.rb index d53a0e5..05baace 100644 --- a/lib/android_apk.rb +++ b/lib/android_apk.rb @@ -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