buggins / coolreader

Official site of CoolReader project. Sourceforge repository is obsolete.
GNU General Public License v2.0
374 stars 100 forks source link

Support for eink in Boyue RK3386 devices #79

Open carlinux opened 5 years ago

carlinux commented 5 years ago

Hi, First of all, thanks a lot for your great work @buggins. CR is amazingly good.

I realized that CoolReader and Koreader don't refresh the screen in this device (boyue T103D "Likebook Mimas") and I found in the BoyueLauncher.apk some potentially useful classes in case it could be possible to add support for this device. In the boyueOS app (boyuelauncher.apk) in Classes.DEX (com.boyue.api.impl ) screenshot_20190221-120831

The link of the APK boyuelauncher.zip

Tell me if there's something else I could do to help. And thanks in advance. The koreader issue koreader/koreader#4595

edit: rephrasing and correction.

carlinux commented 5 years ago

I think we found in the koreader repo issue the Rockchip3368 classes needed to invoke refresh from the above linked APK

classes1.jar!/com/boyue/api/IBoyueApi.class

package com.boyue.api;

import android.view.View;

public abstract interface IBoyueApi
{
  public abstract void a2Refresh();

  public abstract void a2Refresh(View paramView);

  public abstract void autoRefresh();

  public abstract void autoRefresh(View paramView);

  public abstract void defaultRefresh();

  public abstract void defaultRefresh(View paramView);

  public abstract void ditherRefresh();

  public abstract void ditherRefresh(View paramView);

  public abstract void fullRefresh();

  public abstract void fullRefresh(View paramView);

  public abstract void partRefresh();

  public abstract void partRefresh(View paramView);

  public abstract void regalRefresh();

  public abstract void regalRefresh(View paramView);
}

Since classes1.jar!/com/boyue/api/IRK3368Api.class only shows

   package com.boyue.api;
    public abstract interface IRK3368Api
    extends IBoyueApi
    {}

Apart from that the koreader devs tell me that in
classes1.jar!/com/boyue/api/RK3368Impl.class has the rest of the code to create the device firmware.

private static void requestEpdFullMode(int paramInt1, int paramInt2)
  {
     try
     {
       Class.forName("android.view.View").getMethod("requestEpdFullMode", new Class[] { Integer.TYPE, Integer.TYPE }).invoke(null, new Object[] { Integer.valueOf(paramInt1), Integer.valueOf(paramInt2) });
      return;
     }
     catch (Exception localException)
     {
       localException.printStackTrace();
     }
   }

And in the same file

  public void fullRefresh()
  {
    setByEinkUpdateMode(1);
  }

// nothing is using 2

  public void partRefresh()
  {
    setByEinkUpdateMode(3);
  }

I think this would apply to the 3 Rockchip RK3368 eReaders from boyue (Mars T80D, T80, and likebook Mimas T103D since is the same chip and almost identical OS)

(Sorry if i'm saying something wrong since I don't know if this findings can be exported to CR as is. . I'm not android dev , or a coder apart from uncomplicated bash scripting for what is worth, so I'm just learning on the fly about this devices )

Anyway i hope this helps.

jabyrd3 commented 4 years ago

hm i'm really intersted in this but i'm not very good with reverse engineering java

Frenzie commented 4 years ago

You don't need to reverse engineer it since that's already been done. Just take a look in https://github.com/koreader/android-luajit-launcher/tree/749172127614c8e63602844ec1140a4ee2f56ae5/app/src/org/koreader/launcher/device/rockchip ;-)

jabyrd3 commented 4 years ago

heh yeah i discovered koreader last night and am just using it now, thanks :D

Frenzie commented 4 years ago

Not quite what I meant but sure, no problem. :-)