mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-29 11:17:47 +00:00
7a773016da
* feat: start new app theming feature * feat: add some theming colours * refactor: start refactoring themes and colours to use dynamic attributes * feat: adding more colours and switching over default colours to be theme based instead of hard-coded or day/night specific * refactor: take a look at ocean light and logo colour * feat: global search colours for light and dark ocean * feat: more styling * feat: adding themes to conversation activity and refactoring the base theme to apply over the top of the activity's theme so it retains noActionBar etc * feat: add dynamic accent color * docs: add todo for changing how accent colour is applied * feat: update new theming to use override primary style so that the regular colorAccent attribute can be used in existing layouts * feat: coordinating styles across layouts, fixing up pinned icons and naming for conversation list items * refactor: re-styling layouts to match new themes and attributes. Need to figure out action mode close button * refactor: remove @color/text and replace with ?android:textColorPrimary to override in themes * refactor: add context theme wrapper to bottom sheet dialog that references accent color * fix: input bar bug fix and preference activity themes * refactor: new settings menu options * fix: crash for PNModeActivity.kt refactor: move ordering in seed dialog to match designs, copy changes to match new settings menu * feat: add new appearance settings activity * refactor: title and VM changes * fix: correct override * feat: add theme appearance screen UI features and start VM implementation. re-add legacy theme utils to get default for migration * fix: compile errors and missing themes from emoji features * refactor: remove background shape alteration and old bottom sheet styles, re-add the theme mode attr * feat: appearance screen wired up, just need to refresh theme * feat: add theme state recreation and fix match system settings option * refactor: add bottom margin * feat: explore custom preference category * feat: add the customized session theme for CorrectedPreferenceFragment * feat: replace AppProtectionPreferenceFragment to extend ListSummaryPreferenceFragment * refactor: change drawable style and remove explicit dividers * refactor: remove divider in CorrectedPreferenceFragment * feat: add theme state check on resume, might be jarring currently * feat: add preference divider elements for settings menu * refactor: settings menu redesigns * refactor: change led preference to integer and refactor TextSecurePreferences.kt * feat: add scroll parcel to save/restore hierarchy on restart with appearance changes * feat: add the conversations blocked contacts and refactor preference order and copy * feat: add blocked contacts activity, basic layout and vm * feat: add unblock DB functions and storage protocol, start working on the DB query state flow, might have to just implement recipient on modified listener * feat: add blocked contacts and notif recipient listeners * feat: add recipient db reader * feat: add blocked contact interactions and fix a theming crash for notifications * feat: introduce better equals and hashcode implementations to recipient, replace home diff util content check with hashcode-based comparison * feat: add settings menu vectors * fix: preview compile error * refactor: migrating settings menu to new designs * feat: help menu * refactor: simplify link opening * refactor: remove space * feat: refactor preferences and start theming for light mode options * refactor: fixing dark and light modes with dialogs * refactor: popup dialogs use proper themes now * refactor: alert dialogs and media edit fragments use attribute references * refactor: use input bar button attribute instead color control normal in vector tint * refactor: transparency, dialog fixes, notification fix * refactor: attrs and styles for buttons * fix: use prominent button color on the outline button's border * fix: fix the trash * refactor: remove the appearance * refactor: avatar placeholder generation, chips and element border styles * refactor: use colors instead of style references * refactor: theming changes to match designs and feedback * refactor: the titles are bold and the categories are tertiary coloured now * fix: appearance settings match preferences, search bottom bar uses themed attributes * refactor: increase setting button height * Update clear all data dialog * Update seed dialog * refactor: more qa feedback changes * feat: add new TLs and fa-rIR TLs * Update notification content dialog * Fix message requests clear all button text color * feat: re-add screenshot observer * refactor: make send tint accent color * feat: add unread background differences * fix: change unread count indicator * build: upgrade build numbers * Fix message requests popupmenu background color * fix: crash from attr reference in color attribute * build: upgrade build number * fix: message bubbles, thumbnail backgrounds, search bar visibility with input bar, attachment buttons * fix: tertiary text for keyboard page search view * fix: emoji overflow colour differences * fix: reaction pill dialog background is now correct colour * Add style to reactions tab layout * fix: appearance activity reverting primary color at correct time * fix: show call privacy warning every time instead of just once * fix: gradient background(?) and audio autoplay disable * fix: crash in all media containing documents * fix: reaction dialog heading fixes * Add style to reactions tab layout * fix: remove gradient backgrounds * fix: adding new reaction normal text attribute to try correct the tab layout * fix: ocean dark unread/read colours * build; update build number * build: update build number Co-authored-by: charles <charles@oxen.io>
313 lines
13 KiB
Groovy
313 lines
13 KiB
Groovy
buildscript {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:4.2.2'
|
|
classpath files('libs/gradle-witness.jar')
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
|
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion"
|
|
classpath "com.google.gms:google-services:4.3.10"
|
|
classpath "com.google.dagger:hilt-android-gradle-plugin:$daggerVersion"
|
|
}
|
|
}
|
|
|
|
apply plugin: 'com.android.application'
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'witness'
|
|
apply plugin: 'kotlin-kapt'
|
|
apply plugin: 'kotlin-parcelize'
|
|
apply plugin: 'com.google.gms.google-services'
|
|
apply plugin: 'kotlinx-serialization'
|
|
apply plugin: 'dagger.hilt.android.plugin'
|
|
|
|
configurations.all {
|
|
exclude module: "commons-logging"
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'androidx.appcompat:appcompat:1.3.1'
|
|
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
|
implementation 'com.google.android.material:material:1.2.1'
|
|
implementation 'com.google.android:flexbox:2.0.1'
|
|
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
|
implementation 'androidx.cardview:cardview:1.0.0'
|
|
implementation 'androidx.preference:preference-ktx:1.1.1'
|
|
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
|
|
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
|
implementation 'androidx.exifinterface:exifinterface:1.3.3'
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
|
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
|
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion"
|
|
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
|
|
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion"
|
|
implementation "androidx.lifecycle:lifecycle-process:$lifecycleVersion"
|
|
implementation 'androidx.activity:activity-ktx:1.2.2'
|
|
implementation 'androidx.fragment:fragment-ktx:1.3.2'
|
|
implementation "androidx.core:core-ktx:1.3.2"
|
|
implementation "androidx.work:work-runtime-ktx:2.4.0"
|
|
implementation ("com.google.firebase:firebase-messaging:18.0.0") {
|
|
exclude group: 'com.google.firebase', module: 'firebase-core'
|
|
exclude group: 'com.google.firebase', module: 'firebase-analytics'
|
|
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
|
|
}
|
|
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.1'
|
|
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.1'
|
|
implementation 'org.conscrypt:conscrypt-android:2.0.0'
|
|
implementation 'org.signal:aesgcmprovider:0.0.3'
|
|
implementation 'org.webrtc:google-webrtc:1.0.32006'
|
|
implementation "me.leolin:ShortcutBadger:1.1.16"
|
|
implementation 'se.emilsjolander:stickylistheaders:2.7.0'
|
|
implementation 'com.jpardogo.materialtabstrip:library:1.0.9'
|
|
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
|
|
implementation 'commons-net:commons-net:3.7.2'
|
|
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
|
|
implementation "com.github.bumptech.glide:glide:$glideVersion"
|
|
annotationProcessor "com.github.bumptech.glide:compiler:$glideVersion"
|
|
kapt "com.github.bumptech.glide:compiler:$glideVersion"
|
|
implementation 'com.makeramen:roundedimageview:2.1.0'
|
|
implementation 'com.pnikosis:materialish-progress:1.5'
|
|
implementation 'org.greenrobot:eventbus:3.0.0'
|
|
implementation 'pl.tajchert:waitingdots:0.1.0'
|
|
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
|
implementation 'com.melnykov:floatingactionbutton:1.3.0'
|
|
implementation 'com.google.zxing:android-integration:3.1.0'
|
|
implementation "com.google.dagger:hilt-android:$daggerVersion"
|
|
kapt "com.google.dagger:hilt-compiler:$daggerVersion"
|
|
implementation 'mobi.upod:time-duration-picker:1.1.3'
|
|
implementation 'com.google.zxing:core:3.2.1'
|
|
implementation ('com.davemorrissey.labs:subsampling-scale-image-view:3.6.0') {
|
|
exclude group: 'com.android.support', module: 'support-annotations'
|
|
}
|
|
implementation ('cn.carbswang.android:NumberPickerView:1.0.9') {
|
|
exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
}
|
|
implementation ('com.tomergoldst.android:tooltips:1.0.6') {
|
|
exclude group: 'com.android.support', module: 'appcompat-v7'
|
|
}
|
|
implementation ('com.klinkerapps:android-smsmms:4.0.1') {
|
|
exclude group: 'com.squareup.okhttp', module: 'okhttp'
|
|
exclude group: 'com.squareup.okhttp', module: 'okhttp-urlconnection'
|
|
}
|
|
implementation 'com.annimon:stream:1.1.8'
|
|
implementation 'com.takisoft.fix:colorpicker:1.0.1'
|
|
implementation 'com.codewaves.stickyheadergrid:stickyheadergrid:0.9.4'
|
|
implementation 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3-S2'
|
|
implementation 'org.signal:android-database-sqlcipher:3.5.9-S3'
|
|
implementation ('com.googlecode.ez-vcard:ez-vcard:0.9.11') {
|
|
exclude group: 'com.fasterxml.jackson.core'
|
|
exclude group: 'org.freemarker'
|
|
}
|
|
implementation project(":libsignal")
|
|
implementation project(":libsession")
|
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxJsonVersion"
|
|
implementation "com.github.oxen-io.session-android-curve-25519:curve25519-java:$curve25519Version"
|
|
implementation project(":liblazysodium")
|
|
implementation "net.java.dev.jna:jna:5.8.0@aar"
|
|
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
|
|
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
|
|
implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
|
|
implementation 'app.cash.copper:copper-flow:1.0.0'
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
|
|
implementation "nl.komponents.kovenant:kovenant:$kovenantVersion"
|
|
implementation "nl.komponents.kovenant:kovenant-android:$kovenantVersion"
|
|
implementation "com.github.lelloman:android-identicons:v11"
|
|
implementation "com.prof.rssparser:rssparser:2.0.4"
|
|
implementation "com.jakewharton.rxbinding3:rxbinding:3.1.0"
|
|
implementation "com.github.tbruyelle:rxpermissions:0.10.2"
|
|
implementation "com.github.ybq:Android-SpinKit:1.4.0"
|
|
implementation "com.opencsv:opencsv:4.6"
|
|
testImplementation 'junit:junit:4.12'
|
|
testImplementation 'org.assertj:assertj-core:3.11.1'
|
|
testImplementation "org.mockito:mockito-inline:4.0.0"
|
|
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
|
|
testImplementation 'org.powermock:powermock-api-mockito:1.6.1'
|
|
testImplementation 'org.powermock:powermock-module-junit4:1.6.1'
|
|
testImplementation 'org.powermock:powermock-module-junit4-rule:1.6.1'
|
|
testImplementation 'org.powermock:powermock-classloading-xstream:1.6.1'
|
|
testImplementation 'androidx.test:core:1.3.0'
|
|
testImplementation "androidx.arch.core:core-testing:2.1.0"
|
|
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion"
|
|
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion"
|
|
// Core library
|
|
androidTestImplementation 'androidx.test:core:1.4.0'
|
|
|
|
// AndroidJUnitRunner and JUnit Rules
|
|
androidTestImplementation 'androidx.test:runner:1.4.0'
|
|
androidTestImplementation 'androidx.test:rules:1.4.0'
|
|
|
|
// Assertions
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
|
androidTestImplementation 'androidx.test.ext:truth:1.4.0'
|
|
androidTestImplementation 'com.google.truth:truth:1.0'
|
|
|
|
// Espresso dependencies
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-accessibility:3.4.0'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-web:3.4.0'
|
|
androidTestImplementation 'androidx.test.espresso.idling:idling-concurrent:3.4.0'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.4.0'
|
|
androidTestUtil 'androidx.test:orchestrator:1.4.0'
|
|
|
|
testImplementation 'org.robolectric:robolectric:4.4'
|
|
testImplementation 'org.robolectric:shadows-multidex:4.4'
|
|
}
|
|
|
|
def canonicalVersionCode = 307
|
|
def canonicalVersionName = "1.16.0"
|
|
|
|
def postFixSize = 10
|
|
def abiPostFix = ['armeabi-v7a' : 1,
|
|
'arm64-v8a' : 2,
|
|
'x86' : 3,
|
|
'x86_64' : 4,
|
|
'universal' : 5]
|
|
|
|
android {
|
|
compileSdkVersion androidCompileSdkVersion
|
|
buildToolsVersion '29.0.3'
|
|
useLibrary 'org.apache.http.legacy'
|
|
|
|
dexOptions {
|
|
javaMaxHeapSize "4g"
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = '1.8'
|
|
}
|
|
|
|
packagingOptions {
|
|
exclude 'LICENSE.txt'
|
|
exclude 'LICENSE'
|
|
exclude 'NOTICE'
|
|
exclude 'asm-license.txt'
|
|
exclude 'META-INF/LICENSE'
|
|
exclude 'META-INF/NOTICE'
|
|
exclude 'META-INF/proguard/androidx-annotations.pro'
|
|
}
|
|
|
|
splits {
|
|
abi {
|
|
enable true
|
|
reset()
|
|
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
|
universalApk true
|
|
}
|
|
}
|
|
|
|
defaultConfig {
|
|
versionCode canonicalVersionCode * postFixSize
|
|
versionName canonicalVersionName
|
|
|
|
minSdkVersion androidMinimumSdkVersion
|
|
targetSdkVersion androidCompileSdkVersion
|
|
|
|
multiDexEnabled = true
|
|
|
|
vectorDrawables.useSupportLibrary = true
|
|
project.ext.set("archivesBaseName", "session")
|
|
|
|
buildConfigField "long", "BUILD_TIMESTAMP", getLastCommitTimestamp() + "L"
|
|
buildConfigField "String", "CONTENT_PROXY_HOST", "\"contentproxy.signal.org\""
|
|
buildConfigField "int", "CONTENT_PROXY_PORT", "443"
|
|
buildConfigField "String", "USER_AGENT", "\"OWA\""
|
|
buildConfigField "String[]", "LANGUAGES", "new String[]{\"" + autoResConfig().collect { s -> s.replace('-r', '_') }.join('", "') + '"}'
|
|
buildConfigField "int", "CANONICAL_VERSION_CODE", "$canonicalVersionCode"
|
|
|
|
resConfigs autoResConfig()
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
// The following argument makes the Android Test Orchestrator run its
|
|
// "pm clear" command after each test invocation. This command ensures
|
|
// that the app's state is completely cleared between tests.
|
|
testInstrumentationRunnerArguments clearPackageData: 'true'
|
|
testOptions {
|
|
execution 'ANDROIDX_TEST_ORCHESTRATOR'
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
String sharedTestDir = 'src/sharedTest/java'
|
|
test.java.srcDirs += sharedTestDir
|
|
androidTest.java.srcDirs += sharedTestDir
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
}
|
|
debug {
|
|
minifyEnabled false
|
|
}
|
|
}
|
|
|
|
flavorDimensions "distribution"
|
|
productFlavors {
|
|
play {
|
|
ext.websiteUpdateUrl = "null"
|
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
|
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
|
|
}
|
|
|
|
website {
|
|
ext.websiteUpdateUrl = "https://github.com/oxen-io/session-android/releases"
|
|
buildConfigField "boolean", "PLAY_STORE_DISABLED", "true"
|
|
buildConfigField "String", "NOPLAY_UPDATE_URL", "\"$ext.websiteUpdateUrl\""
|
|
}
|
|
}
|
|
|
|
applicationVariants.all { variant ->
|
|
variant.outputs.each { output ->
|
|
def abiName = output.getFilter("ABI") ?: 'universal'
|
|
def postFix = abiPostFix.get(abiName, 0)
|
|
|
|
if (postFix >= postFixSize) throw new AssertionError("postFix is too large")
|
|
output.outputFileName = output.outputFileName = "session-${variant.versionName}-${abiName}.apk"
|
|
output.versionCodeOverride = canonicalVersionCode * postFixSize + postFix
|
|
}
|
|
}
|
|
|
|
lintOptions {
|
|
abortOnError true
|
|
baseline file("lint-baseline.xml")
|
|
}
|
|
|
|
testOptions {
|
|
unitTests {
|
|
includeAndroidResources = true
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
dataBinding true
|
|
viewBinding true
|
|
}
|
|
}
|
|
|
|
static def getLastCommitTimestamp() {
|
|
new ByteArrayOutputStream().withStream { os ->
|
|
return os.toString() + "000"
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Discovers supported languages listed as under the res/values- directory.
|
|
*/
|
|
def autoResConfig() {
|
|
def files = new ArrayList<String>()
|
|
def root = file("src/main/res")
|
|
root.eachFile { f -> files.add(f.name) }
|
|
['en'] + files.collect { f -> f =~ /^values-([a-z]{2}(-r[A-Z]{2})?)$/ }
|
|
.findAll { matcher -> matcher.find() }
|
|
.collect { matcher -> matcher.group(1) }
|
|
.sort()
|
|
}
|