Class: Fastlane::Actions::FivSignAndroidAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::FivSignAndroidAction
- Defined in:
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_sign_android.rb
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .return_value ⇒ Object
- .run_silent(command) ⇒ Object
Class Method Summary collapse
Class Method Details
.authors ⇒ Object
111 112 113 114 |
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_sign_android.rb', line 111 def self. # So no one will ever forget your contribution to fastlane :) You are awesome btw! ["Your GitHub/Twitter Name"] end |
.available_options ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_sign_android.rb', line 54 def self. # Define all options your action supports. # Below a few examples [ FastlaneCore::ConfigItem.new(key: :output_directory, env_name: "ANDROID_KEYSTORE_OUTPUT_DIRECTORY", description: "", is_string: true, optional: false, default_value: File.absolute_path(File.join(Dir.pwd, ".android_signing"))), FastlaneCore::ConfigItem.new(key: :keystore_name, env_name: "ANDROID_KEYSTORE_KEYSTORE_NAME", description: "", is_string: true, optional: false), FastlaneCore::ConfigItem.new(key: :alias, env_name: "ANDROID_KEYSTORE_KEYSTORE_ALIAS", description: "", is_string: true, optional: false), FastlaneCore::ConfigItem.new( key: :version, env_name: "CURRENT_BUILD_VERSION", description: "current build version from config.xml", is_string: true, default_value: '' ), FastlaneCore::ConfigItem.new( key: :build_no, env_name: "CURRENT_BUILD_NUMBER", description: "current build number from config.xml", is_string: true, default_value: '' ), FastlaneCore::ConfigItem.new( key: :silent, env_name: "SIGN_ANDROID_SLIENT", description: "wether to sign android silently", is_string: false, default_value: true ) ] end |
.description ⇒ Object
40 41 42 |
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_sign_android.rb', line 40 def self.description "A short description with <= 80 characters of what this action does" end |
.details ⇒ Object
48 49 50 51 52 |
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_sign_android.rb', line 48 def self.details # Optional: # this is your chance to provide a more detailed description of this action "You can use this action to do cool things..." end |
.is_supported?(platform) ⇒ Boolean
116 117 118 |
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_sign_android.rb', line 116 def self.is_supported?(platform) platform == :android end |
.output ⇒ Object
99 100 101 102 103 104 105 |
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_sign_android.rb', line 99 def self.output # Define the shared values you are going to provide # Example [ ['FIV_BUILD_IONIC_ANDROID_CUSTOM_VALUE', 'A description of what this value contains'] ] end |
.return_value ⇒ Object
107 108 109 |
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_sign_android.rb', line 107 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fastlane/plugin/fivethree_ionic/actions/fiv_sign_android.rb', line 9 def self.run(params) keystore_path = Fastlane::Actions::FivAndroidKeystoreAction.run(params) keychain_entry = CredentialsManager::AccountManager.new(user: "#{params[:keystore_name]}_android_keystore_storepass") keystore_storepass = keychain_entry.password keychain_entry = CredentialsManager::AccountManager.new(user: "#{params[:keystore_name]}_android_keystore_keypass") keystore_keypass = keychain_entry.password puts "Silent execution of jarsigner because we don't want to print passwords. You can delete the password if they are wrong stored in the keychain: 'fastlane fastlane-credentials remove --username android_keystore_storepass' and 'fastlane fastlane-credentials remove --username android_keystore_keypass'" sign = "jarsigner -tsa http://timestamp.digicert.com -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore #{keystore_path} -storepass #{keystore_storepass} -keypass #{keystore_keypass} ./platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk fivethree" path = "./platforms/android/app/build/outputs/apk/release/app-release-#{params[:version]}-#{params[:build_no]}.apk" zipalign = "$ANDROID_SDK/build-tools/$ANDROID_BUILD_TOOL_VERSION/zipalign -v 4 \"./platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk\" \"#{path}\"" if params[:silent] self.run_silent(sign) self.run_silent(zipalign) else sh sign sh zipalign end return path end |