Use exodus and Izzys script and test all flavors to detect tracking #358

To sustainably detect such problems early, we are now using exodus next to Izzys script and testing against all build flavors #358
This commit is contained in:
Julian Raufelder 2021-10-01 16:40:56 +02:00
parent 49586ba53f
commit a6fcde64e0
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D
6 changed files with 69 additions and 38 deletions

6
.gitignore vendored
View File

@ -49,6 +49,6 @@ local.properties
# fdroid # fdroid
**/fastlane/repo/** **/fastlane/repo/**
**/fastlane/tmp/** **/fastlane/tmp/**
**/fastlane/iod-scan-apk.php **/fastlane/izzyscript/iod-scan-apk.php
**/fastlane/current_iod-scan-apk.php **/fastlane/izzyscript/current_iod-scan-apk.php
**/fastlane/current_result.json **/fastlane/izzyscript/current_result_*.json

View File

@ -65,6 +65,9 @@ platform :android do |options|
} }
) )
checkTrackingAddedInDependencyUsingIzzyScript(alpha:options[:alpha], beta:options[:beta], flavor: 'playstore')
checkTrackingAddedInDependencyUsingExodus(alpha:options[:alpha], beta:options[:beta], flavor: 'playstore')
upload_to_play_store( upload_to_play_store(
track: deploy_target, track: deploy_target,
apk: lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], apk: lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
@ -100,6 +103,9 @@ platform :android do |options|
} }
) )
checkTrackingAddedInDependencyUsingIzzyScript(alpha:options[:alpha], beta:options[:beta], flavor: 'apkstore')
checkTrackingAddedInDependencyUsingExodus(alpha:options[:alpha], beta:options[:beta], flavor: 'apkstore')
FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "release/Cryptomator-#{version}.apk") FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "release/Cryptomator-#{version}.apk")
server_host = ENV["APK_STORE_BASIC_URL"] server_host = ENV["APK_STORE_BASIC_URL"]
@ -182,7 +188,8 @@ platform :android do |options|
} }
) )
checkTrackingAddedInDependency(alpha:options[:alpha], beta:options[:beta]) checkTrackingAddedInDependencyUsingIzzyScript(alpha:options[:alpha], beta:options[:beta], flavor: 'fdroid')
checkTrackingAddedInDependencyUsingExodus(alpha:options[:alpha], beta:options[:beta], flavor: 'fdroid')
if options[:alpha] or options[:beta] if options[:alpha] or options[:beta]
puts "Skipping deployment to F-Droid cause there isn't currently a alpha/beta channel" puts "Skipping deployment to F-Droid cause there isn't currently a alpha/beta channel"
@ -213,9 +220,12 @@ platform :android do |options|
FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "release/Cryptomator-#{version}_fdroid_signed.apk") FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "release/Cryptomator-#{version}_fdroid_signed.apk")
end end
desc "Check if tracking added in some dependency" desc "Check if tracking added in some dependency using Izzy's script"
lane :checkTrackingAddedInDependency do |options| lane :checkTrackingAddedInDependencyUsingIzzyScript do |options|
flavor = options[:flavor]
puts "Check if script file is latest" puts "Check if script file is latest"
Dir.chdir("izzyscript") do
sh("wget -O current_iod-scan-apk.php https://gitlab.com/fdroid/issuebot/-/raw/master/modules/iod-scan-apk.php") 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") same_script = FileUtils.compare_file("iod-scan-apk.php", "current_iod-scan-apk.php")
@ -231,27 +241,41 @@ platform :android do |options|
FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "unsigned/org.cryptomator_fdroid.apk") FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "unsigned/org.cryptomator_fdroid.apk")
sh("ISSUEBOT_CURRENT_APPLICATION_ID=org.cryptomator ISSUEBOT_CURRENT_REPLY_FILE=current_result.json php iod-scan-apk.php") sh("ISSUEBOT_CURRENT_APPLICATION_ID=org.cryptomator ISSUEBOT_CURRENT_REPLY_FILE=current_result_#{flavor}.json php iod-scan-apk.php")
# clean up # clean up
FileUtils.rm("libinfo.txt") FileUtils.rm("libinfo.txt")
FileUtils.rm("libsmali.txt") FileUtils.rm("libsmali.txt")
FileUtils.rm("org.cryptomator_fdroid.apk")
FileUtils.rm_r("unsigned") FileUtils.rm_r("unsigned")
FileUtils.rm_r("org.cryptomator_fdroid") FileUtils.rm_r("org.cryptomator_fdroid")
puts "Check if something changed in the APK regarding the dependencies" puts "Check if something changed in the APK regarding the dependencies"
report = JSON.parse(File.read("result.json"))["report"] report = JSON.parse(File.read("result_#{flavor}.json"))["report"]
current_report = JSON.parse(File.read("current_result.json"))["report"] current_report = JSON.parse(File.read("current_result_#{flavor}.json"))["report"]
if report.eql?(current_report) if report.eql?(current_report)
puts "Dependencies unchanged" puts "Dependencies unchanged"
FileUtils.rm("current_result.json") FileUtils.rm("current_result_#{flavor}.json")
else else
UI.error("Dependencies changed, check result of current_result.json, if no problem, move it to result.json, commit and retry") UI.error("Dependencies changed, check result of current_result.json, if no problem, move it to result.json, commit and retry")
fail fail
end end
end end
end
desc "Check if tracking added in some dependency using exodus"
lane :checkTrackingAddedInDependencyUsingExodus do |options|
FileUtils.mkdir("exodus-test")
FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "exodus-test/org.cryptomator.apk")
puts "Check if a tracking library was added"
sh("docker run -v $(pwd)/exodus-test/org.cryptomator.apk:/app.apk --rm -i exodusprivacy/exodus-standalone | tail -1 | grep -q 'Found trackers: 0'")
FileUtils.rm_r("exodus-test")
end
desc "Create GitHub draft release" desc "Create GitHub draft release"
lane :createGitHubDraftRelease do |options| lane :createGitHubDraftRelease do |options|

View File

@ -41,11 +41,16 @@ Deploy new version to server
fastlane android deployToFDroid fastlane android deployToFDroid
``` ```
Deploy new version to F-Droid Deploy new version to F-Droid
### android checkTrackingAddedInDependency ### android checkTrackingAddedInDependencyUsingIzzyScript
``` ```
fastlane android checkTrackingAddedInDependency fastlane android checkTrackingAddedInDependencyUsingIzzyScript
``` ```
Check if tracking added in some dependency Check if tracking added in some dependency using Izzy's script
### android checkTrackingAddedInDependencyUsingExodus
```
fastlane android checkTrackingAddedInDependencyUsingExodus
```
Check if tracking added in some dependency using exodus
### android createGitHubDraftRelease ### android createGitHubDraftRelease
``` ```
fastlane android createGitHubDraftRelease fastlane android createGitHubDraftRelease

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long