Merge pull request #333 from cryptomator/feature/add-fdroid-iod-apk-scanner

Add F-Droids iod-apk-scanner to Fastlane build process
This commit is contained in:
Julian Raufelder 2021-07-14 17:40:32 +00:00 committed by GitHub
commit 754533ef60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 0 deletions

View File

@ -2,6 +2,7 @@ fastlane_require 'dotenv'
fastlane_require 'jwt'
fastlane_require 'base64'
fastlane_require 'net/sftp'
fastlane_require 'json'
default_platform(:android)
@ -181,6 +182,8 @@ platform :android do |options|
}
)
checkTrackingAddedInDependency(alpha:options[:alpha], beta:options[:beta])
if options[:alpha] or options[:beta]
puts "Skipping deployment to F-Droid cause there isn't currently a alpha/beta channel"
else
@ -210,6 +213,46 @@ platform :android do |options|
FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "release/Cryptomator-#{version}_fdroid_signed.apk")
end
desc "Check if tracking added in some dependency"
lane :checkTrackingAddedInDependency do |options|
puts "Check if script file is latest"
sh("wget -O current_iod-scan-apk.php https://gitlab.com/fdroid/issuebot/-/raw/master/modules/iod-scan-apk.php")
same_script = FileUtils.compare_file("iod-scan-apk.php", "current_iod-scan-apk.php")
if same_script
puts "Script file unchanged"
FileUtils.rm("current_iod-scan-apk.php")
else
UI.error("Script updated, check diff, download and save to iod-scan-apk.php")
fail
end
FileUtils.mkdir("unsigned")
FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "unsigned/org.cryptomator_#{version}.apk")
sh("ISSUEBOT_CURRENT_APPLICATION_ID=org.cryptomator ISSUEBOT_CURRENT_REPLY_FILE=current_result.json php iod-scan-apk.php")
# clean up
FileUtils.rm("libinfo.txt")
FileUtils.rm("libsmali.txt")
FileUtils.rm_r("unsigned")
FileUtils.rm_r("org.cryptomator_#{version}")
puts "Check if something changed in the APK regarding the dependencies"
report = JSON.parse(File.read("result.json"))["report"]
current_report = JSON.parse(File.read("current_result.json"))["report"]
if report.eql?(current_report)
puts "Dependencies unchanged"
FileUtils.rm("current_result.json")
else
UI.error("Dependencies changed, check result of current_result.json, if no problem, move it to result.json, commit and retry")
fail
end
end
desc "Create GitHub draft release"
lane :createGitHubDraftRelease do |options|
target_branch = "main"

View File

@ -41,6 +41,11 @@ Deploy new version to server
fastlane android deployToFDroid
```
Deploy new version to F-Droid
### android checkTrackingAddedInDependency
```
fastlane android checkTrackingAddedInDependency
```
Check if tracking added in some dependency
### android createGitHubDraftRelease
```
fastlane android createGitHubDraftRelease

1
fastlane/result.json Normal file

File diff suppressed because one or more lines are too long