Skip to content

Commit

Permalink
Final commit for 0.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaBavadekar committed Feb 15, 2023
1 parent 0a31cb1 commit ec24134
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 12 deletions.
8 changes: 5 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ plugins {

android {
compileSdk Versions.COMPILE_SDK
namespace "com.adityaamolbavadekar.messenger"

Properties properties = new Properties()
properties.load(project.rootProject.file("local.properties").newDataInputStream())
Expand All @@ -45,9 +46,8 @@ android {
buildConfigField "String", "DATE", "\"${new Date()}\""
buildConfigField "Long", "TIMESTAMP", "Long.parseLong(\"${System.currentTimeMillis()}\")"

buildConfigField "String", "FCM_MESSAGING_BASE_URL", "\"${properties.getProperty("FCM_MESSAGING_BASE_URL")}\""
buildConfigField "String", "FCM_MESSAGING_SERVER_KEY", "\"${properties.getProperty("FCM_MESSAGING_SERVER_KEY")}\""
buildConfigField "String", "FCM_MESSAGING_CONTENT_TYPE", "\"${properties.getProperty("FCM_MESSAGING_CONTENT_TYPE")}\""
buildConfigField "String", "MESSENGER_URL", "\"https://github.com/AdityaBavadekar/Messenger\""

}

Expand Down Expand Up @@ -123,10 +123,12 @@ dependencies {
implementation Dependencies.CONSTRAINT_LAYOUT
implementation Dependencies.EMOJI2
implementation platform(Dependencies.FIREBASE_BOM)
implementation Dependencies.FIREBASE_APPCHECK
implementation Dependencies.FIREBASE_APPCHECK_PLAY
implementation Dependencies.FIREBASE_AUTH
implementation Dependencies.FIREBASE_DATABASE
implementation Dependencies.FIREBASE_STORAGE
implementation Dependencies.FIREBASE_MESSAGING
implementation Dependencies.FIREBASE_STORAGE
implementation Dependencies.FRAGMENT_KTX
implementation Dependencies.GLIDE
kapt Dependencies.GLIDE_COMPILER
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.adityaamolbavadekar.messenger">
xmlns:tools="http://schemas.android.com/tools">

<!-- FCM Messaging -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <!-- Normal -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.adityaamolbavadekar.messenger.utils

import android.content.Context

class AppCheckUtil {
companion object {
fun activate(context: Context) {
/*FirebaseApp.initializeApp(context)
val firebaseAppCheck = FirebaseAppCheck.getInstance()
firebaseAppCheck.installAppCheckProviderFactory(
PlayIntegrityAppCheckProviderFactory.getInstance()
)*/
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ object Constants {
}

internal object FcmMessaging {
const val FCM_MESSAGING_BASE_URL = com.adityaamolbavadekar.messenger.BuildConfig.FCM_MESSAGING_BASE_URL
const val FCM_MESSAGING_BASE_URL = "https://fcm.googleapis.com/fcm/send"
const val FCM_MESSAGING_SERVER_KEY =com.adityaamolbavadekar.messenger.BuildConfig.FCM_MESSAGING_SERVER_KEY
const val FCM_MESSAGING_CONTENT_TYPE =com.adityaamolbavadekar.messenger.BuildConfig.FCM_MESSAGING_CONTENT_TYPE
const val FCM_MESSAGING_CONTENT_TYPE ="application/json"
}

internal object Application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ object AppStartup {
MessengerAccountAuthenticator.account(application.applicationContext)?.let {
try {
ContentResolver.requestSync(it, Constants.DATA_SYNC_AUTHORITY, Bundle())
} catch (e: Exception) {
} catch (_: Exception) {
}
}
methodTracer.putTraceData("onApplicationCreated", "finished").end()
Expand Down
29 changes: 29 additions & 0 deletions app/src/main/res/drawable/ic_group.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!--
~
~ Copyright 2022 Aditya Bavadekar
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?android:textColor"
>
<path
android:fillColor="@android:color/white"
android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8s1.34,3 3,3zM8,13c-2.33,0 -7,1.17 -7,3.5L1,19h14v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5zM16,13c-0.29,0 -0.62,0.02 -0.97,0.05 1.16,0.84 1.97,1.97 1.97,3.45L17,19h6v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5z" />
</vector>
28 changes: 28 additions & 0 deletions app/src/main/res/drawable/ic_self_conversation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
~
~ Copyright 2022 Aditya Bavadekar
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
>
<path
android:fillColor="@android:color/white"
android:pathData="M17,20L5,20c-0.55,0 -1,-0.45 -1,-1L4,7c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v13c0,1.1 0.9,2 2,2h13c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1zM20,2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,12l-2.5,-1.5L15,12L15,4h5v8z"/>
</vector>
28 changes: 28 additions & 0 deletions app/src/main/res/drawable/ic_user_profile_default.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
~
~ Copyright 2022 Aditya Bavadekar
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:colorControlNormal">
<path
android:fillColor="#FF000000"
android:pathData="M12,2C6.579,2 2,6.579 2,12s4.579,10 10,10 10,-4.579 10,-10S17.421,2 12,2zM12,7c1.727,0 3,1.272 3,3s-1.273,3 -3,3c-1.726,0 -3,-1.272 -3,-3s1.274,-3 3,-3zM6.894,16.772c0.897,-1.32 2.393,-2.2 4.106,-2.2h2c1.714,0 3.209,0.88 4.106,2.2C15.828,18.14 14.015,19 12,19s-3.828,-0.86 -5.106,-2.228z" />
</vector>
4 changes: 3 additions & 1 deletion buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ object Dependencies {
const val COROUTINES_CORE = Libs.COROUTINES_CORE + ":" + Versions.COROUTINES_CORE
const val EMOJI2 = Libs.EMOJI2 + ":" + Versions.EMOJI2
const val FIREBASE_BOM = Libs.FIREBASE_BOM + ":" + Versions.FIREBASE_BOM
const val FIREBASE_APPCHECK = Libs.FIREBASE_APPCHECK + ":" + Versions.FIREBASE_APPCHECK
const val FIREBASE_APPCHECK_PLAY = Libs.FIREBASE_APPCHECK_PLAY
const val FIREBASE_AUTH = Libs.FIREBASE_AUTH
const val FIREBASE_DATABASE = Libs.FIREBASE_DATABASE
const val FIREBASE_STORAGE = Libs.FIREBASE_STORAGE
const val FIREBASE_MESSAGING = Libs.FIREBASE_MESSAGING
const val FIREBASE_STORAGE = Libs.FIREBASE_STORAGE
const val FRAGMENT_KTX = Libs.FRAGMENT_KTX + ":" + Versions.FRAGMENT_KTX
const val GLIDE = Libs.GLIDE + ":" + Versions.GLIDE
const val GLIDE_COMPILER = Libs.GLIDE + ":" + Versions.GLIDE
Expand Down
4 changes: 3 additions & 1 deletion buildSrc/src/main/java/Libs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ object Libs {
const val COROUTINES_CORE = "org.jetbrains.kotlinx:kotlinx-coroutines-core"
const val EMOJI2 = "androidx.emoji2:emoji2"
const val FIREBASE_BOM = "com.google.firebase:firebase-bom"
const val FIREBASE_APPCHECK = "com.google.firebase:firebase-appcheck-safetynet"
const val FIREBASE_APPCHECK_PLAY = "com.google.firebase:firebase-appcheck-playintegrity"
const val FIREBASE_AUTH = "com.google.firebase:firebase-auth-ktx"
const val FIREBASE_DATABASE = "com.google.firebase:firebase-database-ktx"
const val FIREBASE_STORAGE = "com.google.firebase:firebase-storage-ktx"
const val FIREBASE_MESSAGING = "com.google.firebase:firebase-messaging-ktx"
const val FIREBASE_STORAGE = "com.google.firebase:firebase-storage-ktx"
const val FRAGMENT_KTX = "androidx.fragment:fragment-ktx"
const val GLIDE = "com.github.bumptech.glide:glide"
const val GLIDE_COMPILER = "com.github.bumptech.glide:compiler"
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ object Versions {
const val COROUTINES_CORE = "1.5.2"
const val EMOJI2 = "1.2.0-alpha04"
const val FIREBASE_BOM = "31.2.0"
const val FIREBASE_APPCHECK = "16.1.1"
const val FRAGMENT_KTX = "1.4.0"
const val GLIDE = "4.12.0"
const val JSOUP = "1.11.3"
Expand Down
2 changes: 1 addition & 1 deletion model/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
~
-->

<manifest package="com.adityaamolbavadekar.messenger.model">
<manifest>

<application />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ data class LinkPreviewInfo(
}

fun getHost(): String? {
return Uri.parse(url).host?.toLowerCase(Locale.ROOT)
return Uri.parse(url).host?.lowercase(Locale.ROOT)
}

fun uri(): Uri {
Expand Down
5 changes: 5 additions & 0 deletions stub_local.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FCM_MESSAGING_SERVER_KEY=SERVER_KEY_FROM_FIREBASE_CONSOLE
KEY_ALIAS=ALIAS
KEY_PASSWORD=PASSWORD
STORE_PASSWORD=PASSWORD
STORE_FILE=C\:\\MY_PATH

0 comments on commit ec24134

Please sign in to comment.