mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
More refactoring
This commit is contained in:
+42
-2
@@ -8,6 +8,10 @@ plugins {
|
||||
id 'dagger.hilt.android.plugin'
|
||||
}
|
||||
|
||||
|
||||
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
|
||||
def buildTime = new Date().format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("GMT+1"))
|
||||
|
||||
android {
|
||||
compileSdkVersion buildConfig.compileSdk
|
||||
|
||||
@@ -18,12 +22,38 @@ android {
|
||||
|
||||
versionCode buildConfig.version.code
|
||||
versionName buildConfig.version.name
|
||||
|
||||
buildConfigField "long", "VERSION_CODE", "${buildConfig.version.code}"
|
||||
buildConfigField "String", "VERSION_NAME", "\"${buildConfig.version.name}\""
|
||||
|
||||
buildConfigField "String", "GITSHA", "\"${gitSha}\""
|
||||
buildConfigField "String", "BUILDTIME", "\"${buildTime}\""
|
||||
}
|
||||
|
||||
flavorDimensions "version"
|
||||
productFlavors {
|
||||
foss {
|
||||
|
||||
}
|
||||
gplay {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
def proguardRulesRelease = fileTree(dir: "../proguard", include: ["*.pro"]).asList().toArray()
|
||||
debug {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
|
||||
proguardFiles proguardRulesRelease
|
||||
proguardFiles 'proguard-rules-debug.pro'
|
||||
}
|
||||
beta {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
|
||||
proguardFiles proguardRulesRelease
|
||||
}
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
|
||||
proguardFiles proguardRulesRelease
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +87,16 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation("com.squareup.moshi:moshi:1.13.0")
|
||||
kapt("com.squareup.moshi:moshi-kotlin-codegen:1.13.0")
|
||||
|
||||
// Debugging
|
||||
implementation('com.bugsnag:bugsnag-android:5.9.2')
|
||||
implementation 'com.getkeepsafe.relinker:relinker:1.4.3'
|
||||
|
||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||
|
||||
// DI
|
||||
implementation "com.google.dagger:dagger:${versions.dagger.core}"
|
||||
implementation "com.google.dagger:dagger-android:${versions.dagger.core}"
|
||||
|
||||
+2
-1
@@ -34,11 +34,12 @@ object BuildConfigWrap {
|
||||
;
|
||||
}
|
||||
|
||||
val APPLICATION_ID = BuildConfig.APPLICATION_ID
|
||||
val APPLICATION_ID: String = TODO()//BuildConfig.APPLICATION_ID
|
||||
|
||||
val VERSION_CODE: Long = BuildConfig.VERSION_CODE.toLong()
|
||||
val VERSION_NAME: String = BuildConfig.VERSION_NAME
|
||||
val GIT_SHA: String = BuildConfig.GITSHA
|
||||
val BUILDTIME: String = BuildConfig.BUILDTIME
|
||||
|
||||
val VERSION_DESCRIPTION_LONG: String = "v$VERSION_NAME ($VERSION_CODE) [$GIT_SHA] ${FLAVOR}_$BUILD_TYPE"
|
||||
val VERSION_DESCRIPTION_SHORT: String = "v$VERSION_NAME [$GIT_SHA] $FLAVOR"
|
||||
+2
-2
@@ -13,6 +13,6 @@ object BuildWrap {
|
||||
}
|
||||
}
|
||||
|
||||
fun hasApiLevel(level: Int): Boolean = BuildWrap.VERSION.SDK_INT >= level
|
||||
fun hasApiLevel(level: Int): Boolean = BuildWrap.VersionWrap.SDK_INT >= level
|
||||
|
||||
fun withinApiLevel(start: Int, end: Int): Boolean = BuildWrap.VERSION.SDK_INT in start..end
|
||||
fun withinApiLevel(start: Int, end: Int): Boolean = BuildWrap.VersionWrap.SDK_INT in start..end
|
||||
-1
@@ -10,7 +10,6 @@ import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import eu.darken.capod.common.debug.logging.Logging.Priority.*
|
||||
import eu.darken.capod.common.debug.logging.log
|
||||
import eu.darken.capod.common.debug.logging.logTag
|
||||
import eu.darken.capod.main.core.ScannerMode
|
||||
import kotlinx.coroutines.channels.awaitClose
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package eu.darken.capod.main.core
|
||||
package eu.darken.capod.common.bluetooth
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import com.squareup.moshi.Json
|
||||
+3
-4
@@ -6,7 +6,6 @@ import android.content.pm.PackageManager
|
||||
import com.bugsnag.android.Event
|
||||
import com.bugsnag.android.OnErrorCallback
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import eu.darken.capod.BuildConfig
|
||||
import eu.darken.capod.common.BuildConfigWrap
|
||||
import eu.darken.capod.common.debug.autoreport.DebugSettings
|
||||
import eu.darken.capod.common.debug.logging.Logging.Priority.WARN
|
||||
@@ -26,13 +25,13 @@ class BugsnagErrorHandler @Inject constructor(
|
||||
bugsnagLogger.injectLog(event)
|
||||
|
||||
TAB_APP.also { tab ->
|
||||
event.addMetadata(tab, "gitSha", BuildConfig.GITSHA)
|
||||
event.addMetadata(tab, "buildTime", BuildConfig.BUILDTIME)
|
||||
event.addMetadata(tab, "gitSha", BuildConfigWrap.GIT_SHA)
|
||||
event.addMetadata(tab, "buildTime", BuildConfigWrap.BUILDTIME)
|
||||
|
||||
context.tryFormattedSignature()?.let { event.addMetadata(tab, "signatures", it) }
|
||||
}
|
||||
|
||||
return debugSettings.isAutoReportingEnabled.value && !BuildConfigWrap.DEBUG
|
||||
return debugSettings.isAutoReportingEnabled.value && !eu.darken.capod.common.BuildConfigWrap.DEBUG
|
||||
}
|
||||
|
||||
companion object {
|
||||
@@ -3,8 +3,6 @@
|
||||
<string name="app_name_pro">CAPod Pro</string>
|
||||
<string name="app_name_foss">CAPod FOSS</string>
|
||||
|
||||
<string name="notification_channel_device_status_label">Device status</string>
|
||||
|
||||
<string name="general_error_label">Error</string>
|
||||
<string name="general_share_action">Share</string>
|
||||
<string name="general_done_action">Done</string>
|
||||
@@ -16,12 +14,6 @@
|
||||
<string name="general_check_action">Check</string>
|
||||
<string name="general_close_action">Close</string>
|
||||
|
||||
<string name="debug_debuglog_size_label">Size</string>
|
||||
<string name="debug_debuglog_size_compressed_label">Compressed size</string>
|
||||
<string name="debug_notification_channel_label">Debug notifications</string>
|
||||
<string name="debug_debuglog_file_label">Recorded log file</string>
|
||||
<string name="debug_debuglog_record_action">Record debug log</string>
|
||||
|
||||
<string name="permission_bluetooth_connect_label">Bluetooth connect</string>
|
||||
<string name="permission_bluetooth_connect_description">This app requires the \"Bluetooth connect\" permission to interact with paired devices and initiate connections.</string>
|
||||
<string name="permission_bluetooth_scan_label">Bluetooth scanning</string>
|
||||
@@ -58,95 +50,10 @@
|
||||
<string name="headset_being_worn_label">Being worn</string>
|
||||
<string name="pods_case_unknown_state">Unknown state</string>
|
||||
|
||||
<string name="overview_nomaindevice_label">No primary device</string>
|
||||
<string name="overview_nomaindevice_description">All detected devices are unlikely to be yours. Power on and connect your device or adjust the settings.</string>
|
||||
<string name="last_seen_x">Last seen: %s</string>
|
||||
<string name="first_seen_x">First seen: %s</string>
|
||||
|
||||
<string name="settings_label">Settings</string>
|
||||
<string name="settings_privacy_policy_label">Privacy policy</string>
|
||||
<string name="settings_privacy_policy_desc">Handling data responsibly.</string>
|
||||
<string name="settings_licenses_label">Licenses</string>
|
||||
<string name="settings_category_other_label">Other</string>
|
||||
<string name="settings_general_label">Settings</string>
|
||||
<string name="settings_general_description">General tweaks that affect the whole app.</string>
|
||||
<string name="settings_acknowledgements_label">Acknowledgements</string>
|
||||
|
||||
<string name="changelog_label">Changelog</string>
|
||||
<string name="settings_support_email_developer_label">Email developer</string>
|
||||
|
||||
<string name="settings_support_installid_label">Install ID</string>
|
||||
<string name="settings_support_installid_desc">Automatic error reports are anonymous. Share your install ID if the developer needs to find your error reports.</string>
|
||||
<string name="settings_support_label">Support</string>
|
||||
<string name="settings_support_description">If you need some help.</string>
|
||||
<string name="issue_tracker_label">Issue tracker</string>
|
||||
<string name="issue_tracker_description">A public issue tracker for bug reports and feature requests (english only).</string>
|
||||
<string name="discord_label">Discord</string>
|
||||
<string name="discord_description">A place to hang out in and ask questions.</string>
|
||||
<string name="settings_support_email_developer_description">Note that I can only respond in german or english.</string>
|
||||
<string name="settings_debug_autoreports_label">Automatic bug reports</string>
|
||||
<string name="settings_debug_autoreports_description">Automatically reports issues, e.g. details on an app crash so I can figure out how to fix it.</string>
|
||||
<string name="settings_debug_mode_label">Debug mode</string>
|
||||
<string name="settings_debug_mode_description">Show additional information to troubleshoot issues.</string>
|
||||
<string name="settings_monitor_mode_label">Monitor mode</string>
|
||||
<string name="settings_monitor_mode_description">Under which circumstances this app monitors Bluetooth data.</string>
|
||||
<string name="settings_scanner_mode_label">Scanner mode</string>
|
||||
<string name="settings_scanner_mode_description">Should the Bluetooth Low Energy data scanner prioritize performance or conserve energy?</string>
|
||||
<string name="settings_monitor_mode_manual_label">When app is open</string>
|
||||
<string name="settings_monitor_mode_automatic_label">When device is connected</string>
|
||||
<string name="settings_monitor_mode_always_label">Always</string>
|
||||
<string name="settings_scanner_mode_lowpower_label">Low power</string>
|
||||
<string name="settings_scanner_mode_balanced_label">Balanced</string>
|
||||
<string name="settings_scanner_mode_lowlatency_label">Low latency</string>
|
||||
<string name="settings_autopause_label">Auto pause</string>
|
||||
<string name="settings_autopause_description">Pause audio when removing the device from your ear.</string>
|
||||
<string name="settings_showall_label">Show all devices</string>
|
||||
<string name="settings_showall_description">Show other people\'s devices that are near you.</string>
|
||||
<string name="settings_autopplay_label">Auto play</string>
|
||||
<string name="settings_autoplay_description">Start audio playback when device is worn.</string>
|
||||
<string name="settings_fake_data_label">Fake data</string>
|
||||
<string name="settings_fake_data_description">Show fake data, i.e., simulate devices that don\’t exist.</string>
|
||||
<string name="settings_debug_label">Debug settings</string>
|
||||
<string name="settings_debug_description">Additional settings to help troubleshoot issues with the app.</string>
|
||||
<string name="settings_signal_minimum_label">Minimum signal quality</string>
|
||||
<string name="settings_signal_minimum_description">The minimum signal quality that a device needs to have to be considered yours.</string>
|
||||
<string name="settings_autoconnect_label">Auto connect</string>
|
||||
<string name="settings_autoconnect_description">If Android does not automatically connect, we can ask it too. This will set the monitor mode setting to \'Always\'.</string>
|
||||
<string name="settings_autoconnect_condition_label">Auto connect condition</string>
|
||||
<string name="settings_autoconnect_condition_description">When should we try to connect to your device?</string>
|
||||
<string name="settings_reaction_label">Reactions</string>
|
||||
<string name="settings_reaction_description">React to events and behaviors.</string>
|
||||
<string name="settings_category_yourdevice_label">Your device</string>
|
||||
<string name="settings_maindevice_address_label">Your device address</string>
|
||||
<string name="settings_maindevice_address_description">The address of your paired device. The app uses this to determine when it is connected to your phone.</string>
|
||||
<string name="settings_maindevice_address_none">None</string>
|
||||
<string name="settings_maindevice_model_label">Your device model</string>
|
||||
<string name="settings_maindevice_model_description">The model of your main device. This helps the app recognize your device when it is not connected to your phone.</string>
|
||||
|
||||
<string name="settings_reaction_autoconnect_whenseen_label">When seen</string>
|
||||
<string name="settings_reaction_autoconnect_caseopen_label">Case is open</string>
|
||||
<string name="settings_reaction_autoconnect_inear_label">In ear</string>
|
||||
|
||||
<string name="upgrade_capod_label">Upgrade CAPod</string>
|
||||
<string name="upgrade_capod_description">Get additional features and support the developer.</string>
|
||||
<string name="settings_popup_caseopen_label">Show popup</string>
|
||||
<string name="settings_popup_caseopen_description">Show a popup when the device case is opened (experimental).</string>
|
||||
<string name="overview_bluetooth_disabled_label">Bluetooth is disabled</string>
|
||||
<string name="overview_bluetooth_disabled_description">Bluetooth is disabled, enable it ;)</string>
|
||||
<string name="help_translate_label">Translation</string>
|
||||
<string name="help_translate_description">Help translate this app into your favorite language.</string>
|
||||
<string name="settings_onepod_mode_label">One pod mode</string>
|
||||
<string name="settings_onepod_mode_description">Wearing both pods is not required, wearing a single pod is sufficient to trigger reactions.</string>
|
||||
<string name="permission_system_alert_window_label">System Alert Window</string>
|
||||
<string name="permission_system_alert_window_description">Allow CAPod to draw over other apps to make the feature \"Show PopUp\" possible.</string>
|
||||
<string name="last_seen_x">Last seen: %s</string>
|
||||
<string name="first_seen_x">First seen: %s</string>
|
||||
<string name="settings_blescanner_unfiltered_label">Unfiltered BLE data</string>
|
||||
<string name="settings_blescanner_unfiltered_description">Remove any filters from the BLE scanner to show all broadcasted BLE data. Useful to add support for new headphone types.</string>
|
||||
<string name="permission_required_title">The following permission is required:</string>
|
||||
<string name="settings_compatibility_mode_label">Compatibility mode</string>
|
||||
<string name="settings_compatibility_mode_description">Disable optimizations to improve compatibility. Try this if you are not seeing any data.</string>
|
||||
<string name="translators_thanks_title">Translators</string>
|
||||
<string name="translators_thanks_description">darken</string>
|
||||
|
||||
<string name="wear_service_label">CAPod for WearOS</string>
|
||||
<string name="wear_service_description">View details about your AirPood devices on your WearOS device.</string>
|
||||
</resources>
|
||||
@@ -5,6 +5,7 @@ import android.content.SharedPreferences
|
||||
import androidx.preference.PreferenceDataStore
|
||||
import com.squareup.moshi.Moshi
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import eu.darken.capod.common.bluetooth.ScannerMode
|
||||
import eu.darken.capod.common.debug.autoreport.DebugSettings
|
||||
import eu.darken.capod.common.preferences.PreferenceStoreMapper
|
||||
import eu.darken.capod.common.preferences.Settings
|
||||
|
||||
+1
-1
@@ -8,12 +8,12 @@ import androidx.preference.ListPreference
|
||||
import androidx.preference.Preference
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import eu.darken.capod.R
|
||||
import eu.darken.capod.common.bluetooth.ScannerMode
|
||||
import eu.darken.capod.common.preferences.PercentSliderPreference
|
||||
import eu.darken.capod.common.uix.PreferenceFragment2
|
||||
import eu.darken.capod.common.upgrade.UpgradeRepo
|
||||
import eu.darken.capod.main.core.GeneralSettings
|
||||
import eu.darken.capod.main.core.MonitorMode
|
||||
import eu.darken.capod.main.core.ScannerMode
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import javax.inject.Inject
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.bluetooth.le.ScanFilter
|
||||
import eu.darken.capod.common.bluetooth.BleScanResult
|
||||
import eu.darken.capod.common.bluetooth.BleScanner
|
||||
import eu.darken.capod.common.bluetooth.BluetoothManager2
|
||||
import eu.darken.capod.common.bluetooth.ScannerMode
|
||||
import eu.darken.capod.common.coroutine.AppScope
|
||||
import eu.darken.capod.common.debug.autoreport.DebugSettings
|
||||
import eu.darken.capod.common.debug.logging.Logging.Priority.VERBOSE
|
||||
@@ -13,7 +14,6 @@ import eu.darken.capod.common.debug.logging.log
|
||||
import eu.darken.capod.common.debug.logging.logTag
|
||||
import eu.darken.capod.common.flow.replayingShare
|
||||
import eu.darken.capod.main.core.GeneralSettings
|
||||
import eu.darken.capod.main.core.ScannerMode
|
||||
import eu.darken.capod.pods.core.PodDevice
|
||||
import eu.darken.capod.pods.core.PodFactory
|
||||
import eu.darken.capod.pods.core.apple.protocol.ProximityPairing
|
||||
|
||||
@@ -5,17 +5,6 @@
|
||||
|
||||
<string name="notification_channel_device_status_label">Device status</string>
|
||||
|
||||
<string name="general_error_label">Error</string>
|
||||
<string name="general_share_action">Share</string>
|
||||
<string name="general_done_action">Done</string>
|
||||
<string name="general_copy_action">Copy</string>
|
||||
<string name="general_thank_you_label">Thank you</string>
|
||||
<string name="general_value_not_available_label">N/A</string>
|
||||
<string name="general_grant_permission_action">Grant permission</string>
|
||||
<string name="general_upgrade_action">Upgrade</string>
|
||||
<string name="general_check_action">Check</string>
|
||||
<string name="general_close_action">Close</string>
|
||||
|
||||
<string name="debug_debuglog_size_label">Size</string>
|
||||
<string name="debug_debuglog_size_compressed_label">Compressed size</string>
|
||||
<string name="debug_notification_channel_label">Debug notifications</string>
|
||||
@@ -93,9 +82,7 @@
|
||||
<string name="settings_monitor_mode_manual_label">When app is open</string>
|
||||
<string name="settings_monitor_mode_automatic_label">When device is connected</string>
|
||||
<string name="settings_monitor_mode_always_label">Always</string>
|
||||
<string name="settings_scanner_mode_lowpower_label">Low power</string>
|
||||
<string name="settings_scanner_mode_balanced_label">Balanced</string>
|
||||
<string name="settings_scanner_mode_lowlatency_label">Low latency</string>
|
||||
|
||||
<string name="settings_autopause_label">Auto pause</string>
|
||||
<string name="settings_autopause_description">Pause audio when removing the device from your ear.</string>
|
||||
<string name="settings_showall_label">Show all devices</string>
|
||||
|
||||
Reference in New Issue
Block a user