Kindle

From JhackPedia
Jump to: navigation, search

http://wiki.mobileread.com/wiki/Kindle_Touch_Hacking

Connessione SSH

* Installare http://wiki.mobileread.com/wiki/Kindle_Touch_Hacking#USB_Networking
* Impostare password di root cercando nella barra degli indirizzi ";un password $myPass"
* Cercare ";un" nella barra degli indirizzi
* Cercare ";711" per vedere l'indirizzo ip assegnato
* ssh root@$ip

Se il Kindle non viene più visto come unità esterna disabilitare il tutto con ";un"

SSHFS

* Installare ... TODO
* sshfs -o sftp_server=/mnt/us/sftp-server root@192.168.15.244:/ kindleSSHFS/

JBPatch

Installare: http://www.mobileread.com/forums/showthread.php?t=175512

Patch (da mettere in /mnt/us/opt/jbpatch/):

text-to-speech (gia' inclusa)
legal (gia' inclusa)
rotazioni/orientation: http://www.mobileread.com/forums/showpost.php?p=2064936&postcount=49
better scrollbars: http://www.mobileread.com/forums/showpost.php?p=2065090&postcount=52

Update rifiutati?

scp *.bin root@$ip:/mnt/us

/usr/sbin/otaup /mnt/us/*.bin

Screenshot

  • Tenere premuto il tasto "Home" per 2/3 secondi
  • Senza rilasciare il tasto, tap-pare lo schermo
  • Rilasciare il tasto "Home"
  • Gli screenshot vengono salvati in /mnt/us (ovvero la directory che si vede collegandolo come unità esterna)

ImageViewer

  • Copiare le immagini in una directory (per poter passare dall'una all'altra come se fosse un libro) all'interno di /mnt/us/images
  • Lanciare il comando lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.imageviewer o utilizzare l'estensione Image Viewer Launcher che ho scritto per GUI Launcher.

Abilita/Disabilita Screen-Saver

  • OFF: lipc-set-prop com.lab126.powerd preventScreenSaver 1
  • ON: lipc-set-prop com.lab126.powerd preventScreenSaver 0

Draw

lipc-set-prop com.lab126.appmgrd start app://com.lab126.draw

Kindle Launcher

Javadoc: http://yifanlu.github.com/KindleLauncher/

Microfono

Da testare bene.

Kindle->PC

Kindle:

arecord -f cd -c 2 | /opt/bin/lame -b128 - - | /opt/bin/nc

192.168.0.100 1703 | mpg123 -


PC:

nc -l -p 1703 192.168.0.100  | mpg123 -


PC -> Kindle

PC:

Mac: esdrec | lame -b 128 -x - | nc 192.168.0.200 2703
Linux:

Kindle:

/opt/bin/nc -l  192.168.0.200 2703 | aplay


Altro

Kindle: /opt/bin/nc -l 192.168.0.200 2703 | aplay


arecord -f cd -c 2 | lame -b128 - - | nc 192.168.0.100 1703 | mpg123 -


PC: nc -l 192.168.0.100 1703 | mpg123 -

arecord -f cd -c 2 | lame -b128 - - | nc 192.168.0.200 2703 | mpg123 -

Crontab

 crontab  -c /etc/crontab/ -e

Developpamento

Javadoc API: https://kdk-javadocs.s3.amazonaws.com/2.0/index.html (https://kdk-javadocs.s3.amazonaws.com/index.html)

Policy

/opt/amazon/ebook/security/external.policy

/*
  Kindlet permissions
 */
keystore "kindlet.keystore", "JKS";

// Permissions all Kindlets should have
grant signedBy "Kindlet" {
  permission java.util.PropertyPermission "java.home", "read";
  permission java.util.PropertyPermission "runtime_exec", "read";
  permission java.util.PropertyPermission "kindlet.home", "read";

  /* Standard Java properties.  This list only covers properties that do not unnecessarily leak
   * information.  user.dir, user.home and user.name are explicitly not permitted.
   * See http://java.sun.com/javame/reference/apis/jsr217/java/lang/System.html#getProperties()
   */
  // Information about the version of Java the application is running on
  permission java.util.PropertyPermission "java.version", "read";
  permission java.util.PropertyPermission "java.vendor", "read";
  permission java.util.PropertyPermission "java.vm.specification.version", "read";
  permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
  permission java.util.PropertyPermission "java.vm.specification.name", "read";
  permission java.util.PropertyPermission "java.vm.version", "read";
  permission java.util.PropertyPermission "java.vm.vendor", "read";
  permission java.util.PropertyPermission "java.vm.name", "read";
  permission java.util.PropertyPermission "java.specification.version", "read";
  permission java.util.PropertyPermission "java.specification.vendor", "read";
  permission java.util.PropertyPermission "java.specification.name", "read";
  permission java.util.PropertyPermission "java.verbose", "read";

  // For code that behaves differently under Windows.  The version of Linux is already available
  // externally due to open source licenses.
  permission java.util.PropertyPermission "os.name", "read";
  permission java.util.PropertyPermission "os.arch", "read";
  permission java.util.PropertyPermission "os.version", "read";

  // File, path and line separators
  permission java.util.PropertyPermission "file.separator", "read";
  permission java.util.PropertyPermission "path.separator", "read";
  permission java.util.PropertyPermission "line.separator", "read";
};

// Permissions needed by Kindlets that can use the network
grant signedBy "KindletNetworkSupport" {
  // Network access by Kindlets must be controlled
  permission com.amazon.kindle.kindlet.internal.net.security.NetworkAccessPermission "createConnection";
};

// Permissions needed by the Java framework &/or Kindlets that have a UI
grant signedBy "KindletInteractionSupport" {
  /* Required by Component#frameBufferSync */
  permission java.util.PropertyPermission "awt_fb_enable", "read";

  /* E-ink framebuffer specific properties. */
  permission java.util.PropertyPermission "fiona_fb_flag", "read";
  permission java.util.PropertyPermission "fiona_fb_command", "read";
  
  permission java.util.PropertyPermission "fiona_partial_update_upper_x", "read";
  permission java.util.PropertyPermission "fiona_partial_update_lower_x", "read";
  permission java.util.PropertyPermission "fiona_partial_update_upper_y", "read";
  permission java.util.PropertyPermission "fiona_partial_update_lower_y", "read";
  
  permission java.util.PropertyPermission "fiona_screen_effect", "read";

  /* The event queue that Kindlet has access to is in its own AppContext. */
  permission java.awt.AWTPermission "accessEventQueue";

  /* Properties provided by the PBP.  See 
   * http://java.sun.com/javame/reference/apis/jsr217/doc-files/properties.html
   */
  permission java.util.PropertyPermission "java.awt.AlphaComposite.SRC_OVER_.isRestricted", "read";
  permission java.util.PropertyPermission "java.awt.Graphics2D.setStroke.BasicStroke.isRestricted", "read";
  permission java.util.PropertyPermission "java.awt.event.MouseEvent.isRestricted", "read";
  permission java.util.PropertyPermission "java.awt.event.MouseEvent.supportLevel", "read";
  permission java.util.PropertyPermission "java.awt.event.KeyEvent.isRestricted", "read";
  permission java.util.PropertyPermission "java.awt.event.KeyEvent.supportMask", "read";
  permission java.util.PropertyPermission "java.awt.Component.setCursor.isRestricted", "read";


  /* Properties provided by the AGUI.  See 
   * http://java.sun.com/javame/reference/apis/jsr209/doc-files/properties.html
   */
  permission java.util.PropertyPermission "javax.swing.JComponent.setBackground.isRestricted", "read";
  permission java.util.PropertyPermission "javax.swing.JComponent.setBorder.isRestricted", "read";
  permission java.util.PropertyPermission "javax.swing.JComponent.setForeground.isRestricted", "read";
  permission java.util.PropertyPermission "javax.swing.JComponent.setToolTipText.isRestricted", "read";
  permission java.util.PropertyPermission "javax.swing.JList.setCellRenderer.isRestricted", "read";
  permission java.util.PropertyPermission "javax.swing.setMnemonic.isRestricted", "read";
  permission java.util.PropertyPermission "javax.swing.text.JTextComponent.setFocusAccelerator.isRestricted", "read";
  permission java.util.PropertyPermission "javax.swing.JMenuBar.clientPropertiesSupported", "read";
  permission java.util.PropertyPermission "javax.swing.JMenuBar.NUM_SOFT_KEYS", "read";
  permission java.util.PropertyPermission "javax.swing.JMenuBar.NUM_SOFT_MENUS", "read";
  permission java.util.PropertyPermission "javax.swing.JTabbedPane.setToolTipTextAt.isRestricted", "read";

  /** to show up the JPopupMenu. */
  permission java.util.PropertyPermission "javax.swing.JPopupMenu.adjustLocation", "read";

  /** required by TextLayoutStrategy to break lines in text component. */
  permission java.util.PropertyPermission "java.awt.font.TextMeasurer.canBreakLines", "read";

  /** the text renderer engine provided by the device for drawing text. */
  permission java.util.PropertyPermission "com.sun.me.gci.renderer.textRendererFactory", "read";

  /** the shape renderer engine provided by the device for drawing shapes. */
  permission java.util.PropertyPermission "com.sun.me.gci.renderer.shapeRendererFactory", "read";

  /** the image renderer engine provided by the device for drawing images. */
  permission java.util.PropertyPermission "com.sun.me.gci.renderer.imageRendererFactory", "read";

  /** for creating drawing surface on the device. */
  permission java.util.PropertyPermission "com.sun.me.gci.surface.surfaceFactory", "read";

  /** the font renderer engine provided by the device for drawing fonts. */
  permission java.util.PropertyPermission "com.sun.me.gci.renderer.fontenv.classname", "read";

  /** the connection between the AGUI rendering window and the native display environment. There should not be any need for
      third pary developers to get access to this. So this permission is not granted. */
  //  permission java.util.PropertyPermission "com.sun.me.gci.windowsystem.graphicsenv.classname", "read";

  /** grant read permission for JButton paint() to read this property. This should be removed 
      once framework decides to support xor or not. **/ 
  permission java.util.PropertyPermission "buttons.noxor", "read";

};

// Permissions needed by 3rd party libs provided with the SDK
grant codeBase "file:///opt/amazon/ebook/sdk/lib/-" {
  permission java.util.PropertyPermission "org.w3c.dom.DOMImplementationSourceList", "read";
};


Codice

* https://github.com/stav/kindle-concept-demo
* https://bitbucket.org/ixtab/ktfonthack.git
* git://github.com/apetresc/KindleChess
* http://code.google.com/p/adqmisc/source/browse/#svn/trunk/kif

Eventi dei device

for i in /dev/input/event*; do evtest info $i; done

Input driver version is 1.0.0
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "WM8962 Beep Generator"
Supported events:
  Event type 0 (Sync)
  Event type 18 (Sound)
    Event code 1 (Bell)
    Event code 2 (Tone)
Input driver version is 1.0.0
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "imx-yoshi Headset"
 Supported events:
  Event type 0 (Sync)
  Event type 1 (Key)
    Event code 256 (Btn0)
  Event type 5 (?)
    Event code 4 (?)
Input driver version is 1.0.0
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "whitney-button"
Supported events:
  Event type 0 (Sync)
  Event type 1 (Key)
    Event code 102 (Home)
Input driver version is 1.0.0
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "zforce"
Supported events:
  Event type 0 (Sync)
  Event type 1 (Key)
    Event code 0 (Reserved)
    Event code 1 (Esc)
    Event code 325 (ToolFinger)
    Event code 330 (Touch)
    Event code 333 (Tool Doubletap)
    Event code 334 (Tool Tripletap)
  Event type 3 (Absolute)
    Event code 0 (X)
      Value      0
      Min        0
      Max     4095
    Event code 1 (Y)
      Value      0
      Min        0
      Max     4095
    Event code 47 (MT Slot)
      Value      0
      Min        0
      Max        1
    Event code 53 (MT X)
      Value      0
      Min        0
      Max     4095
    Event code 54 (MT Y)
      Value      0
      Min        0
      Max     4095
    Event code 57 (MT Tracking ID)
      Value      0
      Min        0
      Max      255

Info

  • temperatura processore:
°F: cat /sys/devices/system/yoshi_battery/yoshi_battery0/battery_temperature 
°C: expr $((`cat /sys/devices/system/yoshi_battery/yoshi_battery0/battery_temperature` - 32)) \* 5 / 9
  • pressioni contemporanee sul touch (sembra che il massimo sia 2):
while (true); do cat /sys/devices/platform/zforce.0/test;  done

Varie

* http://kdk.amazon.com/gp/vendor/kindlepubs/kdk/get-content?ie=UTF8&id=200436000
* Overview: http://aasims.wordpress.com/2010/10/31/2010/09/16/amazon-kindle/
* http://www.cowlark.com/kindle/getting-started.html
* Merging developer keystores on the Kindle: http://adq.livejournal.com/113734.html
* http://www.mobileread.com/forums/archive/index.php/t-163358.html
* http://www.turnkeylinux.org/blog/kindle-root
* http://www.mobileread.com/forums/archive/index.php/t-168695.html (permission)
* http://www.mobileread.com/forums/showthread.php?t=163358 (sorgenti)