Thread: JBPatch
View Single Post
Old 05-27-2012, 04:14 PM   #136
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
There is a "hidden" "cover view" mode of Home screen.

HomeBookletViewModeGetterPatch.java
Spoiler:
Code:
package com.mobileread.eureka.patch;

import serp.bytecode.BCClass;
import serp.bytecode.lowlevel.Entry;
import serp.bytecode.lowlevel.UTF8Entry;

import com.mobileread.ixtab.jbpatch.Descriptor;
import com.mobileread.ixtab.jbpatch.Patch;

public class HomeBookletViewModeGetterPatch extends Patch {
  private final String LIST_VIEW_MODE = new String("LIST_VIEW_MODE");
  private final String COVER_VIEW_MODE = new String("COVER_VIEW_MODE");

  protected Descriptor[] getDescriptors() {
    return new Descriptor[] { new Descriptor(
        "com.amazon.kindle.home.HomeBooklet",
        new String[] { "83836d8792099cdf7c2dac9866ae845d" }) };
  }

  public String perform(String md5, BCClass clazz) throws Throwable {
    Entry[] entries = clazz.getPool().getEntries();
    for (int e=0; e < entries.length; ++e) {
      if (entries[e] instanceof UTF8Entry) {
        UTF8Entry entry = (UTF8Entry) entries[e];
        if (LIST_VIEW_MODE.equals(entry.getValue())) {
            entry.setValue(COVER_VIEW_MODE);
            break;
        }
      }
    }
    return null;
  }
}

HomeBookletBrowseCoverViewModeSupportPatch.java
Spoiler:
Code:
package com.mobileread.eureka.patch;

import serp.bytecode.BCClass;
import serp.bytecode.BCMethod;
import serp.bytecode.Code;
import serp.bytecode.ConstantInstruction;

import com.mobileread.ixtab.jbpatch.Descriptor;
import com.mobileread.ixtab.jbpatch.Patch;

public class HomeBookletBrowseCoverViewModeSupportPatch extends Patch {
  protected Descriptor[] getDescriptors() {
    return new Descriptor[] { new Descriptor(
        "com.amazon.kindle.home.view.browse.u",
        new String[] { "7514fc95c491b7688ab7ead1c5786fdd" }) };
  }

  public String perform(String md5, BCClass clazz) throws Throwable {
    BCMethod m = clazz.getDeclaredMethod("L", "boolean", null);
    Code c = m.getCode(false);
    ConstantInstruction i = (ConstantInstruction) c.next();
    i.setValue(true);
    return null;
  }
}

Both patches must be enabled. First one replaces return value of method HomeBooklet.F() (it is HomeBooklet.getViewMode() in fact). Second one changes return value of L() method (it is isCoverViewModeSupported() method in fact).

I don't provide compiled patches because "cover view" mode is useless. No covers are displayed, just layout of Home screen is changed to tiled (instead of list). Maybe additional patches are required...

Tested on 5.1.0. Thanks to ixtab, I've mostly copypasted his examples
Attached Thumbnails
Click image for larger version

Name:	home_screen_cover_view_mode.gif
Views:	573
Size:	8.4 KB
ID:	86983  

Last edited by eureka; 05-27-2012 at 04:41 PM.
eureka is offline   Reply With Quote