Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
What a fucking cancer.
Browse files Browse the repository at this point in the history
  • Loading branch information
K1rakishou committed Sep 29, 2024
1 parent 1d60f4e commit 4cce9ae
Show file tree
Hide file tree
Showing 74 changed files with 3 additions and 179 deletions.
17 changes: 0 additions & 17 deletions Kuroba/app/proguard.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -70,29 +70,12 @@
@android.webkit.JavascriptInterface <methods>;
}

-keep @org.greenrobot.eventbus.Subscribe class *

#-keep public class * extends android.support.design.**

# Keep Feather inject working.
-keepclassmembers,allowobfuscation class * {
@javax.inject.* *;
<init>();
}

-keepclassmembers class * {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }

-keep,allowobfuscation @interface com.github.k1rakishou.common.DoNotStrip

# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.github.k1rakishou.common.DoNotStrip class *
-keepclassmembers class * {
@com.github.k1rakishou.common.DoNotStrip *;
}

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.github.k1rakishou.chan.core.base

import androidx.annotation.CallSuper
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.common.ModularResult
import io.reactivex.disposables.CompositeDisposable
import kotlinx.coroutines.CancellationException
Expand All @@ -12,7 +11,6 @@ import kotlinx.coroutines.cancel
import kotlinx.coroutines.plus
import kotlinx.coroutines.withContext

@DoNotStrip
abstract class BasePresenter<V> {
private var view: V? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.github.k1rakishou.common.DoNotStrip;

import java.io.File;

/**
* Callback call order:
*
* onStart -> onProgress (?) -> (onSuccess | onFail | onNotFound | onStop | onCancel) -> onEnd
* */
@DoNotStrip
public abstract class FileCacheListener {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.github.k1rakishou.chan.core.cache.downloader

import com.github.k1rakishou.common.DoNotStrip
import okhttp3.HttpUrl
import java.io.File

@DoNotStrip
internal sealed class FileDownloadEvent {
fun rethrowUnsatisfiableRangeHttpError() {
when (this) {
Expand Down Expand Up @@ -52,7 +50,6 @@ internal sealed class FileDownloadEvent {
}
}

@DoNotStrip
internal sealed class MediaDownloadException(message: String) : Exception(message) {

fun rethrowUnsatisfiableRangeHttpError() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import com.github.k1rakishou.chan.utils.BackgroundUtils
import com.github.k1rakishou.chan.utils.MediaUtils
import com.github.k1rakishou.chan.utils.lifecycleFromContextOrNull
import com.github.k1rakishou.common.BadContentTypeException
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.common.ModularResult
import com.github.k1rakishou.common.ModularResult.Companion.Try
import com.github.k1rakishou.common.ModularResult.Companion.value
Expand Down Expand Up @@ -79,7 +78,6 @@ import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicReference
import kotlin.time.measureTimedValue

@DoNotStrip
@Deprecated("There are bugs when using suspend versions of load functions related to cancellation. Use KurobaImageLoader instead!")
class ImageLoaderDeprecated(
private val verboseLogs: Boolean,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.github.k1rakishou.chan.core.loader

import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.model.data.descriptor.PostDescriptor
import kotlinx.coroutines.Job
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicReference

@DoNotStrip
class PostLoaderData(
val catalogMode: Boolean,
val postDescriptor: PostDescriptor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.content.Context
import androidx.annotation.GuardedBy
import com.github.k1rakishou.chan.core.site.sites.chan4.Chan4
import com.github.k1rakishou.common.AppConstants
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.common.ModularResult
import com.github.k1rakishou.common.ModularResult.Companion.Try
import com.github.k1rakishou.common.SuspendableInitializer
Expand All @@ -29,7 +28,6 @@ import kotlin.concurrent.read
import kotlin.concurrent.write
import kotlin.time.measureTime

@DoNotStrip
open class ArchivesManager(
gson: Lazy<Gson>,
private val appContext: Context,
Expand Down Expand Up @@ -231,7 +229,6 @@ open class ArchivesManager(
}
}

@DoNotStrip
class ArchiveData(
@Expose
@SerializedName("name")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.github.k1rakishou.chan.core.manager

import androidx.annotation.GuardedBy
import com.github.k1rakishou.chan.core.base.DebouncingCoroutineExecutor
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.common.ModularResult
import com.github.k1rakishou.common.SuspendableInitializer
import com.github.k1rakishou.common.linkedMapWithCap
Expand All @@ -28,7 +27,6 @@ import kotlin.concurrent.read
import kotlin.concurrent.write
import kotlin.time.measureTime

@DoNotStrip
class BoardManager(
private val appScope: CoroutineScope,
private val isDevFlavor: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.github.k1rakishou.chan.core.manager
import androidx.annotation.GuardedBy
import com.github.k1rakishou.chan.core.base.DebouncingCoroutineExecutor
import com.github.k1rakishou.chan.core.base.SerializedCoroutineExecutor
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.common.ModularResult
import com.github.k1rakishou.common.SuspendableInitializer
import com.github.k1rakishou.common.mutableListWithCap
Expand All @@ -26,7 +25,7 @@ import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.launch
import okhttp3.HttpUrl
import org.joda.time.DateTime
import java.util.*
import java.util.BitSet
import java.util.concurrent.locks.ReentrantReadWriteLock
import kotlin.concurrent.read
import kotlin.concurrent.write
Expand Down Expand Up @@ -721,7 +720,6 @@ class BookmarksManager(
val initialFlags: BitSet? = null
)

@DoNotStrip
sealed class BookmarkChange {
object BookmarksInitialized : BookmarkChange()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.github.k1rakishou.chan.core.manager

import androidx.annotation.GuardedBy
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.common.mutableIteration
import com.github.k1rakishou.common.mutableMapWithCap
import com.github.k1rakishou.common.putIfNotContains
Expand All @@ -15,7 +14,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock
import kotlin.concurrent.read
import kotlin.concurrent.write

@DoNotStrip
open class PostFilterManager(
private val verboseLogsEnabled: Boolean,
private val appScope: CoroutineScope,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.annotation.GuardedBy
import com.github.k1rakishou.chan.core.base.DebouncingCoroutineExecutor
import com.github.k1rakishou.chan.core.site.Site
import com.github.k1rakishou.chan.core.site.SiteRegistry
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.common.ModularResult
import com.github.k1rakishou.common.SuspendableInitializer
import com.github.k1rakishou.common.mutableListWithCap
Expand All @@ -26,7 +25,6 @@ import kotlin.concurrent.read
import kotlin.concurrent.write
import kotlin.time.measureTime

@DoNotStrip
open class SiteManager(
private val appScope: CoroutineScope,
private val isDevFlavor: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@

import android.util.SparseArray;

import com.github.k1rakishou.common.DoNotStrip;

@DoNotStrip
public class KeyMapping {
public static final SparseArray<String> map = new SparseArray<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.github.k1rakishou.common.DoNotStrip;
import com.github.k1rakishou.common.KotlinExtensionsKt;
import com.github.k1rakishou.core_logger.Logger;

Expand All @@ -29,7 +28,6 @@
import java.util.List;
import java.util.Map;

@DoNotStrip
@SuppressWarnings("unused")
public class MPVLib {
private static final String TAG = "MPVLib";
Expand Down Expand Up @@ -395,7 +393,6 @@ public static Map<String, Boolean> getInstalledLibraries(Context context, File m
return checkedLibsMap;
}

@DoNotStrip
public static class MismatchedVersionException extends Exception {

public MismatchedVersionException(int playerVersion, int supportedVersion) {
Expand All @@ -405,7 +402,6 @@ public MismatchedVersionException(int playerVersion, int supportedVersion) {
}
}

@DoNotStrip
public interface EventObserver {
void eventProperty(@NonNull String property);

Expand All @@ -418,12 +414,10 @@ public interface EventObserver {
void event(int eventId);
}

@DoNotStrip
public interface LogObserver {
void logMessage(@NonNull String prefix, int level, @NonNull String text);
}

@DoNotStrip
public static class mpvFormat {
public static final int MPV_FORMAT_NONE = 0;
public static final int MPV_FORMAT_STRING = 1;
Expand All @@ -437,7 +431,6 @@ public static class mpvFormat {
public static final int MPV_FORMAT_BYTE_ARRAY = 9;
}

@DoNotStrip
public static class mpvEventId {
public static final int MPV_EVENT_NONE = 0;
public static final int MPV_EVENT_SHUTDOWN = 1;
Expand All @@ -460,7 +453,6 @@ public static class mpvEventId {
public static final int MPV_EVENT_HOOK = 25;
}

@DoNotStrip
public static class mpvLogLevel {
public static final int MPV_LOG_LEVEL_NONE = 0;
public static final int MPV_LOG_LEVEL_FATAL = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import com.github.k1rakishou.chan.core.mpv.MPVLib.mpvFormat.MPV_FORMAT_INT64
import com.github.k1rakishou.chan.core.mpv.MPVLib.mpvFormat.MPV_FORMAT_NONE
import com.github.k1rakishou.chan.core.mpv.MPVLib.mpvFormat.MPV_FORMAT_STRING
import com.github.k1rakishou.common.AppConstants
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.core_logger.Logger
import com.github.k1rakishou.model.util.ChanPostUtils
import java.io.File
Expand All @@ -28,7 +27,6 @@ import kotlin.reflect.KProperty
* NATIVE LIBRARIES DEPEND ON THE CLASS PACKAGE!
* */

@DoNotStrip
class MPVView(
context: Context,
attrs: AttributeSet?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.github.k1rakishou.chan.core.mpv
import android.content.Context
import android.net.Uri
import android.os.ParcelFileDescriptor
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.core_logger.Logger
import java.io.File
import kotlin.math.abs
Expand All @@ -12,7 +11,6 @@ import kotlin.math.abs
* Taken from https://github.com/mpv-android/mpv-android
* */

@DoNotStrip
object MpvUtils {
private const val TAG = "MpvUtils"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import com.github.k1rakishou.chan.core.site.limitations.SitePostingLimitation
import com.github.k1rakishou.chan.core.site.parser.ChanReader
import com.github.k1rakishou.chan.core.site.parser.CommentParserType
import com.github.k1rakishou.chan.core.site.sites.search.SiteGlobalSearchType
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.common.ModularResult
import com.github.k1rakishou.model.data.board.ChanBoard
import com.github.k1rakishou.model.data.descriptor.SiteDescriptor
import com.github.k1rakishou.model.data.site.SiteBoards
import kotlinx.coroutines.Job

@DoNotStrip
interface Site {
val isSynthetic: Boolean
get() = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package com.github.k1rakishou.chan.core.site.http

import com.github.k1rakishou.chan.core.base.okhttp.ProxiedOkHttpClient
import com.github.k1rakishou.common.AppConstants
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.common.ModularResult.Companion.Try
import com.github.k1rakishou.common.suspendCall
import com.github.k1rakishou.core_logger.Logger
Expand All @@ -37,7 +36,6 @@ import kotlin.time.measureTimedValue
/**
* Manages the [HttpCall] executions.
*/
@DoNotStrip
class HttpCallManager @Inject constructor(
private val proxiedOkHttpClient: Lazy<ProxiedOkHttpClient>,
private val appConstants: AppConstants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@ import com.github.k1rakishou.ChanSettings
import com.github.k1rakishou.chan.core.site.parser.style.StyleRule
import com.github.k1rakishou.chan.core.site.parser.style.StyleRulesParamsBuilder
import com.github.k1rakishou.chan.utils.AppModuleAndroidUtils.sp
import com.github.k1rakishou.common.DoNotStrip
import com.github.k1rakishou.core_logger.Logger
import com.github.k1rakishou.core_parser.comment.HtmlNode
import com.github.k1rakishou.core_parser.comment.HtmlParser
import com.github.k1rakishou.core_parser.comment.HtmlTag
import com.github.k1rakishou.core_spannable.PostLinkable
import com.github.k1rakishou.core_themes.ChanThemeColorId
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import kotlin.concurrent.getOrSet

@DoNotStrip
open class SimpleCommentParser {
private val rules = ConcurrentHashMap<String, MutableList<StyleRule>>()
private val htmlParserThreadLocal = ThreadLocal<HtmlParser>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.github.k1rakishou.chan.core.site.common.vichan.VichanCommentParser;
import com.github.k1rakishou.chan.core.site.common.vichan.VichanEndpoints;
import com.github.k1rakishou.chan.core.site.parser.CommentParserType;
import com.github.k1rakishou.common.DoNotStrip;
import com.github.k1rakishou.model.data.board.ChanBoard;
import com.github.k1rakishou.model.data.descriptor.BoardDescriptor;
import com.github.k1rakishou.model.data.descriptor.ChanDescriptor;
Expand All @@ -39,7 +38,6 @@

import okhttp3.HttpUrl;

@DoNotStrip
public class Chan370
extends CommonSite {
private final ChunkDownloaderSiteProperties chunkDownloaderSiteProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.github.k1rakishou.chan.core.site.common.vichan.VichanCommentParser;
import com.github.k1rakishou.chan.core.site.common.vichan.VichanEndpoints;
import com.github.k1rakishou.chan.core.site.parser.CommentParserType;
import com.github.k1rakishou.common.DoNotStrip;
import com.github.k1rakishou.model.data.board.ChanBoard;
import com.github.k1rakishou.model.data.descriptor.BoardDescriptor;
import com.github.k1rakishou.model.data.descriptor.ChanDescriptor;
Expand All @@ -38,7 +37,6 @@

import okhttp3.HttpUrl;

@DoNotStrip
public class Diochan extends CommonSite {
private final ChunkDownloaderSiteProperties chunkDownloaderSiteProperties;
public static final String SITE_NAME = "Diochan";
Expand Down
Loading

0 comments on commit 4cce9ae

Please sign in to comment.