Skip to content

Commit

Permalink
Merge branch 'feature/publish-to-accrescent' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
SailReal committed Jan 23, 2025
2 parents 5d58041 + 1a8fc37 commit a9f66d8
Show file tree
Hide file tree
Showing 14 changed files with 116 additions and 9 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem "fastlane"
gem "net-sftp"
gem "ed25519"
gem "bcrypt_pbkdf"
gem 'fastlane-plugin-bundletool'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ GEM
apktools (~> 0.7)
aws-sdk-s3 (~> 1)
mime-types (~> 3.3)
fastlane-plugin-bundletool (1.1.0)
fastlane-plugin-get_version_name (0.2.2)
fastlane-sirp (1.0.0)
sysrandom (~> 1.0)
Expand Down Expand Up @@ -236,6 +237,7 @@ DEPENDENCIES
ed25519
fastlane
fastlane-plugin-aws_s3
fastlane-plugin-bundletool
fastlane-plugin-get_version_name
net-sftp

Expand Down
15 changes: 14 additions & 1 deletion data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ android {
lite {
dimension "version"
}

accrescent {
dimension "version"
}
}

sourceSets {
Expand All @@ -68,12 +72,16 @@ android {
}

fdroid {
java.srcDirs = ['src/main/java/', 'src/apiKey/java/', 'src/fdroid/java/']
java.srcDirs = ['src/main/java/', 'src/apiKey/java/', 'src/fdroidAccrescent/java/']
}

lite {
java.srcDirs = ['src/main/java/', 'src/lite/java/']
}

accrescent {
java.srcDirs = ['src/main/java/', 'src/apiKey/java/', 'src/fdroidAccrescent/java/']
}
}
packagingOptions {
resources {
Expand Down Expand Up @@ -106,6 +114,7 @@ dependencies {
playstoreImplementation dependencies.pcloud
apkstoreImplementation dependencies.pcloud
fdroidImplementation dependencies.pcloud
accrescentImplementation dependencies.pcloud

coreLibraryDesugaring dependencies.coreDesugaring

Expand All @@ -127,14 +136,18 @@ dependencies {
apkstoreImplementation dependencies.dropboxAndroid
fdroidImplementation dependencies.dropboxCore
fdroidImplementation dependencies.dropboxAndroid
accrescentImplementation dependencies.dropboxCore
accrescentImplementation dependencies.dropboxAndroid


playstoreImplementation dependencies.msgraphAuth
apkstoreImplementation dependencies.msgraphAuth
fdroidImplementation dependencies.msgraphAuth
accrescentImplementation dependencies.msgraphAuth
playstoreImplementation dependencies.msgraph
apkstoreImplementation dependencies.msgraph
fdroidImplementation dependencies.msgraph
accrescentImplementation dependencies.msgraph

implementation dependencies.stax
api dependencies.minIo
Expand Down
36 changes: 36 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ platform :android do |options|
deployToServer(alpha:options[:alpha], beta:options[:beta])
deployToFDroid(alpha:options[:alpha], beta:options[:beta])
deployLite(alpha:options[:alpha], beta:options[:beta])
deployToAccrescent(alpha:options[:alpha], beta:options[:beta])
createGitHubDraftRelease(alpha:options[:alpha], beta:options[:beta])

slack(
Expand Down Expand Up @@ -292,6 +293,41 @@ platform :android do |options|
FileUtils.cp(lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], "release/Cryptomator-#{version}_fdroid_signed.apk")
end

desc "Deploy new version to Accrescent"
private_lane :deployToAccrescent do |options|
gradle(task: "clean")

gradle(
task: "bundle",
build_type: "Release",
flavor: "accrescent",
print_command: false,
properties: {
"android.injected.signing.store.file" => ENV["SIGNING_KEYSTORE_PATH"],
"android.injected.signing.store.password" => ENV["SIGNING_KEYSTORE_PASSWORD"],
"android.injected.signing.key.alias" => ENV["SIGNING_KEY_ALIAS"],
"android.injected.signing.key.password" => ENV["SIGNING_KEY_PASSWORD"],
}
)

FileUtils.cp(lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH], "release/Cryptomator-#{version}_signed.aab")

bundletool(
ks_path: ENV["SIGNING_KEYSTORE_PATH"],
ks_password: ENV["SIGNING_KEYSTORE_PASSWORD"],
ks_key_alias: ENV["SIGNING_KEY_ALIAS"],
ks_key_alias_password: ENV["SIGNING_KEY_PASSWORD"],
bundletool_version: '1.10.0',
aab_path: lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH],
apk_output_path: "fastlane/release/Cryptomator-#{version}_signed.apks",
verbose: true,
cache_path: "~/.cache/bundletool",
universal_apk: false
)

puts "Upload fastlane/release/Cryptomator-#{version}_signed.apks to Accrescent"
end

desc "Deploy new lite version"
private_lane :deployLite do |options|
sh("docker build -t cryptomator-android ../buildsystem")
Expand Down
16 changes: 14 additions & 2 deletions presentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ android {
applicationIdSuffix ".lite"
resValue "string", "app_id", androidApplicationId + applicationIdSuffix
}

accrescent {
dimension "version"
}
}

sourceSets {
Expand All @@ -116,11 +120,15 @@ android {
}

fdroid {
java.srcDirs = ['src/main/java/', 'src/apiKey/java/', 'src/fdroid/java/', 'src/fdroidAndLite/java/']
java.srcDirs = ['src/main/java/', 'src/apiKey/java/', 'src/fdroid/java/', 'src/fdroidLiteAccrescent/java/']
}

lite {
java.srcDirs = ['src/main/java/', 'src/lite/java/', 'src/fdroidAndLite/java/']
java.srcDirs = ['src/main/java/', 'src/lite/java/', 'src/fdroidLiteAccrescent/java/']
}

accrescent {
java.srcDirs = ['src/main/java/', 'src/apiKey/java/', 'src/accrescent/java/', 'src/fdroidLiteAccrescent/java/']
}
}

Expand Down Expand Up @@ -184,13 +192,17 @@ dependencies {
apkstoreImplementation dependencies.dropboxAndroid
fdroidImplementation dependencies.dropboxCore
fdroidImplementation dependencies.dropboxAndroid
accrescentImplementation dependencies.dropboxCore
accrescentImplementation dependencies.dropboxAndroid

playstoreImplementation dependencies.msgraphAuth
apkstoreImplementation dependencies.msgraphAuth
fdroidImplementation dependencies.msgraphAuth
accrescentImplementation dependencies.msgraphAuth
playstoreImplementation dependencies.msgraph
apkstoreImplementation dependencies.msgraph
fdroidImplementation dependencies.msgraph
accrescentImplementation dependencies.msgraph

playstoreImplementation(dependencies.googleApiServicesDrive) {
exclude module: 'guava-jdk5'
Expand Down
39 changes: 39 additions & 0 deletions presentation/src/accrescent/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- Keep in sync with apkstore, playstore and fdroid -->
<application>
<activity
android:name="com.dropbox.core.android.AuthActivity"
android:configChanges="orientation|keyboard"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<data android:scheme="db-${DROPBOX_API_KEY}" />

<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity
android:name="com.microsoft.identity.client.BrowserTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="org.cryptomator"
android:path="/${ONEDRIVE_API_KEY_DECODED}"
android:scheme="msauth" />
</intent-filter>
</activity>

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class CryptomatorApp : MultiDexApplication(), HasComponent<ApplicationComponent>
"apkstore" -> "APK Store Edition"
"fdroid" -> "F-Droid Edition"
"lite" -> "F-Droid Main Repo Edition"
"accrescent" -> "Accrescent Edition"
else -> "Google Play Edition"
}
Timber.tag("App").i(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ChooseCloudServicePresenter @Inject constructor( //
val cloudTypeModels: MutableList<CloudTypeModel> = ArrayList(listOf(*CloudTypeModel.values()))
cloudTypeModels.remove(CloudTypeModel.CRYPTO)

if (BuildConfig.FLAVOR == "fdroid") {
if (BuildConfig.FLAVOR == "fdroid" || BuildConfig.FLAVOR == "accrescent") {
cloudTypeModels.remove(CloudTypeModel.GOOGLE_DRIVE)
} else if (BuildConfig.FLAVOR == "lite") {
cloudTypeModels.remove(CloudTypeModel.GOOGLE_DRIVE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class CloudSettingsPresenter @Inject constructor( //
override fun onSuccess(clouds: List<Cloud>) {
val cloudModel = cloudModelMapper.toModels(clouds) //
.filter { isSingleLoginCloud(it) } //
.filter { cloud -> !(BuildConfig.FLAVOR == "fdroid" && cloud.cloudType() == CloudTypeModel.GOOGLE_DRIVE) } //
.filter { cloud -> !((BuildConfig.FLAVOR == "fdroid" || BuildConfig.FLAVOR == "accrescent") && cloud.cloudType() == CloudTypeModel.GOOGLE_DRIVE) } //
.toMutableList() //
.also {
it.add(aOnedriveCloud())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ class SettingsPresenter @Inject internal constructor(
"F-Droid"
}
"lite" -> {
"F-Droid Main Repo Edition"
"F-Droid Main Repo"
}
"accrescent" -> {
"Accrescent"
}
else -> "Google Play"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class VaultListPresenter @Inject constructor( //
}

private fun checkLicense() {
if (BuildConfig.FLAVOR == "apkstore" || BuildConfig.FLAVOR == "fdroid" || BuildConfig.FLAVOR == "lite") {
if (BuildConfig.FLAVOR == "apkstore" || BuildConfig.FLAVOR == "fdroid" || BuildConfig.FLAVOR == "lite" || BuildConfig.FLAVOR == "accrescent") {
licenseCheckUseCase //
.withLicense("") //
.run(object : NoOpResultHandler<LicenseCheck>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
(findPreference(SharedPreferencesHandler.MAIL) as Preference?)?.title = format(getString(R.string.screen_settings_license_mail), sharedPreferencesHandler.mail())
setupUpdateCheck()
}
"fdroid", "lite" -> {
"fdroid", "lite", "accrescent" -> {
(findPreference(SharedPreferencesHandler.MAIL) as Preference?)?.title = format(getString(R.string.screen_settings_license_mail), sharedPreferencesHandler.mail())
removeUpdateCheck()
}
Expand Down Expand Up @@ -215,7 +215,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
}

private fun setupCryptomatorVariants() {
if (BuildConfig.FLAVOR == "playstore") {
if (BuildConfig.FLAVOR == "playstore" || BuildConfig.FLAVOR == "accrescent") {
(findPreference(CRYPTOMATOR_VARIANTS) as Preference?)?.let { preference ->
(findPreference(getString(R.string.screen_settings_section_general)) as PreferenceCategory?)?.removePreference(preference)
}
Expand Down

0 comments on commit a9f66d8

Please sign in to comment.