diff --git a/.github/scripts/sign-apks.sh b/.github/scripts/sign-apks.sh index fa7a0ae7d7..9c475c3632 100755 --- a/.github/scripts/sign-apks.sh +++ b/.github/scripts/sign-apks.sh @@ -7,7 +7,7 @@ shopt -s globstar nullglob extglob APKS=( **/*".apk" ) # Fail if too little extensions seem to have been built -if [ "${#APKS[@]}" -le "50" ]; then +if [ "${#APKS[@]}" -le "1" ]; then echo "Insufficient amount of APKs found. Please check the project configuration." exit 1; fi; diff --git a/src/all/animeonsen/build.gradle b/src/all/animeonsen/build.gradle deleted file mode 100644 index f652028036..0000000000 --- a/src/all/animeonsen/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -ext { - extName = 'AnimeOnsen' - extClass = '.AnimeOnsen' - extVersionCode = 7 -} - -apply from: "$rootDir/common.gradle" diff --git a/src/all/animeonsen/res/mipmap-hdpi/ic_launcher.png b/src/all/animeonsen/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 61a1f08f04..0000000000 Binary files a/src/all/animeonsen/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/src/all/animeonsen/res/mipmap-mdpi/ic_launcher.png b/src/all/animeonsen/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 4a26d43bc2..0000000000 Binary files a/src/all/animeonsen/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/src/all/animeonsen/res/mipmap-xhdpi/ic_launcher.png b/src/all/animeonsen/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index ec6eaa8ac3..0000000000 Binary files a/src/all/animeonsen/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/src/all/animeonsen/res/mipmap-xxhdpi/ic_launcher.png b/src/all/animeonsen/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 26387f9792..0000000000 Binary files a/src/all/animeonsen/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/src/all/animeonsen/res/mipmap-xxxhdpi/ic_launcher.png b/src/all/animeonsen/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index b575c034eb..0000000000 Binary files a/src/all/animeonsen/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/src/all/animeonsen/res/web_hi_res_512.png b/src/all/animeonsen/res/web_hi_res_512.png deleted file mode 100644 index 2ca8cc9881..0000000000 Binary files a/src/all/animeonsen/res/web_hi_res_512.png and /dev/null differ diff --git a/src/all/animeonsen/src/eu/kanade/tachiyomi/animeextension/all/animeonsen/AOAPIInterceptor.kt b/src/all/animeonsen/src/eu/kanade/tachiyomi/animeextension/all/animeonsen/AOAPIInterceptor.kt deleted file mode 100644 index d0243fc123..0000000000 --- a/src/all/animeonsen/src/eu/kanade/tachiyomi/animeextension/all/animeonsen/AOAPIInterceptor.kt +++ /dev/null @@ -1,56 +0,0 @@ -package eu.kanade.tachiyomi.animeextension.all.animeonsen - -import eu.kanade.tachiyomi.network.POST -import kotlinx.serialization.decodeFromString -import kotlinx.serialization.json.Json -import kotlinx.serialization.json.JsonObject -import kotlinx.serialization.json.jsonPrimitive -import okhttp3.Headers -import okhttp3.Interceptor -import okhttp3.MediaType.Companion.toMediaType -import okhttp3.OkHttpClient -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.Response - -class AOAPIInterceptor(client: OkHttpClient) : Interceptor { - - private val token: String - - init { - token = try { - val body = """ - { - "client_id": "f296be26-28b5-4358-b5a1-6259575e23b7", - "client_secret": "349038c4157d0480784753841217270c3c5b35f4281eaee029de21cb04084235", - "grant_type": "client_credentials" - } - """.trimIndent().toRequestBody("application/json".toMediaType()) - - val headers = Headers.headersOf("user-agent", AO_USER_AGENT) - - val tokenResponse = client.newCall( - POST( - "https://auth.animeonsen.xyz/oauth/token", - headers, - body, - ), - ).execute().body.string() - - val tokenObject = Json.decodeFromString(tokenResponse) - - tokenObject["access_token"]!!.jsonPrimitive.content - } catch (_: Throwable) { - "" - } - } - - override fun intercept(chain: Interceptor.Chain): Response { - val originalRequest = chain.request() - - val newRequest = originalRequest.newBuilder() - .addHeader("Authorization", "Bearer $token") - .build() - - return chain.proceed(newRequest) - } -} diff --git a/src/all/animeonsen/src/eu/kanade/tachiyomi/animeextension/all/animeonsen/AnimeOnsen.kt b/src/all/animeonsen/src/eu/kanade/tachiyomi/animeextension/all/animeonsen/AnimeOnsen.kt deleted file mode 100644 index 36463c59c0..0000000000 --- a/src/all/animeonsen/src/eu/kanade/tachiyomi/animeextension/all/animeonsen/AnimeOnsen.kt +++ /dev/null @@ -1,192 +0,0 @@ -package eu.kanade.tachiyomi.animeextension.all.animeonsen - -import android.app.Application -import androidx.preference.ListPreference -import androidx.preference.PreferenceScreen -import eu.kanade.tachiyomi.animeextension.all.animeonsen.dto.AnimeDetails -import eu.kanade.tachiyomi.animeextension.all.animeonsen.dto.AnimeListItem -import eu.kanade.tachiyomi.animeextension.all.animeonsen.dto.AnimeListResponse -import eu.kanade.tachiyomi.animeextension.all.animeonsen.dto.EpisodeDto -import eu.kanade.tachiyomi.animeextension.all.animeonsen.dto.SearchResponse -import eu.kanade.tachiyomi.animeextension.all.animeonsen.dto.VideoData -import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource -import eu.kanade.tachiyomi.animesource.model.AnimeFilterList -import eu.kanade.tachiyomi.animesource.model.AnimesPage -import eu.kanade.tachiyomi.animesource.model.SAnime -import eu.kanade.tachiyomi.animesource.model.SEpisode -import eu.kanade.tachiyomi.animesource.model.Track -import eu.kanade.tachiyomi.animesource.model.Video -import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource -import eu.kanade.tachiyomi.network.GET -import eu.kanade.tachiyomi.util.parseAs -import kotlinx.serialization.json.Json -import kotlinx.serialization.json.boolean -import kotlinx.serialization.json.jsonPrimitive -import okhttp3.Headers -import okhttp3.Response -import uy.kohesive.injekt.Injekt -import uy.kohesive.injekt.api.get -import uy.kohesive.injekt.injectLazy - -class AnimeOnsen : ConfigurableAnimeSource, AnimeHttpSource() { - - override val name = "AnimeOnsen" - - override val baseUrl = "https://animeonsen.xyz" - - private val apiUrl = "https://api.animeonsen.xyz/v4" - - override val lang = "all" - - override val supportsLatest = false - - override val client by lazy { - network.client.newBuilder() - .addInterceptor(AOAPIInterceptor(network.client)) - .build() - } - - private val preferences by lazy { - Injekt.get().getSharedPreferences("source_$id", 0x0000) - } - - private val json: Json by injectLazy() - - override fun headersBuilder() = Headers.Builder().add("user-agent", AO_USER_AGENT) - - // ============================== Popular =============================== - // The site doesn't have a popular anime tab, so we use the home page instead (latest anime). - override fun popularAnimeRequest(page: Int) = - GET("$apiUrl/content/index?start=${(page - 1) * 20}&limit=20") - - override fun popularAnimeParse(response: Response): AnimesPage { - val responseJson = response.parseAs() - val animes = responseJson.content.map { it.toSAnime() } - // we can't (easily) serialize this thing because it returns a array with - // two types: a boolean and a integer. - val hasNextPage = responseJson.cursor.next.firstOrNull()?.jsonPrimitive?.boolean == true - return AnimesPage(animes, hasNextPage) - } - - // =============================== Latest =============================== - override fun latestUpdatesRequest(page: Int) = throw UnsupportedOperationException() - override fun latestUpdatesParse(response: Response) = throw UnsupportedOperationException() - - // =============================== Search =============================== - override fun searchAnimeRequest(page: Int, query: String, filters: AnimeFilterList) = - GET("$apiUrl/search/$query") - - override fun searchAnimeParse(response: Response): AnimesPage { - val searchResult = response.parseAs().result - val results = searchResult.map { it.toSAnime() } - return AnimesPage(results, false) - } - - // =========================== Anime Details ============================ - override fun animeDetailsRequest(anime: SAnime) = GET("$apiUrl/content/${anime.url}/extensive") - - override fun getAnimeUrl(anime: SAnime) = "$baseUrl/details/${anime.url}" - - override fun animeDetailsParse(response: Response) = SAnime.create().apply { - val details = response.parseAs() - url = details.content_id - title = details.content_title ?: details.content_title_en!! - status = parseStatus(details.mal_data?.status) - author = details.mal_data?.studios?.joinToString { it.name } - genre = details.mal_data?.genres?.joinToString { it.name } - description = details.mal_data?.synopsis - thumbnail_url = "$apiUrl/image/210x300/${details.content_id}" - } - - // ============================== Episodes ============================== - override fun episodeListRequest(anime: SAnime) = GET("$apiUrl/content/${anime.url}/episodes") - - override fun episodeListParse(response: Response): List { - val contentId = response.request.url.toString().substringBeforeLast("/episodes") - .substringAfterLast("/") - val responseJson = response.parseAs>() - return responseJson.map { (epNum, item) -> - SEpisode.create().apply { - url = "$contentId/video/$epNum" - episode_number = epNum.toFloat() - name = "Episode $epNum: ${item.name}" - } - }.sortedByDescending { it.episode_number } - } - - // ============================ Video Links ============================= - override fun videoListParse(response: Response): List