fastlane-plugin-match_keystore 0.1.15 → 0.1.16
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aaedb3d25e8614b96c43af4e88ddbc46f56e71a7a97a92d2336507afc3afded8
|
4
|
+
data.tar.gz: 741fc33e956879046126da3fec54cb6f939b34eb8859e22d27244de8a7e6f823
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0d3ef8b5d0b9c5a66fcc8bece867e8d230e9f44764b963774cbdfbe110b38f7ef2446bf9592fd913716da8267471ef1cb7d2b6d30a70e494ef8ae75d78c84a9
|
7
|
+
data.tar.gz: 37849dd986d716d6ce16ab7fe8af4f3d18d7b8c3a1840f6f7d4ccade7121b7ced9ac2085e486c8c4442da6f7bf76435ac7581267a730bb204619f5c41d8b558a
|
@@ -63,17 +63,31 @@ module Fastlane
|
|
63
63
|
android_home
|
64
64
|
end
|
65
65
|
|
66
|
-
def self.
|
66
|
+
def self.get_build_tools_version(targeted_version)
|
67
|
+
path = self.get_build_tools(targeted_version)
|
68
|
+
version = path.split('/').last
|
69
|
+
version
|
70
|
+
end
|
71
|
+
|
72
|
+
def self.get_build_tools(targeted_version)
|
67
73
|
android_home = self.get_android_home()
|
68
74
|
build_tools_root = File.join(android_home, '/build-tools')
|
69
75
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
build_tools_last_version = sub_dir
|
76
|
+
build_tools_path = ""
|
77
|
+
if !targeted_version.to_s.strip.empty?
|
78
|
+
build_tools_path = File.join(build_tools_root, "/#{targeted_version}/")
|
74
79
|
end
|
75
80
|
|
76
|
-
|
81
|
+
if !File.directory?(build_tools_path)
|
82
|
+
sub_dirs = Dir.glob(File.join(build_tools_root, '*', ''))
|
83
|
+
build_tools_last_version = ''
|
84
|
+
for sub_dir in sub_dirs
|
85
|
+
build_tools_last_version = sub_dir
|
86
|
+
end
|
87
|
+
build_tools_path = build_tools_last_version
|
88
|
+
end
|
89
|
+
|
90
|
+
build_tools_path
|
77
91
|
end
|
78
92
|
|
79
93
|
def self.check_ssl_version(forceOpenSSL)
|
@@ -231,9 +245,9 @@ module Fastlane
|
|
231
245
|
|
232
246
|
end
|
233
247
|
|
234
|
-
def self.sign_apk(apk_path, keystore_path, key_password, alias_name, alias_password, zip_align)
|
248
|
+
def self.sign_apk(apk_path, keystore_path, key_password, alias_name, alias_password, zip_align, version_targeted)
|
235
249
|
|
236
|
-
build_tools_path = self.get_build_tools()
|
250
|
+
build_tools_path = self.get_build_tools(version_targeted)
|
237
251
|
UI.message("Build-tools path: #{build_tools_path}")
|
238
252
|
|
239
253
|
# https://developer.android.com/studio/command-line/zipalign
|
@@ -260,7 +274,13 @@ module Fastlane
|
|
260
274
|
# https://developer.android.com/studio/command-line/apksigner
|
261
275
|
`rm -f '#{apk_path_signed}'`
|
262
276
|
UI.message("Signing APK: #{apk_path_aligned}")
|
263
|
-
|
277
|
+
apksigner_opts = ""
|
278
|
+
build_tools_version = self.get_build_tools_version(version_targeted)
|
279
|
+
UI.message("Build-tools version: #{build_tools_version}")
|
280
|
+
if Gem::Version.new(build_tools_version) >= Gem::Version.new('30')
|
281
|
+
apksigner_opts = "--v4-signing-enabled false "
|
282
|
+
end
|
283
|
+
output = `#{build_tools_path}apksigner sign --ks '#{keystore_path}' --ks-key-alias '#{alias_name}' --ks-pass pass:'#{key_password}' --key-pass pass:'#{alias_password}' --v1-signing-enabled true --v2-signing-enabled true #{apksigner_opts}--out '#{apk_path_signed}' '#{apk_path_aligned}'`
|
264
284
|
puts ""
|
265
285
|
puts output
|
266
286
|
|
@@ -346,6 +366,7 @@ module Fastlane
|
|
346
366
|
keystore_data = params[:keystore_data]
|
347
367
|
clear_keystore = params[:clear_keystore]
|
348
368
|
unit_test = params[:unit_test]
|
369
|
+
build_tools_version = params[:build_tools_version]
|
349
370
|
|
350
371
|
# Test OpenSSL/LibreSSL
|
351
372
|
if unit_test
|
@@ -558,7 +579,8 @@ module Fastlane
|
|
558
579
|
key_password,
|
559
580
|
alias_name,
|
560
581
|
alias_password,
|
561
|
-
true # Zip align
|
582
|
+
true, # Zip align
|
583
|
+
build_tools_version # Buil-tools version
|
562
584
|
)
|
563
585
|
puts ''
|
564
586
|
end
|
@@ -636,6 +658,11 @@ module Fastlane
|
|
636
658
|
description: "Required data to import an existing keystore, or create a new one",
|
637
659
|
optional: true,
|
638
660
|
type: String),
|
661
|
+
FastlaneCore::ConfigItem.new(key: :build_tools_version,
|
662
|
+
env_name: "MATCH_KEYSTORE_BUILD_TOOLS_VERSION",
|
663
|
+
description: "Set built-tools version (by default latest available on machine)",
|
664
|
+
optional: true,
|
665
|
+
type: String),
|
639
666
|
FastlaneCore::ConfigItem.new(key: :clear_keystore,
|
640
667
|
env_name: "MATCH_KEYSTORE_CLEAR",
|
641
668
|
description: "Clear the local keystore (false by default)",
|