Skip to content

Unable to patch Android 5.1 (Fairphone 2) #32

Description

@Roboe

Was working (multiple times) before the bunch of recent updates, 😕
Seems to be related with the new version/use of Apktool, from my point of view.

Log:

$ ./patch.py 
 *** Selected device xXXXxXxX
 *** Device detected! proceeding...
 *** Working dir: /tmp/tmpfkuhbdx0
 *** Rooting adbd...
adbd is already running as root
remount succeeded
 *** Pulling framework from device...
5857 KB/s (5426893 bytes in 0.904s)
 *** Disassembling framework...
 *** Done. Now this won't hurt a bit...
 *** Injection successful. Reassembling smali...
output:classes.dex

UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65536
    at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
    at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:315)
    at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1025)
    at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:801)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:250)
    at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:228)
    at org.jf.smali.main.main(main.java:293)

Traceback (most recent call last):
  File "./patch.py", line 140, in <module>
    subprocess.check_call(["java", "-jar", os.path.join(SCRIPT_DIR, "tools", "smali.jar"), "classes", "-o", "classes.dex"])
  File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['java', '-jar', '/home/ubuntu-gnome/Documentos/android/Needle/tools/smali.jar', 'classes', '-o', 'classes.dex']' returned non-zero exit status 2

(Note that I've replaced device id with exes: xXXXxXxX)

Host (Ubuntu Gnome):

$ lsb_release -d
Description:    Ubuntu 16.04.1 LTS

$ python --version`
Python 3.5.2

$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

(Just in case: Fairphone Open OS is based on CodeAurora sources. Sources for the OS are available at http://code.fairphone.com/)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions