Skip to content

Commit 8899ed7

Browse files
authored
chore: Remove F-Droid flavor (#6209)
1 parent f7cae02 commit 8899ed7

31 files changed

+140
-345
lines changed

Diff for: .circleci/config.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -182,26 +182,26 @@ commands:
182182
name: Build App
183183
command: |
184184
if [[ $CIRCLE_JOB == "android-build-official" ]]; then
185-
./gradlew bundleOfficialPlayRelease
185+
./gradlew bundleOfficialRelease
186186
fi
187187
if [[ $CIRCLE_JOB == "android-build-experimental" || "android-automatic-build-experimental" ]]; then
188-
./gradlew bundleExperimentalPlayRelease
188+
./gradlew bundleExperimentalRelease
189189
fi
190190
if [[ ! $GOOGLE_SERVICES_ANDROID ]]; then
191-
./gradlew assembleExperimentalPlayDebug
191+
./gradlew assembleExperimentalDebug
192192
fi
193193
working_directory: android
194194

195195
- run:
196196
name: Upload sourcemaps/NDK symbols to Bugsnag
197197
command: |
198198
if [[ $CIRCLE_JOB == "android-build-official" ]]; then
199-
yarn bugsnag:upload-android --variant officialPlayRelease
200-
yarn bugsnag-cli upload android-aab android/app/build/outputs/bundle/officialPlayRelease/app-official-play-release.aab
199+
yarn bugsnag:upload-android --variant officialRelease
200+
yarn bugsnag-cli upload android-aab android/app/build/outputs/bundle/officialRelease/app-official-release.aab
201201
fi
202202
if [[ $CIRCLE_JOB == "android-build-experimental" || "android-automatic-build-experimental" ]]; then
203-
yarn bugsnag:upload-android --variant experimentalPlayRelease
204-
yarn bugsnag-cli upload android-aab android/app/build/outputs/bundle/experimentalPlayRelease/app-experimental-play-release.aab
203+
yarn bugsnag:upload-android --variant experimentalRelease
204+
yarn bugsnag-cli upload android-aab android/app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab
205205
fi
206206
207207
- store_artifacts:
@@ -501,9 +501,9 @@ jobs:
501501
yarn e2e:android-build
502502
- save_cache: *save-gradle-cache
503503
- store_artifacts:
504-
path: android/app/build/outputs/apk/experimentalPlay/release/app-experimental-play-release.apk
504+
path: android/app/build/outputs/apk/experimental/release/app-experimental-release.apk
505505
- store_artifacts:
506-
path: android/app/build/outputs/apk/androidTest/experimentalPlay/release/app-experimental-play-release-androidTest.apk
506+
path: android/app/build/outputs/apk/androidTest/experimental/release/app-experimental-release-androidTest.apk
507507
- persist_to_workspace:
508508
root: /home/circleci/repo
509509
paths:

Diff for: .detoxrc.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,15 @@ module.exports = {
2929
},
3030
'android.debug': {
3131
type: 'android.apk',
32-
binaryPath: 'android/app/build/outputs/apk/experimentalPlay/debug/app-experimental-play-debug.apk',
33-
build:
34-
'cd android ; ./gradlew assembleExperimentalPlayDebug assembleExperimentalPlayDebugAndroidTest -DtestBuildType=debug ; cd -',
32+
binaryPath: 'android/app/build/outputs/apk/experimental/debug/app-experimental-debug.apk',
33+
build: 'cd android ; ./gradlew assembleExperimentalDebug assembleExperimentalDebugAndroidTest -DtestBuildType=debug ; cd -',
3534
reversePorts: [8081]
3635
},
3736
'android.release': {
3837
type: 'android.apk',
39-
binaryPath: 'android/app/build/outputs/apk/experimentalPlay/release/app-experimental-play-release.apk',
38+
binaryPath: 'android/app/build/outputs/apk/experimental/release/app-experimental-release.apk',
4039
build:
41-
'cd android ; ./gradlew assembleExperimentalPlayRelease assembleExperimentalPlayReleaseAndroidTest -DtestBuildType=release ; cd -'
40+
'cd android ; ./gradlew assembleExperimentalRelease assembleExperimentalReleaseAndroidTest -DtestBuildType=release ; cd -'
4241
}
4342
},
4443
devices: {

Diff for: android/app/build.gradle

+12-67
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase()
2-
def isFoss = taskRequests.contains("foss")
3-
41
apply plugin: "com.android.application"
52
apply plugin: "org.jetbrains.kotlin.android"
63
apply plugin: "com.facebook.react"
74

8-
if (!isFoss) {
9-
apply plugin: 'com.google.firebase.crashlytics'
10-
apply plugin: 'com.bugsnag.android.gradle'
11-
}
5+
apply plugin: 'com.google.firebase.crashlytics'
6+
apply plugin: 'com.bugsnag.android.gradle'
127

138
/**
149
* This is the configuration block to customize your React Native Android app.
@@ -95,10 +90,8 @@ android {
9590
versionCode VERSIONCODE as Integer
9691
versionName "4.59.0"
9792
vectorDrawables.useSupportLibrary = true
98-
if (!isFoss) {
99-
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
100-
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60" // See note below!
101-
}
93+
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
94+
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60" // See note below!
10295
resValue "string", "rn_config_reader_custom_package", "chat.rocket.reactnative"
10396
testBuildType System.getProperty('testBuildType', 'debug')
10497
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
@@ -120,31 +113,15 @@ android {
120113
signingConfig signingConfigs.release
121114
minifyEnabled enableProguardInReleaseBuilds
122115
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
123-
if (!isFoss) {
124-
firebaseCrashlytics {
125-
nativeSymbolUploadEnabled true
126-
strippedNativeLibsDir 'build/intermediates/stripped_native_libs/release/out/lib'
127-
unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
128-
}
116+
firebaseCrashlytics {
117+
nativeSymbolUploadEnabled true
118+
strippedNativeLibsDir 'build/intermediates/stripped_native_libs/release/out/lib'
119+
unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
129120
}
130121
}
131122
}
132123

133-
// packagingOptions {
134-
// pickFirst '**/armeabi-v7a/libc++_shared.so'
135-
// pickFirst '**/x86/libc++_shared.so'
136-
// pickFirst '**/arm64-v8a/libc++_shared.so'
137-
// pickFirst '**/x86_64/libc++_shared.so'
138-
// }
139-
140-
// FIXME: Remove when we update RN
141-
// packagingOptions {
142-
// pickFirst '**/*.so'
143-
// }
144-
145-
// applicationVariants are e.g. debug, release
146-
147-
flavorDimensions "app", "type"
124+
flavorDimensions "app"
148125
productFlavors {
149126
official {
150127
dimension = "app"
@@ -154,33 +131,6 @@ android {
154131
dimension = "app"
155132
buildConfigField "boolean", "IS_OFFICIAL", "false"
156133
}
157-
foss {
158-
dimension = "type"
159-
buildConfigField "boolean", "FDROID_BUILD", "true"
160-
}
161-
play {
162-
dimension = "type"
163-
buildConfigField "boolean", "FDROID_BUILD", "false"
164-
}
165-
}
166-
sourceSets {
167-
// TODO: refactor making sure notifications are working properly both on debug and release
168-
experimentalPlayDebug {
169-
java.srcDirs = ['src/main/java', 'src/play/java']
170-
manifest.srcFile 'src/play/AndroidManifest.xml'
171-
}
172-
experimentalPlayRelease {
173-
java.srcDirs = ['src/main/java', 'src/play/java']
174-
manifest.srcFile 'src/play/AndroidManifest.xml'
175-
}
176-
officialPlayDebug {
177-
java.srcDirs = ['src/main/java', 'src/play/java']
178-
manifest.srcFile 'src/play/AndroidManifest.xml'
179-
}
180-
officialPlayRelease {
181-
java.srcDirs = ['src/main/java', 'src/play/java']
182-
manifest.srcFile 'src/play/AndroidManifest.xml'
183-
}
184134
}
185135
}
186136

@@ -196,11 +146,8 @@ dependencies {
196146
}
197147

198148
implementation project(':@react-native-community_viewpager')
199-
playImplementation project(':react-native-notifications')
200-
playImplementation "com.google.firebase:firebase-messaging:23.3.1"
201-
playImplementation project(':@react-native-firebase_app')
202-
playImplementation project(':@react-native-firebase_analytics')
203-
playImplementation project(':@react-native-firebase_crashlytics')
149+
implementation project(':react-native-notifications')
150+
implementation "com.google.firebase:firebase-messaging:23.3.1"
204151
implementation project(':watermelondb-jsi')
205152

206153
implementation "com.google.code.gson:gson:2.8.9"
@@ -211,6 +158,4 @@ dependencies {
211158
}
212159

213160
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
214-
if (!isFoss) {
215-
apply plugin: 'com.google.gms.google-services'
216-
}
161+
apply plugin: 'com.google.gms.google-services'

Diff for: android/app/src/foss/java/chat/rocket/reactnative/AdditionalModules.java

-14
This file was deleted.

Diff for: android/app/src/main/AndroidManifest.xml

+12
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,18 @@
7575
<data android:mimeType="*/*" />
7676
</intent-filter>
7777
</activity>
78+
<receiver
79+
android:name="chat.rocket.reactnative.notification.ReplyBroadcast"
80+
android:enabled="true"
81+
android:exported="true" />
82+
<receiver
83+
android:name="chat.rocket.reactnative.notification.DismissNotification"
84+
android:enabled="true"
85+
android:exported="true" >
86+
</receiver>
87+
<meta-data
88+
android:name="com.bugsnag.android.API_KEY"
89+
android:value="${BugsnagAPIKey}" />
7890
</application>
7991

8092
<queries>

Diff for: android/app/src/main/java/chat/rocket/reactnative/MainApplication.kt

+27-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package chat.rocket.reactnative
22

33
import android.app.Application
4+
import android.content.Context
5+
import android.content.res.Configuration
6+
import android.os.Bundle
47
import com.facebook.react.PackageList
58
import com.facebook.react.ReactApplication
69
import com.facebook.react.ReactHost
@@ -9,18 +12,21 @@ import com.facebook.react.ReactPackage
912
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1013
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1114
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.flipper.ReactNativeFlipper
1315
import com.facebook.soloader.SoLoader
1416
import com.nozbe.watermelondb.jsi.WatermelonDBJSIPackage;
1517
import com.facebook.react.bridge.JSIModulePackage;
16-
18+
import com.wix.reactnativenotifications.core.AppLaunchHelper
19+
import com.wix.reactnativenotifications.core.AppLifecycleFacade
20+
import com.wix.reactnativenotifications.core.JsIOHelper
21+
import com.wix.reactnativenotifications.core.notification.INotificationsApplication
22+
import com.wix.reactnativenotifications.core.notification.IPushNotification
23+
import com.bugsnag.android.Bugsnag
1724
import expo.modules.ApplicationLifecycleDispatcher
18-
import expo.modules.ReactNativeHostWrapper
1925
import chat.rocket.reactnative.networking.SSLPinningPackage;
26+
import chat.rocket.reactnative.notification.CustomPushNotification;
2027
import com.reactnativecommunity.viewpager.RNCViewPagerPackage;
21-
import android.content.res.Configuration;
2228

23-
open class MainApplication : Application(), ReactApplication {
29+
open class MainApplication : Application(), ReactApplication, INotificationsApplication {
2430

2531
override val reactNativeHost: ReactNativeHost =
2632
object : DefaultReactNativeHost(this) {
@@ -29,7 +35,6 @@ open class MainApplication : Application(), ReactApplication {
2935
// Packages that cannot be autolinked yet can be added manually here, for example:
3036
add(RNCViewPagerPackage())
3137
add(SSLPinningPackage())
32-
addAll(AdditionalModules().getAdditionalModules())
3338
}
3439

3540
override fun getJSIModulePackage(): JSIModulePackage {
@@ -50,6 +55,7 @@ open class MainApplication : Application(), ReactApplication {
5055
override fun onCreate() {
5156
super.onCreate()
5257
SoLoader.init(this, false)
58+
Bugsnag.start(this)
5359

5460
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
5561
// If you opted-in for the New Architecture, we load the native entry point for this app.
@@ -62,4 +68,19 @@ open class MainApplication : Application(), ReactApplication {
6268
super.onConfigurationChanged(newConfig)
6369
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)
6470
}
71+
72+
override fun getPushNotification(
73+
context: Context,
74+
bundle: Bundle,
75+
defaultFacade: AppLifecycleFacade,
76+
defaultAppLaunchHelper: AppLaunchHelper
77+
): IPushNotification {
78+
return CustomPushNotification(
79+
context,
80+
bundle,
81+
defaultFacade,
82+
defaultAppLaunchHelper,
83+
JsIOHelper()
84+
)
85+
}
6586
}

Diff for: android/app/src/play/java/chat/rocket/reactnative/Callback.java renamed to android/app/src/main/java/chat/rocket/reactnative/notification/Callback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package chat.rocket.reactnative;
1+
package chat.rocket.reactnative.notification;
22

33
import android.os.Bundle;
44

Diff for: android/app/src/play/java/chat/rocket/reactnative/CustomPushNotification.java renamed to android/app/src/main/java/chat/rocket/reactnative/notification/CustomPushNotification.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package chat.rocket.reactnative;
1+
package chat.rocket.reactnative.notification;
22

33
import static com.wix.reactnativenotifications.Defs.NOTIFICATION_RECEIVED_EVENT_NAME;
44

@@ -37,6 +37,8 @@
3737
import java.util.Map;
3838
import java.util.concurrent.ExecutionException;
3939

40+
import chat.rocket.reactnative.R;
41+
4042
public class CustomPushNotification extends PushNotification {
4143
public static ReactApplicationContext reactApplicationContext;
4244
final NotificationManager notificationManager;

Diff for: android/app/src/play/java/chat/rocket/reactnative/DismissNotification.java renamed to android/app/src/main/java/chat/rocket/reactnative/notification/DismissNotification.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package chat.rocket.reactnative;
1+
package chat.rocket.reactnative.notification;
22

33
import android.content.BroadcastReceiver;
44
import android.content.Context;

Diff for: android/app/src/play/java/chat/rocket/reactnative/Ejson.java renamed to android/app/src/main/java/chat/rocket/reactnative/notification/Ejson.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package chat.rocket.reactnative;
1+
package chat.rocket.reactnative.notification;
22

33
import com.facebook.react.bridge.ReactApplicationContext;
44
import com.facebook.react.bridge.Callback;

Diff for: android/app/src/play/java/chat/rocket/reactnative/Encryption.java renamed to android/app/src/main/java/chat/rocket/reactnative/notification/Encryption.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package chat.rocket.reactnative;
1+
package chat.rocket.reactnative.notification;
22

33
import android.database.Cursor;
44
import android.database.sqlite.SQLiteDatabase;

Diff for: android/app/src/play/java/chat/rocket/reactnative/LoadNotification.java renamed to android/app/src/main/java/chat/rocket/reactnative/notification/LoadNotification.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package chat.rocket.reactnative;
1+
package chat.rocket.reactnative.notification;
22

33
import android.os.Bundle;
44

Diff for: android/app/src/play/java/chat/rocket/reactnative/ReplyBroadcast.java renamed to android/app/src/main/java/chat/rocket/reactnative/notification/ReplyBroadcast.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package chat.rocket.reactnative;
1+
package chat.rocket.reactnative.notification;
22

33
import android.app.Notification;
44
import android.app.NotificationChannel;

Diff for: android/app/src/play/AndroidManifest.xml

-26
This file was deleted.

Diff for: android/app/src/play/java/chat/rocket/reactnative/AdditionalModules.java

-20
This file was deleted.

0 commit comments

Comments
 (0)