LiveView reverse-engineering effort

Search This thread

jkorp

Member
Sep 24, 2012
37
30
Göteborg
Missing file in Google Code?

Seems to be a file missing in Google Code repository? I cant find:
Code:
nl.rnplus.olv.receiver.LiveViewBrConstants

Edit:
I also get an error on missing @drawable/ic_launcher in the manifest file...
 
Last edited:

GottZ

Senior Member
Sep 20, 2008
170
124
35
Cologne
gottz.de
yo everyone.
got bored and extracted all firmware images using the following code:
Code:
#include <stdio.h>
#include <stdlib.h>

FILE *fw;
long fwsize;
long imgstart;
long imgend;
int type = 0;

unsigned char png[] = { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 };

int search () {
  unsigned char *sig = png+type*8;
  long *imgpos = type ? &imgend : &imgstart;
  int count = 0;

  while (count < 8 && (*imgpos + count) < fwsize) {
    if (count == 0) *imgpos = ftell(fw);
    if ((unsigned char)fgetc(fw) == sig[count]) count++;
    else count = 0;
  }

  type = type ? 0 : 1;

  return count == 8 ? 1 : 0;
}

int main (void) {
  FILE *img;
  int i = 0;
  char imgpath[256];
  char *buff;

  fw = fopen("../original/firmware.bin", "r");

  (void)fseek(fw, 0L, SEEK_END);
  fwsize = ftell(fw);
  rewind(fw);

  while (search()) {
    if(!search()) break;
    imgend = ftell(fw);

    sprintf(imgpath, "./%i.png", i++);
    img = fopen (imgpath, "w");

    printf("%s: start: %li, end: %li\n", imgpath, imgstart, imgend);

    (void)fseek(fw, imgstart, SEEK_SET);
    buff = (char*)malloc(imgend - imgstart);

    (void)fread(buff, 1, imgend -imgstart, fw);
    (void)fwrite(buff, 1, imgend -imgstart, img);
    (void)fclose(img);
    free(buff);
    (void)fseek(fw, imgend, SEEK_SET);
  }

  (void)fclose(fw);
  return 1;
}

images as attachment.
maybe anyone except me can make use of them.
 

Attachments

  • firmware.tar.gz
    30 KB · Views: 147
Last edited:

kingstonxl

Senior Member
Jul 3, 2012
662
252
Poznań
Odp: LiveView reverse-engineering effort

Is there any way to read system char set from phone and then use it in OLV?

Sent from my LT30p using xda app-developers app
 
  • Like
Reactions: willfck4beer

kingstonxl

Senior Member
Jul 3, 2012
662
252
Poznań
Odp: LiveView reverse-engineering effort

nope. not natively. the device has a strict charset so in order to achieve that, you would need to replace unknown bits of the firmware on the device.

Bits of the firmware? How is that possible? Im talking about apk not firmware. I don't have any problems with special characters using sonys software so its not device firmware issue. Its a way that open live view app is communicating with live view itself than I have question marks in place of special characters.

Sent from my Nexus 7 using xda app-developers app
 

renzenicolai

Senior Member
Aug 13, 2012
125
181
www.rnplus.nl
Bits of the firmware? How is that possible? Im talking about apk not firmware. I don't have any problems with special characters using sonys software so its not device firmware issue. Its a way that open live view app is communicating with live view itself than I have question marks in place of special characters.

Sent from my Nexus 7 using xda app-developers app

If you could tell us how change the application so that the special characters work (I already tried encoding strings sent to the LiveView with UTF-8, this resulted in the liveview showing two wrong characters in place of one UTF-8 two byte character)...


Plugins
Attached to this post is a version of OLV with the filter manager working again (sorry, I changed something I shouldn't have in the previous apk). It also has a working, very simple, plugin manager (which shows all applications with a special permission, nl.rnplus.olv.permission.plugin, in a list and opens an activity in the plugin).
Also I enabled the plugin test menu item: this shows my idea of how to communicate with the plugins (please give feedback and ideas).
If you happen to have an idea about how the plugins should tell OLV dynamically what menu items they want to show in the menu: please tell me, since I still have no clue on how to implement the part where OLV reads info directly from the plugin.

Last note: nothing about the way OLV plugins are going to work is final, the files attached to this post are just to show the current state of plugin implementation.

(Source of the plugin apk can be found in plugin.zip, source of the olv apk is on googlecode)
 

Attachments

  • PLUGIN22022012.apk
    166.7 KB · Views: 93
  • OLV22022013.apk
    458.7 KB · Views: 76
  • Plugin.zip
    842 KB · Views: 68

GottZ

Senior Member
Sep 20, 2008
170
124
35
Cologne
gottz.de
ohai evryone.

(check out renze's post on the previous page)

i've cleaned my stuff a little and here it is:

201302221926.png

in case you cannot see the image


all you need to run it is to put this:
https://launchpad.net/gcc-arm-embedded/+download

into the base of my extracted tarball.
i had it there named as gcc-arm-none-eabi-4_7-2012q4

in case it differs, simply change it in firmware/Makefile


install dfu-util and minicom and change the usb port minicom shall use within the Makefile.

navigate to the firmware directory through a console

use make dump to create a firmware dump of your installed firmware into the "original" folder.
through make orig you can restore the original firmware onto the liveview

through make you can compile the firmware

through make copy you can copy the compiled firmware onto your liveview

through make term you can open minicom (CTRL+A Q will close minicom)


sadly i've screwed the usb terminal somehow. i dont know what i broke but maybe you can fix it if i dont do it before you.
the reason what broke my usb terminal was an application on my laptop called: "modemmanager" wich handles usb 3g modems and sends AT+GCAP<CR> to any usb device D:


to the changes from exception13's last build:
- i disabled his frame update thread and added a method (framebuffer_draw) that draws the framebuffer onto the screen (not clean)
- i added gdispGetPixelColor wich reads from the framebuffer
- i added two terminal commands that allow you to enable or disable multiple colors at once and change their speed. simply look into the source to see how they work. (led_enable, led_disable)
- i changed other various things too. cant remember. you shall diff it if you want to know it.


and now here is the download link



PS:
if you want to edit the clock, simply edit aclock.htm, run it in a webkit browser, save the textarea into aclock.h and recompile it to see changes.
 
Last edited:

beemerTPPC

Retired Recognized Developer
Mar 23, 2006
339
9
Madrid
beemer.sesma.eu
I've just found this thread and removed dust from my LV ;) Thanks for the effort. Seems promising.

Maybe I can help. I'm an android dev with many apps on the play market including sseveral live view plugins, so if you need help with any part of the project, tell me. I've tried to clone the repository in the first post but seems that it is outdated because last commit is from January,6.

About the project, I've used it only for an hour, but seems very well done. Do you plan support for standard LV plugins? Do you plan integration of automatic reconnection?
 

GottZ

Senior Member
Sep 20, 2008
170
124
35
Cologne
gottz.de
I've just found this thread and removed dust from my LV ;) Thanks for the effort. Seems promising.

Maybe I can help. I'm an android dev with many apps on the play market including sseveral live view plugins, so if you need help with any part of the project, tell me. I've tried to clone the repository in the first post but seems that it is outdated because last commit is from January,6.

About the project, I've used it only for an hour, but seems very well done. Do you plan support for standard LV plugins? Do you plan integration of automatic reconnection?

this project (as you can see in post 1) is dead.
it has been continued by other devs and lives on now.

if you want to see the current progress (wich is stunning), pm renzenicolai, look at the google code page or wait till someone replies.
also take a look at post 730 (wich is the one before my last post) wich contains usefull information about the current state.

on openliveview.com you cannot see much yet but there is at least the google code link and a link to this thread. (just telling you so you only need to remember this url to come back here)



edit:

got RTC working :D
 
Last edited:

vegaspete

New member
May 30, 2010
4
0
cyanogen mod 10.1 android 4.2.2 compatibility

Is there any news on making OLV work on newer roms? Just curious, because this looks much nicer than sony's app, but I can't get it to sync with either my phone or nexus 7 running cm 10.1 nightlies.
tia.
 

renzenicolai

Senior Member
Aug 13, 2012
125
181
www.rnplus.nl
Is there any news on making OLV work on newer roms? Just curious, because this looks much nicer than sony's app, but I can't get it to sync with either my phone or nexus 7 running cm 10.1 nightlies.
tia.

Nope, OLV works on some Android 4.2 roms, but I tried cm 10.1 myself and it fails on the bluetooth stack. I can't do anything about it and I think Google's engineers are to blame since OLV is not the only thing with bluetooth issues on android 4.2 (example).

I suggest you keep running on cm 10 untill the problems with Android 4.2 are fixed.
 
  • Like
Reactions: vegaspete

fixxxer667

Senior Member
Dec 8, 2010
148
68
Mind you, if the liveview doesn't even connect either via OLV or the Sony application, there is a slight chance that reflashing the (stock) liveview firmware via the sony update tool will fix it.
It had happened to me while I was switching from ICS to JB, and I thought it was the rom, but it worked just fine afterwards, so give it a shot..
 

GottZ

Senior Member
Sep 20, 2008
170
124
35
Cologne
gottz.de
AW: LiveView reverse-engineering effort

Mind you, if the liveview doesn't even connect either via OLV or the Sony application, there is a slight chance that reflashing the (stock) liveview firmware via the sony update tool will fix it.
It had happened to me while I was switching from ICS to JB, and I thought it was the rom, but it worked just fine afterwards, so give it a shot..

we or i shall definitely get our own firmware updater for windows ready..


(in case anyone want to know my progress: i will upload my sources tomorrow. it now displays certain live data like analog signals from all 4 touch buttons, digital representation of touch states of all 6 buttons, some changes to how exception13 got that data and access to the original serial number and bluetooth address.)

Sent from my HTC Desire Z using xda-developers app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    Hi all,

    A few weeks ago I started taking apart the LiveView software and manager. I'm really unhappy with the current plugin system, the menu structure and more. So, I started to reverse-engineer the Bluetooth protocol. I'm at the very beginning but it's looking promising.

    Here's the repo: https://github.com/BurntBrunch/LivelierView

    The protocol is not very difficult - just request-acknowledge-response serial communication over RFCOMM. Also, the kind people from SE didn't run the manager through Proguard (wink, wink, nudge, nudge ;) ).

    I also have what I *think* is a dump of the firmware but it seems either compressed or encrypted. Binwalk didn't find anything in it. If someone would be kind enough to take apart the software updater, we might figure out what's running on the actual device as well.

    Overall, I'm just starting but so far it's looking good (got time syncing working! it's at least a watch, if nothing else! :p ).

    Any help would be greatly appreciated (pull requests are more than welcome! :))
    10
    Well just a brief status update. The project I've started on github has been progressing, greatly in part from the contributions of boombuler.

    You can go there ( https://github.com/pedronveloso/OpenLiveView ) and check the README, and I've compiled and attached an APK so you guys can test for yourselves without having to clone the repo and compile ;). Right now that APK only asks for connecting with the device (has to be paired first of course) and then sends a Vibrate command to the LiveView. There's more commands done in the source then just that but the functionality has not yet received a dedicated UI since the whole thing is on a very early stage.

    Bare in mind that theres no point in reporting any bugs at this stage since I myself keep finding them with ease :p

    NOTE : You might have to uninstall LiveView first in order to test the app, at least I had to uninstall it because of Broadcasts that where getting in the way sometimes when the LiveView app was installed.
    9

    its not done yet. will need to enable getpixel in chibios gfx in order to have clean alpha overlapping. (well you cant see it anyways on a video)
    9
    Update!

    Here you go, the next update! :)

    Visible changes:
    I added mediacontrols (play/pause, previous track and next track) to the menu.

    Invisible changes (protocol):
    - Implemented brightness controll for the liveview display (off, dim and on)
    - Implemented ClearDisplay command
    - Implemented DisplayBitmap command

    Invisible changes (gui):
    - Added mediacontrolls like in the sony app when you long press the select key.

    Now the problem I am currently experiencing:
    The LiveView does not send back the navigate commands for left, right and select (short press) when in menu mode AND when out of menu mode (zero menuitems).

    My question to the original developer of the "net.sourcewalker.olv" app is if he can tell me how to make the liveview send those keypresses to the service.



    Something that I found out:
    the device sends DEVICESTATUS_ON back in stead of DEVICESTATUS_MENU when there are zero menu items, in that mode you have full controll over the screen (blanking and sending bitmaps).


    EDIT:
    Small bugfix (next button didn't work)
    9
    I'm sorry for being a noob again but what is OLV?
    Can there be a rom for the LiveView in the coming years?
    Is the LiveView open source?
    + can anyone provide me a detailed spec sheet of the LiveView... Like the processor and alll..

    Sent from my ST25i using Tapatalk 2

    1. OLV means: OpenLiveView wich is our project name (we have a custom android app that fully replaces sony's app)
    2. a rom is currently in developement as you can see within this post.
    3. the liveview itself is not opensource. our stuff however is.
    4. i cannot provide you a detailed spec sheet right now but will do it when i have some time digging out that info.

    so.. now to what i want to post:



    current snapshot of my firmware folder in attachments.

    current binary of the firmware is also in the attachments. (for thoose who just want to try it without compiling and know what they do)


    how to use the firmware folder:
    http://xdaforums.com/showpost.php?p=38341041&postcount=731

    (yes, i suck at english. digg through it or wait till i explain it on http://openliveview.com)



    stuff that is on my todo:

    • display timeout (aprox 5 minutes to implement it)
    • bluetooth (need help)
    • write access to the internal storage (need help)
    • access to the current battery charge info (need help)
    • basic menu system (i'm on it)
    • stopwatch (i'm on it after the menu)
    • digital clock (will do it after i did the stopwatch)
    • other stuff