Skip to content

Commit

Permalink
Merge branches 'issues/1430' and 'master' of github.com:ooni/probe-an…
Browse files Browse the repository at this point in the history
…droid into issues/1430
  • Loading branch information
aanorbel committed Dec 6, 2023
2 parents f4a1da3 + 3b27a17 commit 30b50e1
Show file tree
Hide file tree
Showing 127 changed files with 3,254 additions and 2,130 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
steps:
- uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: checkout
uses: actions/checkout@v2
Expand All @@ -16,4 +16,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: dev-apk
path: app/build/outputs/apk/devFull/release
path: app/build/outputs/apk/devFull/release
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/emulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
steps:
- uses: actions/setup-java@v2
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: checkout
uses: actions/checkout@v2
Expand Down
1 change: 0 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Terms: https://firebase.google.com/terms/

- easypermissions
- LocalhostToolkit
- butterknife
- DBFlow
- LocalhostToolkit
- MarkdownView
162 changes: 76 additions & 86 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
apply plugin: 'com.android.application'
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
}
apply from: 'jacoco.gradle'

android {
compileSdk 34
compileSdk libs.versions.compileSdk.get().toInteger()
ndkVersion '22.0.7026061'

defaultConfig {
applicationId 'org.openobservatory.ooniprobe'
minSdk 21
targetSdk 34
versionName '3.8.3'
versionCode 102
defaultConfig {
applicationId 'org.openobservatory.ooniprobe'
minSdk libs.versions.minSdk.get().toInteger()
targetSdk libs.versions.targetSdk.get().toInteger()
versionName '3.8.5'
versionCode 107
testInstrumentationRunner "org.openobservatory.ooniprobe.TestAndroidJUnitRunner"
buildConfigField 'String', 'OONI_API_BASE_URL', '"https://api.ooni.io/"'
buildConfigField 'String', 'NOTIFICATION_SERVER', '"https://countly.ooni.io"'
resValue "string", "APP_ID", 'org.openobservatory.ooniprobe'
resValue "string", "APP_NAME", "OONI Probe"
buildConfigField 'String', 'SOFTWARE_NAME', 'BASE_SOFTWARE_NAME+IS_DEBUG'
buildConfigField 'String', 'COUNTLY_KEY', '"146836f41172f9e3287cab6f2cc347de3f5ddf3b"'
Expand Down Expand Up @@ -41,18 +46,6 @@ android {
}
}

// Shared test code between Unit and Instrumented tests
sourceSets {
androidTest {
java.srcDirs += "src/sharedTest/java"
resources.srcDirs += "src/sharedTest/resources"
}
test {
java.srcDirs += "src/sharedTest/java"
resources.srcDirs += "src/sharedTest/resources"
}
}

flavorDimensions 'testing', 'license'
productFlavors {
stable {
Expand All @@ -65,6 +58,7 @@ android {
versionNameSuffix "-beta.1"
versionCode versionCodeDate()
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"ooniprobe-android-dev"'
resValue "string", "APP_ID", 'org.openobservatory.ooniprobe.dev'
resValue "string", "APP_NAME", "OONI Dev"
buildConfigField 'String', 'COUNTLY_KEY', '"e6c2cfe53e85951d50567467cef3f9fa2eab32c3"'
}
Expand All @@ -74,6 +68,7 @@ android {
versionNameSuffix "-experimental.1"
versionCode versionCodeDate()
buildConfigField 'String', 'BASE_SOFTWARE_NAME', '"ooniprobe-android-experimental"'
resValue "string", "APP_ID", 'org.openobservatory.ooniprobe.experimental'
resValue "string", "APP_NAME", "OONI Exp"
buildConfigField 'String', 'COUNTLY_KEY', '"e6c2cfe53e85951d50567467cef3f9fa2eab32c3"'
}
Expand All @@ -91,10 +86,12 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}

buildFeatures {
viewBinding = true
}
Expand All @@ -105,83 +102,76 @@ dependencies {
implementation project(path: ':engine')

// AndroidX
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-process:2.5.1'
implementation 'androidx.preference:preference:1.2.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
implementation 'com.google.guava:guava:30.1.1-android'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.paging:paging-runtime-ktx:3.1.1"
implementation libs.androidx.appcompat
implementation libs.androidx.constraintlayout
implementation libs.androidx.lifecycle.process
implementation libs.androidx.preference
implementation libs.androidx.localbroadcastmanager
implementation libs.androidx.legacy.support.v4
implementation libs.androidx.paging.runtime.ktx

// Google
implementation libs.google.material
implementation libs.google.guava
implementation libs.google.gson

// Third-party
annotationProcessor 'com.github.Raizlabs.DBFlow:dbflow-processor:4.2.4'
implementation 'com.github.Raizlabs.DBFlow:dbflow-core:4.2.4'
implementation 'com.github.Raizlabs.DBFlow:dbflow:4.2.4'

implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
kapt libs.dbflow.processor
implementation libs.dbflow.core
implementation libs.dbflow.lib

implementation libs.retrofit.lib
implementation libs.retrofit.converter.gson
implementation libs.retrofit.logging.interceptor

implementation 'com.jakewharton:butterknife:10.2.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'

implementation 'com.github.xanscale.LocalhostToolkit:app:19.05.01'
implementation 'com.airbnb.android:lottie:3.0.7'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'ru.noties:markwon:2.0.1'
implementation 'commons-io:commons-io:2.6'
//arcview to fragment_dashboard
implementation 'com.github.florent37:shapeofview:1.3.2'
implementation libs.xanscale.localhost.toolkit
implementation libs.lottie
implementation libs.markwon.core
implementation libs.commons.io
//arcview to fragment_dashboard
implementation libs.shapeofview

// Flavor
fullImplementation platform('com.google.firebase:firebase-bom:26.3.0')
fullImplementation 'com.google.firebase:firebase-messaging'
fullImplementation 'ly.count.android:sdk:21.11.0'
fullImplementation 'io.sentry:sentry-android:6.3.0'
fullImplementation 'com.google.android.play:core:1.10.3'
fullImplementation platform(libs.google.firebase.bom)
fullImplementation libs.google.firebase.messaging
fullImplementation libs.countly.sdk
fullImplementation libs.sentry.android
fullImplementation libs.google.play.core

// Dependency Injection
implementation 'com.google.dagger:dagger:2.36'
annotationProcessor 'com.google.dagger:dagger-compiler:2.36'
implementation libs.google.dagger
kapt libs.google.dagger.compiler

// Logger
implementation project(':applogger')

// Testing
// Unit Testing
testImplementation 'junit:junit:4.13.2'
testImplementation 'androidx.test:core:1.4.0'
testImplementation 'androidx.test:runner:1.4.0'
testImplementation 'androidx.test:rules:1.4.0'
testImplementation 'org.mockito:mockito-core:4.6.1'
testImplementation 'org.mockito:mockito-inline:4.6.1'
testImplementation 'org.robolectric:robolectric:4.5.1'
testImplementation 'com.github.blocoio:faker:1.2.8'
testImplementation 'org.ooni:oonimkall:2023.07.18-162729'
testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.36'

// Instrumentation Testing
androidTestImplementation 'tools.fastlane:screengrab:2.0.0'
androidTestImplementation 'com.github.blocoio:faker:1.2.8'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.4.0') {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0') {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
androidTestImplementation('com.schibsted.spain:barista:3.9.0')
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:2.36"
// Unit Testing
testImplementation project(':shared-test')
testImplementation libs.junit4
testImplementation libs.androidx.core
testImplementation libs.androidx.runner
testImplementation libs.androidx.rules
testImplementation libs.mockito.core
testImplementation libs.mockito.inline
testImplementation libs.robolectric
testImplementation libs.faker
testImplementation libs.ooni.oonimkall
kaptTest libs.google.dagger.compiler

// Instrumentation Testing
androidTestImplementation project(':shared-test')
androidTestImplementation libs.fastlane.screengrab
androidTestImplementation libs.faker
androidTestImplementation libs.androidx.runner
androidTestImplementation libs.androidx.rules
androidTestImplementation libs.androidx.junit
androidTestImplementation libs.androidx.espresso.intents
androidTestImplementation libs.androidx.espresso.contrib
androidTestImplementation libs.androidx.espresso.core
androidTestImplementation libs.barista
kaptAndroidTest libs.google.dagger.compiler
}

static def versionCodeDate() {
Expand Down
22 changes: 14 additions & 8 deletions app/jacoco.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'jacoco'

jacoco {
toolVersion '0.8.5'
toolVersion libs.versions.jacoco.get().toString()
}

task jacocoAndroidTestReport(type: JacocoReport) {
Expand Down Expand Up @@ -48,13 +48,19 @@ task jacocoAndroidTestReport(type: JacocoReport) {
executionData.from += fileTree(dir: codeCoverageDataLocation, includes: ['**/*.ec'])
}

reports {
html.enabled true
html.destination file("${buildDir}/reports/coverage")
xml.enabled true
xml.destination file("${buildDir}/reports/coverage.xml")
csv.enabled false
}
reports {
html {
enabled true
destination file("${buildDir}/reports/coverage")
}
xml {
enabled true
destination file("${buildDir}/reports/coverage.xml")
}
csv {
enabled false
}
}

doLast {
println "Wrote HTML coverage report to ${reports.html.destination}/index.html"
Expand Down
6 changes: 0 additions & 6 deletions app/src/dev/res/values/untranslatable.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/experimental/res/values/untranslatable.xml

This file was deleted.

12 changes: 9 additions & 3 deletions app/src/fdroid/res/xml/preferences_global.xml
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,9 @@
app:iconSpaceReserved="false"
android:key="logs"
android:title="@string/Settings_Advanced_RecentLogs">
<intent android:action="@string/preference_intent_log_activity" />
<intent
android:targetPackage="@string/APP_ID"
android:targetClass="@string/preference_intent_log_activity"/>
</PreferenceScreen>
<SwitchPreferenceCompat
android:defaultValue="false"
Expand All @@ -378,7 +380,9 @@
android:icon="@drawable/proxy"
android:key="@string/ooni_backend_proxy"
android:title="@string/Settings_Proxy_Label">
<intent android:action="@string/preference_intent_proxy_activity" />
<intent
android:targetPackage="@string/APP_ID"
android:targetClass="@string/preference_intent_proxy_activity"/>
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/send_email"
Expand All @@ -388,6 +392,8 @@
android:icon="@drawable/about_ooni"
android:key="@string/about_ooni"
android:title="@string/Settings_About_Label">
<intent android:action="@string/preference_intent_about_ooni" />
<intent
android:targetPackage="@string/APP_ID"
android:targetClass="@string/preference_intent_about_ooni" />
</PreferenceScreen>
</PreferenceScreen>
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />

<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
Expand Down Expand Up @@ -175,7 +175,7 @@
<service
android:name=".common.service.RunTestService"
android:icon="@drawable/notification_icon"
android:foregroundServiceType="specialUse"
android:foregroundServiceType="dataSync"
android:label="@string/Dashboard_Card_Run"/>
<service
android:name=".common.service.RunTestJobService"
Expand Down
Loading

0 comments on commit 30b50e1

Please sign in to comment.