Skip to content

Commit

Permalink
EOF-22
Browse files Browse the repository at this point in the history
EOF-22
  • Loading branch information
umerov1999 committed Sep 22, 2023
1 parent 57819c5 commit e3133fa
Show file tree
Hide file tree
Showing 626 changed files with 15,376 additions and 8,742 deletions.
26 changes: 14 additions & 12 deletions app_fenrir/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ android {
aidl = true
buildConfig = true
}
packagingOptions {
exclude("META-INF/notice.txt")
exclude("META-INF/license.txt")
exclude("META-INF/LICENSE")
exclude("META-INF/NOTICE")
exclude("META-INF/*.version")
exclude("META-INF/versions/**")
packaging {
jniLibs {
useLegacyPackaging = true
}
resources.excludes.add("META-INF/notice.txt")
resources.excludes.add("META-INF/license.txt")
resources.excludes.add("META-INF/LICENSE")
resources.excludes.add("META-INF/NOTICE")
resources.excludes.add("META-INF/*.version")
resources.excludes.add("META-INF/versions/**")
}

dependenciesInfo {
Expand All @@ -29,7 +32,6 @@ android {
ndkVersion = appNdk

defaultConfig {
generatedDensities = []
minSdk = appMinSDK
targetSdk = appTargetSDK
versionCode = appFenrirVersionCode
Expand Down Expand Up @@ -75,8 +77,9 @@ android {

buildTypes {
release {
minifyEnabled = false
shrinkResources = false
minifyEnabled = true
shrinkResources = true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled = false
Expand Down Expand Up @@ -121,7 +124,6 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-common:$lifecycleVersion")
implementation("androidx.annotation:annotation:$annotationVersion")
//implementation("androidx.recyclerview:recyclerview:$recyclerviewVersion")
implementation("androidx.vectordrawable:vectordrawable:$vectordrawableVersion")
implementation("androidx.appcompat:appcompat:$appcompatVersion")
implementation("androidx.customview:customview:$customviewVersion")
Expand Down Expand Up @@ -166,7 +168,7 @@ dependencies {
//implementation("androidx.camera:camera-view:$cameraVersion")
//implementation("androidx.camera:camera-camera2:$cameraVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlin_serializer")
implementation("com.google.errorprone:error_prone_annotations:${errorproneVersion}")
implementation("com.google.errorprone:error_prone_annotations:${errorProneVersion}")

modules {
module("com.google.guava:listenablefuture") {
Expand Down
61 changes: 61 additions & 0 deletions app_fenrir/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
-dontobfuscate

# Disable the annoying "Parameter specified as non-null is null" exceptions
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
}

-keep public class * extends java.lang.Exception

# BASE APP
-keep class dev.ragnarok.fenrir.** { *; }
-keep class dev.ragnarok.filegallery.** { *; }


#Native Library
-keep class com.google.zxing.** { *; }
-keep class com.github.luben.zstd.** { *; }
-keep class androidx.media3.decoder.ffmpeg.** { *; }
-keep class androidx.media3.decoder.opus.** { *; }

#Camera2
-keep public class androidx.camera.camera2.Camera2Config$DefaultProvider { *; }
-keep,allowobfuscation,allowshrinking class ** implements androidx.camera.core.impl.Quirk


#Firebase Installation
-keep class com.google.firebase.installations.** { *; }


#image
-keep class com.yalantis.ucrop.** { *; }
-keep class me.minetsh.imaging.** { *; }



#material
# CoordinatorLayout resolves the behaviors of its child components with reflection.
-keep public class * extends androidx.coordinatorlayout.widget.CoordinatorLayout$Behavior {
public <init>(android.content.Context, android.util.AttributeSet);
public <init>();
}
# Make sure we keep annotations for CoordinatorLayout's DefaultBehavior
-keepattributes RuntimeVisible*Annotation*
-if class androidx.appcompat.app.AppCompatViewInflater
-keep class com.google.android.material.theme.MaterialComponentsViewInflater {
<init>();
}


#picasso
-keep class com.squareup.picasso3.** { *; }


#preferences
-keep class de.maxr1998.modernpreferences.** { *; }



#viewpager2
-keep class androidx.recyclerview.** { *; }
-keep class androidx.viewpager2.** { *; }
14 changes: 7 additions & 7 deletions app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class App : Application() {
super.onCreate()

AppCompatDelegate.setDefaultNightMode(Settings.get().ui().nightMode)
if (Settings.get().other().isDeveloper_mode) {
if (Settings.get().main().isDeveloper_mode) {
CrashUtils.install(this)
}

if (Settings.get().other().isEnable_native) {
if (Settings.get().main().isEnable_native) {
FenrirNative.loadNativeLibrary(object : FenrirNative.NativeOnException {
override fun onException(e: Error) {
PersistentLogger.logThrowable("NativeError", e)
Expand All @@ -57,11 +57,11 @@ class App : Application() {
MusicPlaybackController.tracksExist = FileExistJVM()
}

Utils.isCompressIncomingTraffic = Settings.get().other().isCompress_incoming_traffic
Utils.isCompressOutgoingTraffic = Settings.get().other().isCompress_outgoing_traffic
Utils.currentParser = Settings.get().other().currentParser
Utils.isCompressIncomingTraffic = Settings.get().main().isCompress_incoming_traffic
Utils.isCompressOutgoingTraffic = Settings.get().main().isCompress_outgoing_traffic
Utils.currentParser = Settings.get().main().currentParser
PicassoInstance.init(this, Includes.proxySettings)
if (Settings.get().other().isKeepLongpoll) {
if (Settings.get().main().isKeepLongpoll) {
KeepLongpollService.start(this)
}
compositeDisposable.add(messages
Expand Down Expand Up @@ -103,7 +103,7 @@ class App : Application() {
RxJavaPlugins.setErrorHandler {
it.printStackTrace()
Handler(mainLooper).post {
if (Settings.get().other().isDeveloper_mode) {
if (Settings.get().main().isDeveloper_mode) {
createCustomToast(this).showToastError(
ErrorLocalizer.localizeThrowable(
this,
Expand Down
8 changes: 4 additions & 4 deletions app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ object Constants {
const val API_VERSION = "5.131"
const val AUTH_VERSION = API_VERSION

const val DATABASE_FENRIR_VERSION = 40
const val DATABASE_TEMPORARY_VERSION = 6
const val DATABASE_FENRIR_VERSION = 41
const val DATABASE_TEMPORARY_VERSION = 8
const val EXPORT_SETTINGS_FORMAT = 1
const val forceDeveloperMode = BuildConfig.FORCE_DEVELOPER_MODE

Expand All @@ -17,8 +17,8 @@ object Constants {
const val FILE_PROVIDER_AUTHORITY: String = BuildConfig.APPLICATION_ID + ".file_provider"
const val VK_ANDROID_APP_VERSION_NAME = "8.15"
const val VK_ANDROID_APP_VERSION_CODE = "15271"
const val KATE_APP_VERSION_NAME = "100 lite"
const val KATE_APP_VERSION_CODE = "536"
const val KATE_APP_VERSION_NAME = "104.1 lite"
const val KATE_APP_VERSION_CODE = "542"
const val API_ID: Int = BuildConfig.VK_API_APP_ID
const val SECRET: String = BuildConfig.VK_CLIENT_SECRET
const val PHOTOS_PATH = "DCIM/Fenrir"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class FcmListenerService : FirebaseMessagingService() {
.accounts()
.current
if (accountId == ISettings.IAccountsSettings.INVALID_ID || pushType.isNullOrEmpty() || Settings.get()
.other().isSettings_no_push
.main().isSettings_no_push
) {
return
}
Expand All @@ -46,7 +46,7 @@ class FcmListenerService : FirebaseMessagingService() {
Logger.d(TAG, "Invalid push registration on VK")
return
}
if (Settings.get().other().isDump_fcm && PushType.ERASE != pushType) {
if (Settings.get().main().isDump_fcm && PushType.ERASE != pushType) {
if (Constants.IS_DEBUG) {
Logger.d(
TAG,
Expand Down
2 changes: 1 addition & 1 deletion app_fenrir/src/main/kotlin/dev/ragnarok/fenrir/Includes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object Includes {
VoicePlayerFactory(
provideApplicationContext(),
proxySettings,
settings.other()
settings.main()
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ class DeltaOwnerActivity : AppCompatActivity(), PlaceProvider, AppStyleable {
.fromIOToMain()
.subscribe({ owner ->
Export.setOnClickListener {
DownloadWorkUtils.CheckDirectory(Settings.get().other().docDir)
DownloadWorkUtils.CheckDirectory(Settings.get().main().docDir)
val file = File(
Settings.get().other().docDir, DownloadWorkUtils.makeLegalFilename(
Settings.get().main().docDir, DownloadWorkUtils.makeLegalFilename(
"OwnerChanges_" + owner.owner.fullName.orEmpty() + "_" + DOWNLOAD_DATE_FORMAT.format(
delta.time * 1000L
), "json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,11 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect
private var isZoomPhoto = false
private val snowLayout: Int
get() = if (Settings.get()
.other().is_side_navigation
.main().is_side_navigation
) R.layout.activity_main_side_with_snow else R.layout.activity_main_with_snow
private val normalLayout: Int
get() = if (Settings.get()
.other().is_side_navigation
.main().is_side_navigation
) R.layout.activity_main_side else R.layout.activity_main

@MainActivityTransforms
Expand Down Expand Up @@ -392,7 +392,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect
Utils.registerColorsThorVG(this)

super.onCreate(savedInstanceState)
isZoomPhoto = Settings.get().other().isDo_zoom_photo
isZoomPhoto = Settings.get().main().isDo_zoom_photo
mCompositeDisposable.add(
Settings.get()
.accounts()
Expand All @@ -419,7 +419,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect

mViewFragment = findViewById(R.id.fragment)
val anim: ObjectAnimator
if (mDrawerLayout != null && Settings.get().other().is_side_navigation) {
if (mDrawerLayout != null && Settings.get().main().is_side_navigation) {
navigationView?.setUp(mDrawerLayout)
anim = ObjectAnimator.ofPropertyValuesHolder(
mViewFragment, PropertyValuesHolder.ofFloat(
Expand Down Expand Up @@ -487,22 +487,22 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect
)
.fromIOToMain()
.subscribe(RxUtils.dummy()) { t ->
if (Settings.get().other().isDeveloper_mode) {
if (Settings.get().main().isDeveloper_mode) {
createCustomToast(this).showToastThrowable(t)
}
})
Settings.get().other().last_audio_sync.let {
Settings.get().main().last_audio_sync.let {
if (it > 0 && (System.currentTimeMillis() / 1000L) - it > 900) {
Settings.get().other().set_last_audio_sync(-1)
Settings.get().main().set_last_audio_sync(-1)
mCompositeDisposable.add(
Includes.stores.tempStore().deleteAudios()
.fromIOToMain()
.subscribe(RxUtils.dummy(), RxUtils.ignore())
)
}
}
Settings.get().other().appStoredVersionEqual
if (Settings.get().other().isDelete_cache_images) {
Settings.get().main().appStoredVersionEqual
if (Settings.get().main().isDelete_cache_images) {
cleanCache(this, false)
}
}
Expand Down Expand Up @@ -535,7 +535,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect
return
}
}
if (supportFragmentManager.backStackEntryCount == 1) {
if (supportFragmentManager.backStackEntryCount == 1 || supportFragmentManager.backStackEntryCount <= 0) {
if (getMainActivityTransform() != MainActivityTransforms.SWIPEBLE) {
if (isFragmentWithoutNavigation) {
openNavigationPage(AbsNavigationView.SECTION_ITEM_FEED, false)
Expand Down Expand Up @@ -596,13 +596,13 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect

private fun checkFCMRegistration(onlyCheckGMS: Boolean) {
if (!checkPlayServices(this)) {
if (!Settings.get().other().isDisabledErrorFCM) {
if (!Settings.get().main().isDisabledErrorFCM) {
mViewFragment?.let {
CustomSnackbars.createCustomSnackbars(mViewFragment, mBottomNavigationContainer)
?.setDurationSnack(BaseTransientBottomBar.LENGTH_LONG)
?.themedSnack(R.string.this_device_does_not_support_fcm)
?.setAction(R.string.button_access) {
Settings.get().other().setDisableErrorFCM(true)
Settings.get().main().setDisableErrorFCM(true)
}
?.show()
}
Expand Down Expand Up @@ -637,7 +637,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect
if (!isFragmentWithoutNavigation) {
mToolbar?.setNavigationIcon(
if (Settings.get()
.other().isRunes_show
.main().isRunes_show
) R.drawable.client_round else R.drawable.client_round_vk
)
mToolbar?.setNavigationOnClickListener {
Expand Down Expand Up @@ -801,7 +801,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect
navigationView?.onAccountChange(newAccountId)
Accounts.showAccountSwitchedToast(this)
updateNotificationCount(newAccountId)
if (!Settings.get().other().isDeveloper_mode) {
if (!Settings.get().main().isDeveloper_mode) {
stop()
}
}
Expand Down Expand Up @@ -984,7 +984,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect
}

private fun openChat(accountId: Long, messagesOwnerId: Long, peer: Peer, closeMain: Boolean) {
if (Settings.get().other().isEnable_show_recent_dialogs) {
if (Settings.get().main().isEnable_show_recent_dialogs) {
val recentChat = RecentChat(accountId, peer.id, peer.getTitle(), peer.avaUrl)
navigationView?.appendRecentChat(recentChat)
navigationView?.refreshNavigationItems()
Expand Down Expand Up @@ -1084,7 +1084,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect
}
mCurrentFrontSection = item
navigationView?.selectPage(item)
if (Settings.get().other().isDo_not_clear_back_stack && menu && isPlaying) {
if (Settings.get().main().isDo_not_clear_back_stack && menu && isPlaying) {
doClearBackStack = !doClearBackStack
}
if (doClearBackStack) {
Expand Down Expand Up @@ -1272,7 +1272,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect
}

override fun onChatResume(accountId: Long, peerId: Long, title: String?, imgUrl: String?) {
if (Settings.get().other().isEnable_show_recent_dialogs) {
if (Settings.get().main().isEnable_show_recent_dialogs) {
val recentChat = RecentChat(accountId, peerId, title, imgUrl)
navigationView?.appendRecentChat(recentChat)
navigationView?.refreshNavigationItems()
Expand Down Expand Up @@ -1338,12 +1338,12 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect
navigationView?.closeSheet()
navigationView?.blockSheet()
mBottomNavigationContainer?.visibility = View.GONE
if (Settings.get().other().is_side_navigation) {
if (Settings.get().main().is_side_navigation) {
findViewById<MaterialCardView>(R.id.miniplayer_side_root)?.visibility = View.GONE
}
} else {
mBottomNavigationContainer?.visibility = View.VISIBLE
if (Settings.get().other().is_side_navigation) {
if (Settings.get().main().is_side_navigation) {
findViewById<MaterialCardView>(R.id.miniplayer_side_root)?.visibility = View.VISIBLE
}
navigationView?.unblockSheet()
Expand Down Expand Up @@ -1458,7 +1458,7 @@ open class MainActivity : AppCompatActivity(), NavigationDrawerCallbacks, OnSect
}

Place.AUDIOS -> attachToFront(
if (Settings.get().other().isAudio_catalog_v2) CatalogV2ListFragment.newInstance(
if (Settings.get().main().isAudio_catalog_v2) CatalogV2ListFragment.newInstance(
args.getLong(Extra.ACCOUNT_ID),
args.getLong(Extra.OWNER_ID)
) else AudiosTabsFragment.newInstance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class NoMainActivity : AppCompatActivity() {
Utils.prepareDensity(this)
Utils.registerColorsThorVG(this)
super.onCreate(savedInstanceState)
isZoomPhoto = Settings.get().other().isDo_zoom_photo
isZoomPhoto = Settings.get().main().isDo_zoom_photo
setContentView(getNoMainContentView())
val w = window
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
Expand Down
Loading

0 comments on commit e3133fa

Please sign in to comment.