Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove F-Droid flavor #6209

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,26 +182,26 @@ commands:
name: Build App
command: |
if [[ $CIRCLE_JOB == "android-build-official" ]]; then
./gradlew bundleOfficialPlayRelease
./gradlew bundleOfficialRelease
fi
if [[ $CIRCLE_JOB == "android-build-experimental" || "android-automatic-build-experimental" ]]; then
./gradlew bundleExperimentalPlayRelease
./gradlew bundleExperimentalRelease
fi
if [[ ! $GOOGLE_SERVICES_ANDROID ]]; then
./gradlew assembleExperimentalPlayDebug
./gradlew assembleExperimentalDebug
fi
working_directory: android

- run:
name: Upload sourcemaps/NDK symbols to Bugsnag
command: |
if [[ $CIRCLE_JOB == "android-build-official" ]]; then
yarn bugsnag:upload-android --variant officialPlayRelease
yarn bugsnag-cli upload android-aab android/app/build/outputs/bundle/officialPlayRelease/app-official-play-release.aab
yarn bugsnag:upload-android --variant officialRelease
yarn bugsnag-cli upload android-aab android/app/build/outputs/bundle/officialRelease/app-official-release.aab
fi
if [[ $CIRCLE_JOB == "android-build-experimental" || "android-automatic-build-experimental" ]]; then
yarn bugsnag:upload-android --variant experimentalPlayRelease
yarn bugsnag-cli upload android-aab android/app/build/outputs/bundle/experimentalPlayRelease/app-experimental-play-release.aab
yarn bugsnag:upload-android --variant experimentalRelease
yarn bugsnag-cli upload android-aab android/app/build/outputs/bundle/experimentalRelease/app-experimental-release.aab
fi

- store_artifacts:
Expand Down Expand Up @@ -501,9 +501,9 @@ jobs:
yarn e2e:android-build
- save_cache: *save-gradle-cache
- store_artifacts:
path: android/app/build/outputs/apk/experimentalPlay/release/app-experimental-play-release.apk
path: android/app/build/outputs/apk/experimental/release/app-experimental-release.apk
- store_artifacts:
path: android/app/build/outputs/apk/androidTest/experimentalPlay/release/app-experimental-play-release-androidTest.apk
path: android/app/build/outputs/apk/androidTest/experimental/release/app-experimental-release-androidTest.apk
- persist_to_workspace:
root: /home/circleci/repo
paths:
Expand Down
9 changes: 4 additions & 5 deletions .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@ module.exports = {
},
'android.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/experimentalPlay/debug/app-experimental-play-debug.apk',
build:
'cd android ; ./gradlew assembleExperimentalPlayDebug assembleExperimentalPlayDebugAndroidTest -DtestBuildType=debug ; cd -',
binaryPath: 'android/app/build/outputs/apk/experimental/debug/app-experimental-debug.apk',
build: 'cd android ; ./gradlew assembleExperimentalDebug assembleExperimentalDebugAndroidTest -DtestBuildType=debug ; cd -',
reversePorts: [8081]
},
'android.release': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/experimentalPlay/release/app-experimental-play-release.apk',
binaryPath: 'android/app/build/outputs/apk/experimental/release/app-experimental-release.apk',
build:
'cd android ; ./gradlew assembleExperimentalPlayRelease assembleExperimentalPlayReleaseAndroidTest -DtestBuildType=release ; cd -'
'cd android ; ./gradlew assembleExperimentalRelease assembleExperimentalReleaseAndroidTest -DtestBuildType=release ; cd -'
}
},
devices: {
Expand Down
79 changes: 12 additions & 67 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase()
def isFoss = taskRequests.contains("foss")

apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

if (!isFoss) {
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.bugsnag.android.gradle'
}
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.bugsnag.android.gradle'

/**
* This is the configuration block to customize your React Native Android app.
Expand Down Expand Up @@ -95,10 +90,8 @@ android {
versionCode VERSIONCODE as Integer
versionName "4.59.0"
vectorDrawables.useSupportLibrary = true
if (!isFoss) {
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60" // See note below!
}
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60" // See note below!
resValue "string", "rn_config_reader_custom_package", "chat.rocket.reactnative"
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
Expand All @@ -120,31 +113,15 @@ android {
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
if (!isFoss) {
firebaseCrashlytics {
nativeSymbolUploadEnabled true
strippedNativeLibsDir 'build/intermediates/stripped_native_libs/release/out/lib'
unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
}
firebaseCrashlytics {
nativeSymbolUploadEnabled true
strippedNativeLibsDir 'build/intermediates/stripped_native_libs/release/out/lib'
unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
}
}
}

// packagingOptions {
// pickFirst '**/armeabi-v7a/libc++_shared.so'
// pickFirst '**/x86/libc++_shared.so'
// pickFirst '**/arm64-v8a/libc++_shared.so'
// pickFirst '**/x86_64/libc++_shared.so'
// }

// FIXME: Remove when we update RN
// packagingOptions {
// pickFirst '**/*.so'
// }

// applicationVariants are e.g. debug, release

flavorDimensions "app", "type"
flavorDimensions "app"
productFlavors {
official {
dimension = "app"
Expand All @@ -154,33 +131,6 @@ android {
dimension = "app"
buildConfigField "boolean", "IS_OFFICIAL", "false"
}
foss {
dimension = "type"
buildConfigField "boolean", "FDROID_BUILD", "true"
}
play {
dimension = "type"
buildConfigField "boolean", "FDROID_BUILD", "false"
}
}
sourceSets {
// TODO: refactor making sure notifications are working properly both on debug and release
experimentalPlayDebug {
java.srcDirs = ['src/main/java', 'src/play/java']
manifest.srcFile 'src/play/AndroidManifest.xml'
}
experimentalPlayRelease {
java.srcDirs = ['src/main/java', 'src/play/java']
manifest.srcFile 'src/play/AndroidManifest.xml'
}
officialPlayDebug {
java.srcDirs = ['src/main/java', 'src/play/java']
manifest.srcFile 'src/play/AndroidManifest.xml'
}
officialPlayRelease {
java.srcDirs = ['src/main/java', 'src/play/java']
manifest.srcFile 'src/play/AndroidManifest.xml'
}
}
}

Expand All @@ -196,11 +146,8 @@ dependencies {
}

implementation project(':@react-native-community_viewpager')
playImplementation project(':react-native-notifications')
playImplementation "com.google.firebase:firebase-messaging:23.3.1"
playImplementation project(':@react-native-firebase_app')
playImplementation project(':@react-native-firebase_analytics')
playImplementation project(':@react-native-firebase_crashlytics')
implementation project(':react-native-notifications')
implementation "com.google.firebase:firebase-messaging:23.3.1"
implementation project(':watermelondb-jsi')

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

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

This file was deleted.

12 changes: 12 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@
<data android:mimeType="*/*" />
</intent-filter>
</activity>
<receiver
android:name="chat.rocket.reactnative.notification.ReplyBroadcast"
android:enabled="true"
android:exported="true" />
<receiver
android:name="chat.rocket.reactnative.notification.DismissNotification"
android:enabled="true"
android:exported="true" >
</receiver>
<meta-data
android:name="com.bugsnag.android.API_KEY"
android:value="${BugsnagAPIKey}" />
</application>

<queries>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package chat.rocket.reactnative

import android.app.Application
import android.content.Context
import android.content.res.Configuration
import android.os.Bundle
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
Expand All @@ -9,18 +12,21 @@ import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader
import com.nozbe.watermelondb.jsi.WatermelonDBJSIPackage;
import com.facebook.react.bridge.JSIModulePackage;

import com.wix.reactnativenotifications.core.AppLaunchHelper
import com.wix.reactnativenotifications.core.AppLifecycleFacade
import com.wix.reactnativenotifications.core.JsIOHelper
import com.wix.reactnativenotifications.core.notification.INotificationsApplication
import com.wix.reactnativenotifications.core.notification.IPushNotification
import com.bugsnag.android.Bugsnag
import expo.modules.ApplicationLifecycleDispatcher
import expo.modules.ReactNativeHostWrapper
import chat.rocket.reactnative.networking.SSLPinningPackage;
import chat.rocket.reactnative.notification.CustomPushNotification;
import com.reactnativecommunity.viewpager.RNCViewPagerPackage;
import android.content.res.Configuration;

open class MainApplication : Application(), ReactApplication {
open class MainApplication : Application(), ReactApplication, INotificationsApplication {

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

override fun getJSIModulePackage(): JSIModulePackage {
Expand All @@ -50,6 +55,7 @@ open class MainApplication : Application(), ReactApplication {
override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
Bugsnag.start(this)

if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
Expand All @@ -62,4 +68,19 @@ open class MainApplication : Application(), ReactApplication {
super.onConfigurationChanged(newConfig)
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)
}

override fun getPushNotification(
context: Context,
bundle: Bundle,
defaultFacade: AppLifecycleFacade,
defaultAppLaunchHelper: AppLaunchHelper
): IPushNotification {
return CustomPushNotification(
context,
bundle,
defaultFacade,
defaultAppLaunchHelper,
JsIOHelper()
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chat.rocket.reactnative;
package chat.rocket.reactnative.notification;

import android.os.Bundle;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chat.rocket.reactnative;
package chat.rocket.reactnative.notification;

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

Expand Down Expand Up @@ -37,6 +37,8 @@
import java.util.Map;
import java.util.concurrent.ExecutionException;

import chat.rocket.reactnative.R;

public class CustomPushNotification extends PushNotification {
public static ReactApplicationContext reactApplicationContext;
final NotificationManager notificationManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chat.rocket.reactnative;
package chat.rocket.reactnative.notification;

import android.content.BroadcastReceiver;
import android.content.Context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chat.rocket.reactnative;
package chat.rocket.reactnative.notification;

import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.Callback;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chat.rocket.reactnative;
package chat.rocket.reactnative.notification;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chat.rocket.reactnative;
package chat.rocket.reactnative.notification;

import android.os.Bundle;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package chat.rocket.reactnative;
package chat.rocket.reactnative.notification;

import android.app.Notification;
import android.app.NotificationChannel;
Expand Down
26 changes: 0 additions & 26 deletions android/app/src/play/AndroidManifest.xml

This file was deleted.

This file was deleted.

Loading