-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* - add proguard rules; * add active inactive state (#47) * remove initForChat * remove dialog.join() (#49) * fix allMessageListener initialization * update version to 1.2.1 Co-authored-by: TatankaConCube <48598737+TatankaConCube@users.noreply.github.com>
- Loading branch information
1 parent
71f29ae
commit 2bd96d3
Showing
11 changed files
with
162 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-keep class com.connectycube.auth.model.** { !transient <fields>; } | ||
|
||
-keep class com.connectycube.chat.model.** { !transient <fields>; } | ||
|
||
-keep class com.connectycube.core.model.** { !transient <fields>; } | ||
-keep class com.connectycube.core.server.** { *; } | ||
-keep class com.connectycube.core.rest.** { *; } | ||
-keep class com.connectycube.core.error.** { *; } | ||
-keep class com.connectycube.core.account.model.** { !transient <fields>; } | ||
|
||
-keep class com.connectycube.customobjects.model.** { !transient <fields>; } | ||
|
||
# uncomment if use Connectycube Extentions lib | ||
#-keep class com.connectycube.extensions.** { *; } | ||
|
||
-keep class com.connectycube.pushnotifications.model.** { !transient <fields>; } | ||
|
||
-keep class com.connectycube.storage.model.** { !transient <fields>; } | ||
|
||
-keep class com.connectycube.users.model.** { !transient <fields>; } | ||
|
||
-keep class com.connectycube.videochat.** { *; } | ||
|
||
-keep class org.jivesoftware.** { *; } | ||
|
||
-dontwarn org.jivesoftware.smackx.** | ||
|
||
-keep class org.webrtc.** { *; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
##---------------Begin: proguard configuration for Gson ---------- | ||
# Gson uses generic type information stored in a class file when working with fields. Proguard | ||
# removes such information by default, so configure it to keep all of it. | ||
-keepattributes Signature | ||
|
||
# For using GSON @Expose annotation | ||
-keepattributes *Annotation* | ||
|
||
# Gson specific classes | ||
-dontwarn sun.misc.** | ||
#-keep class com.google.gson.stream.** { *; } | ||
|
||
# Application classes that will be serialized/deserialized over Gson | ||
-keep class com.google.gson.examples.android.model.** { <fields>; } | ||
|
||
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory, | ||
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) | ||
-keep class * extends com.google.gson.TypeAdapter | ||
-keep class * implements com.google.gson.TypeAdapterFactory | ||
-keep class * implements com.google.gson.JsonSerializer | ||
-keep class * implements com.google.gson.JsonDeserializer | ||
|
||
# Prevent R8 from leaving Data object members always null | ||
-keepclassmembers,allowobfuscation class * { | ||
@com.google.gson.annotations.SerializedName <fields>; | ||
} | ||
|
||
##---------------End: proguard configuration for Gson ---------- |
52 changes: 52 additions & 0 deletions
52
app/src/main/java/com/connectycube/messenger/ChatAppLifecycleObserver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.connectycube.messenger | ||
|
||
import androidx.lifecycle.* | ||
import com.connectycube.chat.ConnectycubeChatService | ||
import com.connectycube.messenger.events.EVENT_CHAT_LOGIN | ||
import com.connectycube.messenger.events.EventChatConnection | ||
import com.connectycube.messenger.events.LiveDataBus | ||
import timber.log.Timber | ||
|
||
|
||
class ChatAppLifecycleObserver : DefaultLifecycleObserver { | ||
|
||
fun registeredObserver() { | ||
ProcessLifecycleOwner.get().lifecycle.addObserver(this) | ||
} | ||
|
||
private fun registeredEventChat(lifecycle: LifecycleOwner) { | ||
LiveDataBus.subscribe(EVENT_CHAT_LOGIN, lifecycle, Observer<EventChatConnection> { | ||
if (it.connected) { | ||
Timber.d("connected") | ||
if (ProcessLifecycleOwner.get().lifecycle.currentState == Lifecycle.State.RESUMED) { | ||
Timber.d("connected enterActiveState") | ||
ConnectycubeChatService.getInstance().enterActiveState() | ||
} | ||
} | ||
}) | ||
} | ||
|
||
private fun unregisteredEventChat(lifecycle: LifecycleOwner) { | ||
LiveDataBus.unsubscribe<EventChatConnection>(EVENT_CHAT_LOGIN, lifecycle) | ||
} | ||
|
||
fun unregisteredObserver() { | ||
ProcessLifecycleOwner.get().lifecycle.removeObserver(this) | ||
} | ||
|
||
override fun onStart(owner: LifecycleOwner) { | ||
registeredEventChat(owner) | ||
if (ConnectycubeChatService.getInstance().isLoggedIn) { | ||
Timber.d("onStart enterActiveState") | ||
ConnectycubeChatService.getInstance().enterActiveState() | ||
} | ||
} | ||
|
||
override fun onStop(owner: LifecycleOwner) { | ||
unregisteredEventChat(owner) | ||
if (ConnectycubeChatService.getInstance().isLoggedIn) { | ||
Timber.d("onStop enterInactiveState") | ||
ConnectycubeChatService.getInstance().enterInactiveState() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters