View Single Post
Old 02-20-2017, 05:43 AM   #1
Mr.Samuel
Connoisseur
Mr.Samuel began at the beginning.
 
Mr.Samuel's Avatar
 
Posts: 69
Karma: 10
Join Date: May 2016
Location: Gold Town
Device: kindle paperwhite 3, kindle oasis 2
Disable search indexing by modifying the java classes

With many trial and errors, I finally find a way to disable search indexing on any conditions.

First, dump the /opt/amazon/ebook/lib/kafindexer.jar file in your kindle's rootfs with the KUAL extension named kindle explorer or usbnetwork for modification.
Then modify the "allowedToStartIndexing" method of \com\amazon\kindle\indexer\bundle\IndexerThread.cl ass file in the dumped /opt/amazon/ebook/lib/kafindexer.jar file like this to disable the indexing thread.

Code:
aload_0
getfield com/amazon/kindle/indexer/bundle/IndexerThread/isBatteryCharging Z
ifne 13
aload_0
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/isBatteryLow()Z
ifeq 13
iconst_0
aload_0
ldc_w "not allowed to index: NOT ENOUGH BATTERY"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
ireturn
pop
aload_0
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/isBatteryTempOK()Z
ifeq 22
iconst_0
aload_0
ldc_w "not allowed to index: BATTERY TEMP NOT OKAY"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
ireturn
iconst_0
getstatic com/amazon/kindle/indexer/bundle/IndexerThread/searchesInProgressCount I
ifge 29
iconst_0
aload_0
ldc_w "not allowed to index: SEARCH IN PROGRESS"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
ireturn
iload_1
ifeq 39
getstatic com/amazon/kindle/indexer/bundle/IndexerThread/LOW_HEAP_THRESHOLD J
invokestatic com/amazon/kindle/indexer/bundle/IndexerThread/lowHeap(J)Z
ifne 39
iconst_0
aload_0
ldc_w "not allowed to index: LOW HEAP"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
ireturn
iload_1
ifne 49
aload_0
getfield com/amazon/kindle/indexer/bundle/IndexerThread/isSystemMemoryNormal Z
ifeq 49
iconst_0
aload_0
ldc_w "not allowed to index: LOW System Memory"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
ireturn
aload_0
getfield com/amazon/kindle/indexer/bundle/IndexerThread/isAudioPlaying Z
ifeq 57
iconst_0
aload_0
ldc_w "not allowed to index: AUDIO IS PLAYING"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
ireturn
aload_0
getfield com/amazon/kindle/indexer/bundle/IndexerThread/userStoreIsAvailable Z
ifeq 65
iconst_0
aload_0
ldc_w "not allowed to index: USER STORE NOT AVAILABLE"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
ireturn
aload_0
getfield com/amazon/kindle/indexer/bundle/IndexerThread/suspendAbort Z
ifne 73
iconst_0
aload_0
ldc_w "not allowed to index: GOING TO SUSPEND"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
ireturn
aload_0
getfield com/amazon/kindle/indexer/bundle/IndexerThread/isIndexerBlockingAppOn Z
ifeq 90
aload_0
getfield com/amazon/kindle/indexer/bundle/IndexerThread/isScreenSaver Z
ifne 90
getstatic com/amazon/kindle/indexer/bundle/IndexerThread/isAllowedOnlyForCloudIndex Z
ifeq 85
getstatic com/amazon/kindle/indexer/bundle/IndexerThread/LOG Lcom/amazon/ebook/util/log/e;
ldc_w "Indexer Paused to Index: Allowing CloudIndex to merge"
invokevirtual com/amazon/ebook/util/log/e/NBb(Ljava/lang/String;)V
goto 90
aload_0
ldc_w "not allowed to index: Indexer blocking APP IS IN USE"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
iconst_0
ireturn
getstatic com/amazon/kindle/indexer/bundle/IndexerThread/abortIndexing Z
ifne 97
iconst_0
aload_0
ldc_w "not allowed to index: INDEXING DISABLED"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
ireturn
invokestatic com/amazon/kindle/indexer/S/WKc()Lcom/amazon/kindle/indexer/SearchSDK$FileFactory;
aconst_null
invokeinterface com/amazon/kindle/indexer/SearchSDK$FileFactory/zu(Ljava/lang/String;)J 2
ldc2_w 256
lcmp
ifle 108
iconst_0
aload_0
ldc_w "not allowed to index: NOT ENOUGH FILE SPACE"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
ireturn
aload_0
ldc_w "allowed to index: ALL CONDITIONS MET"
invokespecial com/amazon/kindle/indexer/bundle/IndexerThread/logIndexerPauseState(Ljava/lang/String;)V
iconst_1
ireturn
I modified it with JBE.
After that, compress the class file to the jar file and push the jar file into the corresponding place of your kindle's rootfs.

Now I post the already-modified file for fw 5.8.7
Attached Files
File Type: jar kafindexer.jar (301.2 KB, 112 views)

Last edited by Mr.Samuel; 02-20-2017 at 11:20 AM. Reason: details
Mr.Samuel is offline   Reply With Quote