Skip to content

Commit

Permalink
Merge pull request #109 from grote/beta
Browse files Browse the repository at this point in the history
Move to Beta
  • Loading branch information
akwizgran committed Oct 16, 2023
2 parents 5efe604 + 375e7bd commit 00638d6
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 9,859 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

[![Build](https://github.com/onionshare/onionshare-android/actions/workflows/build.yml/badge.svg)](https://github.com/onionshare/onionshare-android/actions/workflows/build.yml)

Android version of OnionShare (under development)
Android version of OnionShare

It
was [audited by Radically Open Security](https://github.com/onionshare/onionshare-android/blob/main/docs/report_onionshare-android.pdf)
on June 30th, 2023.
All found issues have since been resolved.

## Nightly builds

Expand Down
30 changes: 13 additions & 17 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ android {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
benchmark {
signingConfig signingConfigs.debug
debuggable false
}
}
flavorDimensions "releaseType"
productFlavors {
Expand All @@ -77,7 +73,7 @@ android {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.4.6'
kotlinCompilerExtensionVersion '1.4.8'
}
packagingOptions {
jniLibs {
Expand All @@ -89,7 +85,7 @@ android {
exclude '**/attach_hotspot_windows.dll'
}
lintOptions {
disable 'MissingTranslation', 'MissingQuantity'
disable 'MissingTranslation', 'ExtraTranslation', 'MissingQuantity'
}
}

Expand All @@ -100,18 +96,18 @@ configurations {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.core:core-ktx:1.10.1' // newer versions require compileSdk 34
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.activity:activity-compose:1.7.2'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.activity:activity-compose:1.7.2' // newer versions requires compileSdk 34
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
implementation 'com.google.android.material:material:1.9.0' // newer versions requires compileSdk 34

implementation platform("androidx.compose:compose-bom:$compose_version")
implementation 'androidx.compose.material:material'
implementation "androidx.compose.material:material-icons-extended"
implementation 'androidx.compose.ui:ui-tooling-preview'

implementation "androidx.navigation:navigation-compose:2.6.0"
implementation "androidx.navigation:navigation-compose:2.6.0" // newer versions requires compileSdk 34
implementation "androidx.hilt:hilt-navigation-compose:1.0.0"
implementation "androidx.profileinstaller:profileinstaller:1.3.1"
implementation "androidx.security:security-crypto:1.1.0-alpha06"
Expand All @@ -120,14 +116,14 @@ dependencies {
kapt "com.google.dagger:hilt-compiler:$hilt_version"

// Tor
implementation "org.briarproject:onionwrapper-android:0.0.5"
tor 'org.briarproject:tor-android:0.4.7.14'
implementation "org.briarproject:onionwrapper-android:0.0.6"
tor 'org.briarproject:tor-android:0.4.7.15'
tor 'org.briarproject:obfs4proxy-android:0.0.14-tor2'
tor 'org.briarproject:snowflake-android:2.5.1'
implementation 'org.briarproject:moat-api:0.2'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.squareup.okhttp3:okhttp:4.11.0'

def ktor_version = '2.3.1'
def ktor_version = '2.3.5'
implementation "io.ktor:ktor-server-core:$ktor_version"
implementation "io.ktor:ktor-server-netty:$ktor_version"
implementation "io.ktor:ktor-server-pebble:$ktor_version"
Expand All @@ -143,15 +139,15 @@ dependencies {
debugImplementation 'androidx.compose.ui:ui-test-manifest'

testImplementation 'junit:junit:4.13.2'
testImplementation 'io.mockk:mockk:1.13.5'
testImplementation 'io.mockk:mockk:1.13.7'
testImplementation 'org.slf4j:slf4j-jdk14:2.0.7'
testImplementation 'app.cash.turbine:turbine:1.0.0'
testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3'

androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.4.3"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.5.3"
androidTestImplementation 'tools.fastlane:screengrab:2.1.1'
}

Expand Down
52 changes: 10 additions & 42 deletions app/src/main/java/org/onionshare/android/ui/share/ShareUi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import android.content.res.Configuration.UI_MODE_NIGHT_YES
import android.net.Uri
import androidx.annotation.StringRes
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement.Center
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
Expand Down Expand Up @@ -39,17 +37,11 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment.Companion.CenterHorizontally
import androidx.compose.ui.Alignment.Companion.TopCenter
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight.Companion.Bold
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -229,45 +221,21 @@ fun MainContent(
modifier: Modifier,
) {
if (isEmptyState(shareState, filesState)) {
Box(
Column(
horizontalAlignment = CenterHorizontally,
verticalArrangement = Center,
modifier = modifier
.fillMaxWidth()
.fillMaxHeight(),
.fillMaxHeight()
) {
Box(
contentAlignment = TopCenter,
modifier = Modifier
.padding(16.dp)
.background(MaterialTheme.colors.error)
) {
Text(
text = buildAnnotatedString {
withStyle(SpanStyle(fontWeight = Bold)) {
append(stringResource(R.string.warning_alpha_intro))
}
append(" ")
append(stringResource(R.string.warning_alpha))
},
color = Color.White,
modifier = Modifier.padding(16.dp),
)
}
Column(
horizontalAlignment = CenterHorizontally,
verticalArrangement = Center,
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight()
) {
Image(painterResource(R.drawable.ic_share_empty_state), contentDescription = null)
Text(
text = stringResource(R.string.share_empty_state),
modifier = Modifier.padding(16.dp),
)
}
Image(painterResource(R.drawable.ic_share_empty_state), contentDescription = null)
Text(
text = stringResource(R.string.share_empty_state),
modifier = Modifier.padding(16.dp),
)
}
} else {
FileList(Modifier.padding(bottom = offset), shareState, filesState, onFileRemove, onRemoveAll)
FileList(modifier.padding(bottom = offset), shareState, filesState, onFileRemove, onRemoveAll)
}
}

Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">OnionShare (alpha)</string>
<string name="app_name">OnionShare (beta)</string>

<string name="back">Back</string>
<string name="menu">Menu</string>
Expand All @@ -12,8 +12,6 @@
<string name="unknown">unknown</string>
<string name="remove">Remove</string>
<string name="share_empty_state">Nothing here yet.</string>
<string name="warning_alpha_intro">Warning:</string>
<string name="warning_alpha">This is an early alpha release. It should only be used for testing. The code is not finished and has not been audited.</string>
<string name="warning_no_files_added">No files selected.</string>
<string name="clear_all">Clear All</string>
<string name="share_files_add">Add files</string>
Expand Down
1 change: 0 additions & 1 deletion benchmark/.gitignore

This file was deleted.

50 changes: 0 additions & 50 deletions benchmark/build.gradle

This file was deleted.

14 changes: 0 additions & 14 deletions benchmark/src/main/AndroidManifest.xml

This file was deleted.

Loading

0 comments on commit 00638d6

Please sign in to comment.