parent
ae52c158c3
commit
058aeaa54e
|
@ -3,8 +3,12 @@ ext {
|
||||||
extClass = '.Hiperdex'
|
extClass = '.Hiperdex'
|
||||||
themePkg = 'madara'
|
themePkg = 'madara'
|
||||||
baseUrl = 'https://hiperdex.com'
|
baseUrl = 'https://hiperdex.com'
|
||||||
overrideVersionCode = 11
|
overrideVersionCode = 12
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':lib:randomua')
|
||||||
|
}
|
||||||
|
|
|
@ -5,6 +5,10 @@ import android.content.SharedPreferences
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.preference.EditTextPreference
|
import androidx.preference.EditTextPreference
|
||||||
import androidx.preference.PreferenceScreen
|
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.multisrc.madara.Madara
|
||||||
import eu.kanade.tachiyomi.source.ConfigurableSource
|
import eu.kanade.tachiyomi.source.ConfigurableSource
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||||
|
@ -30,6 +34,10 @@ class Hiperdex :
|
||||||
|
|
||||||
override val client = super.client.newBuilder()
|
override val client = super.client.newBuilder()
|
||||||
.addInterceptor(::domainChangeIntercept)
|
.addInterceptor(::domainChangeIntercept)
|
||||||
|
.setRandomUserAgent(
|
||||||
|
preferences.getPrefUAType(),
|
||||||
|
preferences.getPrefCustomUA(),
|
||||||
|
)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
private var lastDomain = ""
|
private var lastDomain = ""
|
||||||
|
@ -102,6 +110,7 @@ class Hiperdex :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
screen.addPreference(baseUrlPref)
|
screen.addPreference(baseUrlPref)
|
||||||
|
addRandomUAPreferenceToScreen(screen)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var SharedPreferences.baseUrlHost
|
private var SharedPreferences.baseUrlHost
|
||||||
|
|
Loading…
Reference in New Issue