View Single Post
Old 11-23-2016, 11:44 AM   #1
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
JBpatch - continued

The original project thread is here:
https://www.mobileread.com/forums/sho...d.php?t=175512
The original repository is here:
https://bitbucket.org/ixtab/jbpatcher

The repository of this fork of JBpatch is at:
https://bitbucket.org/knc1-admin/jbpatcher/overview

The Serp project on SourceForge appears to be dead, a backup copy of that code, as of 11.23.2016, is at (no CVS history, code only):
https://github.com/janetizzy/serp
And it appears to be updated for Java8 (which is what firmware 5.8.x is using).

The initial goal of re-opening this dead project:
  • Update the patching classloader for the 5.8 series firmware, if required
    (it may not require any changes - not yet tested).
  • Update the margins patch.
  • Create a patch to take control of OTA downloader, once and forever.
    (Mostly because 5.8.5 can **almost** defeat our current OTA blocker.)
Various tools
Spoiler:

Note 1:
I haven't coded anything in Java for 20 years, help will be require from current Java coders or this project will remain dead.

Note 2 (5.8.5 built for the KT3):
Code:
[root@kindle us]# /usr/java/bin/cvm -version
CVM Capabilities set
java version "1.8.0_06-ea"
Java(TM) SE Embedded Runtime Environment (build 1.8.0_06-ea-b00, profile compact1, headless)
Java HotSpot(TM) Embedded Minimal VM (build 25.06-b00, mixed mode)
Note 3 (procyon-decompiler-0.5.30.jar renamed to procyon.jar and placed in */esys (our extension system's directory) ):
The procyon decompiler, version 0.5.30 requires Java-7 or later to run, so this isn't much of a test, but:
Code:
[root@kindle esys]# /usr/java/bin/cvm -jar procyon.jar
CVM Capabilities set
Usage: <main class> [options] <type names or class/jar files>
  Options:
- - - snip - - -
Drat!
It seems I can't follow our own instructions ( https://github.com/janetizzy/KUAL-buttons ).
Before I screw up our plan again, make things look like this:
Code:
[root@kindle us]# tree esys
esys
├── bin
│   └── tree
├── java
│   ├── bin
│   │   └── procyon.jar
│   └── lib
└── lib

5 directories, 2 files
of course you will need an:
Code:
[root@kindle us]# export PATH=/mnt/us/esys/bin:$PATH
somewhere along the line.
How / If you automate that for ssh logins is up to you (there is a thread on that somewhere - since root's home directory is normally on tmpfs).

tree isn't pre-installed, attached is the one from Debian/Jessie/ARMel, works fine (at least over ssh).
The .bin is to keep the forum uploader happy, you can rename it on the Kindle as shown above.

Note 4: The "original" engima (renamed from enigma-v0.10.4.beta):
*/esys looks like this now:
Code:
[root@kindle esys]# tree .
.
├── bin
│   └── tree
├── java
│   ├── bin
│   │   ├── enigma.jar
│   │   └── procyon.jar
│   └── lib
└── lib

5 directories, 3 files
And for a quick check on that (again, KT3-fm-5.8.5):
Code:
[root@kindle esys]# /usr/java/bin/cvm -cp java/bin/enigma.jar cuchaz.enigma.CommandMain
CVM Capabilities set
command is required
Enigma - 0.10.4 beta
Usage:
	java -cp enigma.jar cuchaz.enigma.CommandMain <command>
	where <command> is one of:
		deobfuscate <in jar> <out jar> [<mappings file>]
		decompile <in jar> <out folder> [<mappings file>]
		protectify <in jar> <out jar>
Note: enigma also has a GUI mode.

Note 5: Going to need readelf for the next script (shown after renaming from readelf.bin to keep the forum uploader happy).
Code:
[root@kindle esys]# tree .
.
├── bin
│   ├── readelf
│   └── tree
├── java
│    ├── bin
│    │    ├── enigma.jar
│    │    └── procyon.jar
│    └── lib
└── lib

More bits and pieces to come as I gather them together.
Attached Files
File Type: jar procyon-decompiler-0.5.30.jar (1.68 MB, 180 views)
File Type: bin tree.bin (74.0 KB, 178 views)
File Type: jar enigma-v0.10.4.beta.jar (5.41 MB, 321 views)
File Type: zip lib-list.zip (1.3 KB, 180 views)
File Type: bin readelf.bin (401.2 KB, 178 views)

Last edited by knc1; 11-27-2016 at 08:54 AM.
knc1 is offline   Reply With Quote