Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbWatershed committed Jul 4, 2024
2 parents 5345555 + b2e6355 commit ff9900b
Show file tree
Hide file tree
Showing 266 changed files with 5,958 additions and 7,005 deletions.
6 changes: 3 additions & 3 deletions app/ai-upscale/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ android {
}

dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.7.0'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.8.2'
}
32 changes: 13 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
minSdkVersion 23
targetSdkVersion 34
versionCode 130 // is updated automatically by BitRise; only used when building locally
versionName '1.19.8'
versionName '1.19.9'

def includeObjectBoxBrowser = System.getenv("INCLUDE_OBJECTBOX_BROWSER") ?: "false"
def includeLeakCanary = System.getenv("INCLUDE_LEAK_CANARY") ?: "false"
Expand Down Expand Up @@ -112,11 +112,11 @@ dependencies {
* TESTING
*/
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.11.0'
testImplementation 'org.mockito:mockito-core:5.12.0'
testImplementation 'androidx.test:core:1.5.0'
testImplementation 'io.kotlintest:kotlintest-assertions:3.4.2'
testImplementation 'androidx.arch.core:core-testing:2.2.0'
testImplementation 'org.robolectric:robolectric:4.11.1'
testImplementation 'org.robolectric:robolectric:4.12.2'
// Auto Timber trees that redirect logs to the JUnit output
testImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1'
androidTestImplementation 'androidx.test:runner:1.5.2'
Expand All @@ -128,25 +128,25 @@ dependencies {
*/
// Support libraries
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.paging:paging-runtime:2.1.2'
implementation 'androidx.fragment:fragment-ktx:1.6.2'
implementation 'androidx.fragment:fragment-ktx:1.8.0'
implementation "androidx.documentfile:documentfile:1.0.1"
// <-- if documentfile is bumped, please examine FileExplorer for evolutions
implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0'
implementation 'androidx.core:core-ktx:1.12.0'
implementation "androidx.webkit:webkit:1.10.0"
implementation 'androidx.viewpager2:viewpager2:1.1.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.webkit:webkit:1.11.0'

def android_work_version = '2.9.0'
implementation "androidx.work:work-runtime:$android_work_version"
implementation "androidx.work:work-runtime-ktx:$android_work_version"

// For ViewModel to work
def android_lifecycle_version = '2.7.0'
def android_lifecycle_version = '2.8.2'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$android_lifecycle_version"
implementation "androidx.lifecycle:lifecycle-process:$android_lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$android_lifecycle_version"
Expand Down Expand Up @@ -242,7 +242,7 @@ dependencies {
implementation 'org.jsoup:jsoup:1.17.2'

// https://github.com/square/retrofit
def retrofit_version = '2.10.0'
def retrofit_version = '2.11.0'
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"

Expand Down Expand Up @@ -270,17 +270,11 @@ dependencies {
// EventBus: github.com/greenrobot/EventBus
implementation 'org.greenrobot:eventbus:3.3.1'

// Lightweight Stream : github.com/aNNiMON/Lightweight-Stream-API
implementation 'com.annimon:stream:1.2.2'

// LeakCanary: github.com/square/leakcanary
if (includeLeakCanary.toBoolean()) {
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.12'
}

// https://mvnrepository.com/artifact/commons-io/commons-io
implementation 'commons-io:commons-io:2.11.0'

// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation 'org.apache.commons:commons-lang3:3.14.0'

Expand All @@ -301,7 +295,7 @@ dependencies {
implementation 'info.debatty:java-string-similarity:2.0.0'

// Biometrics
implementation 'dev.skomlach:biometric:2.2.27'
implementation 'dev.skomlach:biometric:2.2.32'

// Searchable prefs
implementation 'com.github.ByteHamster:SearchPreference:v2.4.0'
Expand All @@ -316,7 +310,7 @@ dependencies {
* ANALYTICS
*/
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:32.8.0')
implementation platform('com.google.firebase:firebase-bom:33.1.1')

// Crashlytics
implementation 'com.google.firebase:firebase-crashlytics'
Expand Down
6 changes: 3 additions & 3 deletions app/customssiv/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.7.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.8.2'
// Don't update exifinterface > 1.2.0 without testing library screen thumbs with large PNGs
// v1.3.2 is bugged when loading large PNGs through Glide
implementation 'androidx.exifinterface:exifinterface:1.2.0'
Expand All @@ -49,7 +49,7 @@ dependencies {

// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation 'org.apache.commons:commons-lang3:3.14.0'
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.core:core-ktx:1.13.1'

implementation project(path: ':app:gles-renderer')
}
6 changes: 3 additions & 3 deletions app/gles-renderer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ android {
}

dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.7.0'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.8.2'

// Timber (Extensible Logger): github.com/JakeWharton/timber
implementation 'com.jakewharton.timber:timber:5.0.1'
Expand Down
14 changes: 7 additions & 7 deletions app/objectbox-models/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"properties": [
{
"id": "1:5108740755096578000",
"name": "id",
"name": "dbId",
"type": 6,
"flags": 1
},
Expand Down Expand Up @@ -52,7 +52,7 @@
},
{
"id": "2:5800889076602216395",
"name": "url",
"name": "dbUrl",
"indexId": "14:601529990271626923",
"type": 9,
"flags": 2048
Expand All @@ -64,7 +64,7 @@
},
{
"id": "4:2417271458982667075",
"name": "author",
"name": "dbAuthor",
"type": 9
},
{
Expand Down Expand Up @@ -231,12 +231,12 @@
},
{
"id": "2:4786164809804019689",
"name": "order",
"name": "dbOrder",
"type": 5
},
{
"id": "3:8847017078500757224",
"name": "url",
"name": "dbUrl",
"type": 9
},
{
Expand Down Expand Up @@ -279,7 +279,7 @@
},
{
"id": "12:946562145146984364",
"name": "isCover",
"name": "dbIsCover",
"type": 1
},
{
Expand Down Expand Up @@ -307,7 +307,7 @@
},
{
"id": "17:4756936261641767706",
"name": "pageUrl",
"name": "dbPageUrl",
"type": 9
},
{
Expand Down
5 changes: 1 addition & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@
<activity
android:name=".activities.sources.EdoujinActivity"
android:configChanges="orientation|screenSize" />
<activity
android:name=".activities.sources.AnchiraActivity"
android:configChanges="orientation|screenSize" />
<activity
android:name=".activities.sources.DeviantArtActivity"
android:configChanges="orientation|screenSize" />
Expand Down Expand Up @@ -223,8 +220,8 @@
<activity
android:name=".activities.ProcessTextActivity"
android:exported="true"
android:label="@string/launch"
android:icon="@drawable/ic_hentoid"
android:label="@string/launch"
android:theme="@style/Theme.Invisible">
<intent-filter>
<action android:name="android.intent.action.PROCESS_TEXT" />
Expand Down
95 changes: 95 additions & 0 deletions app/src/main/assets/mangago_parser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
(() => {
let oldPushState = history.pushState;
history.pushState = function pushState() {
let ret = oldPushState.apply(this, arguments);
window.dispatchEvent(new Event('pushstate'));
window.dispatchEvent(new Event('locationchange'));
return ret;
};

let oldReplaceState = history.replaceState;
history.replaceState = function replaceState() {
let ret = oldReplaceState.apply(this, arguments);
window.dispatchEvent(new Event('replacestate'));
window.dispatchEvent(new Event('locationchange'));
return ret;
};

window.addEventListener('popstate', () => {
window.dispatchEvent(new Event('locationchange'));
});
})();

window.addEventListener("locationchange", function () {
aaa();
});

document.addEventListener("DOMContentLoaded", (event) => {
aaa();
});

function cleanHead() {
clean("#reader-nav");
clean(".subnav");
}

function clean(selector) {
var elt = document.querySelector(selector);
if (elt != null) elt.remove();
}

function eval() {
return new Promise((resolve) => {
setTimeout(() => {
var found = false;
var container = document.querySelector("#pic_container");
if (container != null) {
container.childNodes.forEach((element) => {
var displayed = true;
var style = element.style;
if (style != null) {
var display = style.display;
if (display != null && display == "none") displayed = false;
}
if (!found && displayed) {
if ("IMG" == element.nodeName) {
console.info("resolve OK IMG");
found = true;
$interface.$fun(document.URL, document.querySelector("html").innerHTML);
} else {
var canvas = element.querySelector("canvas");
if (canvas != null) {
console.info("resolve OK CANVAS");
found = true;

if ($force_page) {
console.info("force page");
$interface.$fun(document.URL, document.querySelector("html").innerHTML);
} else {
cleanHead();
/* Delay for redrawing page */
setTimeout(() => {
screencap.onLoaded(canvas.width, canvas.height);
}, 500);
}
}
}
}
});
if (!found) console.info("resolve KO");
resolve(found);
}
}, 750);
});
}

async function aaa() {
console.info("ready");
var result = await eval();
if (!result) result = await eval();
if (!result) result = await eval();
if (!result) result = await eval();
if (!result) result = await eval();
if (!result) result = await eval();
if (!result) result = await eval();
}
9 changes: 7 additions & 2 deletions app/src/main/assets/wysiwyg_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ function eval() {
return new Promise((resolve) => {
setTimeout(() => {
if (document.querySelector("$selector") != null) {
console.info("resolve OK");
console.info("resolve OK IMG");
$interface.$fun(document.URL, document.querySelector("html").innerHTML);
resolve(true);
} else {
} else if (document.querySelector("#pic_container canvas") != null) {
console.info("resolve OK CANVAS");
var element = document.querySelector("#pic_container canvas");
screencap.onLoaded(element.width, element.height);
resolve(true);
} else {
console.info("resolve KO");
resolve(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import me.devsaki.hentoid.events.AchievementEvent
import me.devsaki.hentoid.events.CommunicationEvent
import me.devsaki.hentoid.util.AchievementsManager
import me.devsaki.hentoid.util.Debouncer
import me.devsaki.hentoid.util.Helper
import me.devsaki.hentoid.util.Preferences
import me.devsaki.hentoid.util.Settings.lockType
import me.devsaki.hentoid.util.applyTheme
import me.devsaki.hentoid.util.dimensAsDp
import me.devsaki.hentoid.util.toast
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
Expand Down Expand Up @@ -106,7 +106,7 @@ abstract class BaseActivity : AppCompatActivity {
.setTextColor(ContextCompat.getColor(this, R.color.white_opacity_87))
.setTextTypeface(Typeface.DEFAULT)
.setMenuColor(ContextCompat.getColor(this, R.color.dark_gray))
.setTextSize(Helper.dimensAsDp(this, R.dimen.text_subtitle_1))
.setTextSize(dimensAsDp(this, R.dimen.text_subtitle_1))
.setWidth(resources.getDimension(R.dimen.popup_menu_width).toInt()).setAutoDismiss(true)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.mikepenz.fastadapter.utils.DragDropUtil.onMove
import me.devsaki.hentoid.R
import me.devsaki.hentoid.databinding.ActivityDrawerEditBinding
import me.devsaki.hentoid.enums.Site
import me.devsaki.hentoid.util.Preferences
import me.devsaki.hentoid.util.Settings
import me.devsaki.hentoid.util.applyTheme
import me.devsaki.hentoid.viewholders.IDraggableViewHolder
import me.devsaki.hentoid.viewholders.SiteItem
Expand Down Expand Up @@ -56,12 +56,12 @@ class DrawerEditActivity : BaseActivity(), ItemTouchCallback {

// Recycler
val items: MutableList<SiteItem> = ArrayList()
val activeSites = Preferences.getActiveSites()
val activeSites = Settings.activeSites

// First add active sites
for (s in activeSites) if (s.isVisible) items.add(SiteItem(s, true, touchHelper))
// Then add the others
for (s in Site.values()) // We don't want to show these
for (s in Site.entries) // We don't want to show these
if (s.isVisible && !activeSites.contains(s)) items.add(SiteItem(s, false, touchHelper))
itemAdapter.add(items)
recyclerView = findViewById(R.id.drawer_edit_list)
Expand Down Expand Up @@ -92,7 +92,7 @@ class DrawerEditActivity : BaseActivity(), ItemTouchCallback {
private fun onValidateClick() {
val newSites: MutableList<Site> = ArrayList()
for (s in itemAdapter.adapterItems) if (s.isSelected) newSites.add(s.site)
Preferences.setActiveSites(newSites)
Settings.activeSites = newSites
onBackPressedDispatcher.onBackPressed()
}

Expand Down
Loading

0 comments on commit ff9900b

Please sign in to comment.