diff --git a/src/pt/remangas/build.gradle b/src/pt/remangas/build.gradle new file mode 100644 index 000000000..4491f2d1e --- /dev/null +++ b/src/pt/remangas/build.gradle @@ -0,0 +1,14 @@ +ext { + extName = 'Remangas' + extClass = '.Remangas' + themePkg = 'madara' + baseUrl = 'https://remangas.net' + overrideVersionCode = 0 + isNsfw = true +} + +apply from: "$rootDir/common.gradle" + +dependencies { + implementation project(':lib:randomua') +} diff --git a/src/pt/remangas/res/mipmap-hdpi/ic_launcher.png b/src/pt/remangas/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..4a30e1e37 Binary files /dev/null and b/src/pt/remangas/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/pt/remangas/res/mipmap-mdpi/ic_launcher.png b/src/pt/remangas/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..841beaa08 Binary files /dev/null and b/src/pt/remangas/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/pt/remangas/res/mipmap-xhdpi/ic_launcher.png b/src/pt/remangas/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..361788b7c Binary files /dev/null and b/src/pt/remangas/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/pt/remangas/res/mipmap-xxhdpi/ic_launcher.png b/src/pt/remangas/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..58af6e49c Binary files /dev/null and b/src/pt/remangas/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/pt/remangas/res/mipmap-xxxhdpi/ic_launcher.png b/src/pt/remangas/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..a5c3ec77b Binary files /dev/null and b/src/pt/remangas/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/pt/remangas/src/eu/kanade/tachiyomi/extension/pt/remangas/Remangas.kt b/src/pt/remangas/src/eu/kanade/tachiyomi/extension/pt/remangas/Remangas.kt new file mode 100644 index 000000000..12deb41ae --- /dev/null +++ b/src/pt/remangas/src/eu/kanade/tachiyomi/extension/pt/remangas/Remangas.kt @@ -0,0 +1,45 @@ +package eu.kanade.tachiyomi.extension.pt.remangas + +import android.app.Application +import android.content.SharedPreferences +import androidx.preference.PreferenceScreen +import eu.kanade.tachiyomi.lib.randomua.addRandomUAPreferenceToScreen +import eu.kanade.tachiyomi.lib.randomua.getPrefCustomUA +import eu.kanade.tachiyomi.lib.randomua.getPrefUAType +import eu.kanade.tachiyomi.lib.randomua.setRandomUserAgent +import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit +import eu.kanade.tachiyomi.source.ConfigurableSource +import okhttp3.OkHttpClient +import uy.kohesive.injekt.Injekt +import uy.kohesive.injekt.api.get +import java.text.SimpleDateFormat +import java.util.Locale + +class Remangas : + Madara( + "Remangas", + "https://remangas.net", + "pt-BR", + SimpleDateFormat("dd/MM/yyyy", Locale("pt", "BR")), + ), + ConfigurableSource { + + override val useLoadMoreRequest = LoadMoreStrategy.Always + + private val preferences: SharedPreferences by lazy { + Injekt.get().getSharedPreferences("source_$id", 0x0000) + } + + override val client: OkHttpClient = super.client.newBuilder() + .setRandomUserAgent( + preferences.getPrefUAType(), + preferences.getPrefCustomUA(), + ) + .rateLimit(4) + .build() + + override fun setupPreferenceScreen(screen: PreferenceScreen) { + addRandomUAPreferenceToScreen(screen) + } +}