ganskef / MoCuishle

A caching proxy for offline use - supporting HTTP and HTTPS contents - written in Java on top of LittleProxy-mitm, LittleProxy, Netty - contains extensions for Mozilla and Chrome browsers - to use it nearly everywhere
https://ganskef.github.io/MoCuishle/
Apache License 2.0
19 stars 9 forks source link

Searching anything leads to java.lang.UnsatisfiedLinkError #1

Closed lehnerj closed 8 years ago

lehnerj commented 8 years ago

When trying to search anything an empty result page is shown and the following error appears in the log file McProxyService.txt in the MoCuishle home directory (see attachment).

java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/de.ganskef.mocuishle-2/lib/arm/libsqlite4java-android-armv7l.so: has text relocations

Steps to reproduce: Open 127.0.0.1:9090/browse Than search any text

Hardware: Nexus 5, Android 6.0.1

McProxyService.txt

ganskef commented 8 years ago

Hmm J., like I've argued, I can't reproduce it with my hardware and with emulators. I take your phone next week :-) .

Okay, now I've found this: http://stackoverflow.com/a/32362790. Using "22" and not "23" as targetSDKVersion solved it. I'll send you a version to check it...

ganskef commented 8 years ago

Build with another targetSDKVersion hasn't solved the problem.

But another problem I see is flooding the logs with reincarnations after indexing. I fix this behavior with overriding com.almworks.sqlite4java.SQLiteQueue#getReincarnationTimeout()returning -1 instead of the default value of 3 seconds. This should cause the indexing thread to quit if an error occurs.

lehnerj commented 8 years ago

Fixed: It works with your latest version. Thanks for your help.

ganskef commented 8 years ago

Thank you, but sorry... I'm still working on a new version to upload.

Android's SQLite FTS3 lacks unicode61 tokenizer but FTS5 is available. A rewrite... And, full text search was quite unkindly implemented by me. I've found some problems like phrases with quoting marks in the query string.

ganskef commented 8 years ago

Whatever I've seen in my test, I was wrong. It's implemented and documented and it fails. Android ships with SQLite version 3.4.0 http://developer.android.com/reference/android/database/sqlite/package-summary.html. FTS5 is introduced with version 3.9. I have to rollback, means you will have a little unicode problem with German umlauts.

We have to wait for a JNI implementation of SQLite 3.9+ which loads in your Android version too.

ganskef commented 8 years ago

Android N preview ships with SQLite 3.9.2 introducing the upcoming FTS5 which provides a bytewise compatible to unicode61 tokenizer by default. With adb shell:

generic_x86:/ $ sqlite3 --version                                              
3.9.2 2015-11-02 18:31:45 bda77dda9697c463c3d0704014d51627fceee328

But, it seems to be stripped again. Using FTS5 throws an Exception:

46060  2016-03-20 11:15:25,780 ERROR [AsyncTask #1] d.g.m.AndroidFullTextIndex - Unable to start, error:
android.database.sqlite.SQLiteException: no such module: fts5 (code 1)
    at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method) ~[na:0.0]
    at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:733) ~[na:0.0]
    at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754) ~[na:0.0]
    at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64) ~[na:0.0]
    at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1678) ~[na:0.0]
    at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1607) ~[na:0.0]
    at de.ganskef.mocuishle.AndroidFullTextIndex$2.doInBackground(AndroidFullTextIndex.java:62) ~[na:0.0]
    at android.os.AsyncTask$2.call(AsyncTask.java:304) ~[na:0.0]
    at java.util.concurrent.FutureTask.run(FutureTask.java:237) ~[na:0.0]
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243) ~[na:0.0]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) ~[na:0.0]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) ~[na:0.0]
    at java.lang.Thread.run(Thread.java:803) ~[na:0.0]