JesusFreke auto-updater in the works.

Search This thread

Darkrift

Senior Member
Oct 5, 2006
535
22
San Tan Valley, Arizona
OK, here is the latest. This thread topic has changed a lot since I started it so I deleted it all and am cleaning it up.

A few weeks ago I wrote a .sh script that would check a file to find if there was a new version of the JF roms available. Updating is a pain and I wanted to make it easier. Not knowing Java I decided to write a .sh script which worked but was not very easy to use itself. To make it easier I asked for help here in making a frontend Android app to go with it. Since then, [RiS] has written a nice client that not only does what my script did, but does it without needing my script. The whole process is taken care of within the application. This makes it easier to use, faster and able to do a lot more than my script ever. The app is still in beta at this time but is coming along nicely.

The app name is JFupdater and currently it read a text file on my server (http://android-dls.com/up.txt). The info in that file tells the app if there is a new JF Rom available. I update this file whenever JesusFreke releases a new rom. There are fields for US G1, UK G1 and ADP1 which allows roms for all 3 to be tracked and updated. The version, description, md5sum and a list of mirrors to download. The application checks your phone type (or the phone type you select in the settings) and then checks this file to see if a newer version is available. IF there is it will let you know which are ready for download and give you a download button. Once downloaded the file can be applied by rebooting into recovery.

I believe he is working on making the reboot to recovery/apply update more automates so that after download you would be asked if you want to apply it now, and by choosing yes it would reboot and auto install the update like an official OTA would do.

There is currently a service set that allows you to set it to look for an update ever 1 hour, 24 hours or on boot.

The url where this project is located is: jfupdater.googlecode.com
 
Last edited:
  • Like
Reactions: sol-invictus

LPChris

Senior Member
Jul 14, 2007
207
0
I'm not sure how to run shell commands through an app. If anyone knows how I can definitely write the service to do this.
 

Darkrift

Senior Member
Oct 5, 2006
535
22
San Tan Valley, Arizona
I know its possible because someone in #android wrote one. Also another thing that might need to be done would be to copy this file to /cache and chmod it (if its on sdcard it cannot be executed). I will try to ask around how to run a shell command for you.
 

Darkrift

Senior Member
Oct 5, 2006
535
22
San Tan Valley, Arizona
ok, not sure if this helps, but this is from the source of Koush's superuser whitelist (thanks for making that available for us):

String command = String.format("echo \"mount -oremount,rw /dev/block/mtdblock3 /system\" | %s\nexit\n", suCommand);
Process p = Runtime.getRuntime().exec("sh");
OutputStream writer = p.getOutputStream();
writer.write(command.getBytes("ASCII"));
Thread.sleep(500);


and


if (superuser.exists())
{
// return device to original state
Process process = Runtime.getRuntime().exec("superuser");
DataOutputStream os = new DataOutputStream(process.getOutputStream());

os.writeBytes("busybox cp /system/bin/superuser /system/bin/su\n");
os.writeBytes("busybox chown 0:0 /system/bin/su\n");
os.writeBytes("chmod 4755 /system/bin/su\n");
os.writeBytes("rm /system/bin/superuser\n");
os.writeBytes("exit\n");
os.flush();
}


Hopefully the info you need is in this (i dont know java, but that looks like the code to me)
 

[RiS]

Senior Member
Dec 13, 2008
135
8
What about "running" the script code directly in the service? I mean, translate the script into java code.
This would remove the need of executing a shell script, and you wouldn't rely on system tools (that may change or crash in future updates / new devices).
Moreovew, it would also allow to add more options (Like check for updates, and when an update is found, ask the user if they want to download it or not. This could be useful if he is on a slow connetion, or it has not an unlimited data plan...)


I can start/work with LPChris on this.
 

APrinceAmongMen

Senior Member
Jan 14, 2009
267
31
Yorba Linda
www.ai-android.com
I was just looking at your update.sh script.
Just to clean it up a little, you can use a split function.
myString = jlatest.split("|")
That would split the text at everyone and give you
myString(0) = "version"
mystring(1) = "md5sum"
mystring(2) = "mirror1"
mystring(3) = "mirror2"
etc...
So yeah. I'm glad that you're doing this though.
I'm not any good at java so I can't help sadly enough.
I should start learning though. o_O
 

ido

Senior Member
May 7, 2006
148
108
I'm also interested in an app the can run scripts (which I can make shortcuts for..)

I'm not an java developer, however I've started writing something that could do that using a code similar to the above.

any other developers that can assist ?
 

LPChris

Senior Member
Jul 14, 2007
207
0
I'm also interested in an app the can run scripts (which I can make shortcuts for..)

I'm not an java developer, however I've started writing something that could do that using a code similar to the above.

any other developers that can assist ?
I'm actually building out the service now, I'll work on it more after I get home from work tonight. If you're good with building services too, by all means have a crack at it.
 

n1kon

Senior Member
Mar 21, 2006
390
59
46
this will be awesome. can you make it for uk versions too please :)
 

neerhaj

Member
Nov 5, 2008
15
0
I have started working on this, hopefully will have a working version by tommorow.

Also, we have some bandwidth available at modmygphone.com which we can use for the mirror.
 

Darkrift

Senior Member
Oct 5, 2006
535
22
San Tan Valley, Arizona
As I said I am a n00b when it comes to .sh scripts, and this is probably my third. If you have a way to make it work better, by all means let me know. As for making a java app that does all of this, if you can do it, great! I do not really care about the script other than the fact that I couldnt do this any other way and didn't want to be begging for a developers help unless I had already done what I could myself.
 

Datruesurfer

Senior Member
Oct 26, 2008
103
0
I have been working on a similar concept myself. I even got the /cache/recovery/command stuff working. Just write the following commands to that file:

Code:
boot-recovery
--update_package=partition:file

Then you can run 'reboot recovery' from the terminal and the phone will automatically reboot into recovery mode and apply the update. It won't go back into user mode on its own though (you have to hold home+back to do so).

I would much prefer this to be a GUI based utility, instead of a shell script that just runs in the background. We could apply ROM updates, themes etc right on the phone by simply giving a URL to the location of the file and have the phone do the rest
 

JesusFreke

Inactive Recognized Developer
Oct 23, 2008
736
54
Dallas
I have been working on a similar concept myself. I even got the /cache/recovery/command stuff working. Just write the following commands to that file:

Code:
boot-recovery
--update_package=partition:file

Then you can run 'reboot recovery' from the terminal and the phone will automatically reboot into recovery mode and apply the update. It won't go back into user mode on its own though (you have to hold home+back to do so).

I would much prefer this to be a GUI based utility, instead of a shell script that just runs in the background. We could apply ROM updates, themes etc right on the phone by simply giving a URL to the location of the file and have the phone do the rest

That's too easy! good find :)
 

LPChris

Senior Member
Jul 14, 2007
207
0
For some reason my Subclipse isn't playing nice with the Google Code repository right now so I haven't been able to get any of my code up there yet, but hopefully we'll have something going fairly soon. I'm going to rewrite as much of it as I can in Java so that the user can be notified and authorize the download in two separate steps.
 

JesusFreke

Inactive Recognized Developer
Oct 23, 2008
736
54
Dallas
LPChris and myself have started a project on google code, we expect to have some working code soon.

Anyone who wants to contribute with ideas, testing, etc.. is welcome!

I had actually registered a domain with this type of thing in mind in the past. androidupdatetracker.com. I would be happy to donate it to the cause :)
 

LPChris

Senior Member
Jul 14, 2007
207
0
Any details for this?
So far we have an empty Google Code project going. Like I said before, I haven't been able to connect my environment to the google code cvs. I'm hoping to be able to spend some time on it tonight if I can. If anyone else wants to help out here that has some free time then I'm open to it. I've just been busy with work and my GasBot application.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Let me try to answers to all the questions here.
    first of all, I've been really busy lately, and I have less free time than I wanted to spent on this. Anyway, the project is not stopped, just moving forward a bit slow :)

    Still no icon? Whats up with that? LOL.
    I tried messing around with it to see if I could replace the icon.png file with one of my own but it wouldn't install. I'm not a dev or anything but if I wanted to do this how could i go about it?

    As I said, any artwork is really welcome. You can post the icon here of add an enhacement issue at GCode page: http://code.google.com/p/jfupdater/issues/entry

    As all the .apk files are digitally signed, any atempt to modify it would result in a broken .apk file that won't install.





    I can confirm this behavior. Previous versions would tell me "Rebooting" and then "Failed to reboot" and at that point superuser would ask for permission and when granted the reboot would happen. Currently when I press the upgrade button it says it is attempting to gain root access and sits there doing nothing. Superuser does not even ask for permission. I am guessing a small typo was introduced in this version when I made the recommendation to not say "reboot failed" but instead say "attempting to gain root access". Other than that it seems to be working nice.

    Mmmh. Sorry, I forgot to update this post about that. The latest versions (>=0.3.1) are actually writing the update commands to /cache/recovery/command
    I just disabled the reboot command cause I didn't want my phone to keep rebooting and flashing while testing. So or you granted permisions to the application in superuser (clicking 'always') and is silently writting the commands and no rebooting (as expected) or there is a bug :)
    Can you
    Code:
     # cat /cache/recovery/command
    to check if the commands are written? If so, rebooting into recovery mode should apply the update.
    You can also try with a dummy file
    Code:
    $ rm /sdcard/update.zip
    $ touch /sdcard/update.zip
    The update process should start, and fail due to a wrong update file.




    One little thing (lol). Is there any way to make the about dialog go away when clicked? I kept tapping all over trying to get rid of it, but had to press back to do so.
    lol. I believe this is the intented behaviour. But it should be easy to close it when hitting back OR the dialog is pressed. Can you fill an issue about this? http://code.google.com/p/jfupdater/issues/entry

    Also does this version have the string inserted that will auto apply the update? If not, could you add that to the "upgrade" button, but not to the "backup and upgrade" so that until the backup functionality is fully integrated at least the non backup method works fully?
    Sure. Next version will have the reboot feature enabled.
    Regarding this, this week I've sent a patch to JF to enable automatic backup in the recovery image. Hopefuly he will incorporate it in the next version.


    One last thing I would like to say is that previously I thought [RiS] was the only person working on this project and my comments were accordingly. I recently (last night) read the project updates page and saw that there is actually a second person helping with this project. Thanks to dan.poulsen for helping on this app and sorry for leaving you out before.
    Yes, Dan has been contributing lately with several patches. Actually all the work with dialogs is his.
    1
    OK, here is the latest. This thread topic has changed a lot since I started it so I deleted it all and am cleaning it up.

    A few weeks ago I wrote a .sh script that would check a file to find if there was a new version of the JF roms available. Updating is a pain and I wanted to make it easier. Not knowing Java I decided to write a .sh script which worked but was not very easy to use itself. To make it easier I asked for help here in making a frontend Android app to go with it. Since then, [RiS] has written a nice client that not only does what my script did, but does it without needing my script. The whole process is taken care of within the application. This makes it easier to use, faster and able to do a lot more than my script ever. The app is still in beta at this time but is coming along nicely.

    The app name is JFupdater and currently it read a text file on my server (http://android-dls.com/up.txt). The info in that file tells the app if there is a new JF Rom available. I update this file whenever JesusFreke releases a new rom. There are fields for US G1, UK G1 and ADP1 which allows roms for all 3 to be tracked and updated. The version, description, md5sum and a list of mirrors to download. The application checks your phone type (or the phone type you select in the settings) and then checks this file to see if a newer version is available. IF there is it will let you know which are ready for download and give you a download button. Once downloaded the file can be applied by rebooting into recovery.

    I believe he is working on making the reboot to recovery/apply update more automates so that after download you would be asked if you want to apply it now, and by choosing yes it would reboot and auto install the update like an official OTA would do.

    There is currently a service set that allows you to set it to look for an update ever 1 hour, 24 hours or on boot.

    The url where this project is located is: jfupdater.googlecode.com
    1
    for now, till the auto update script is working, I keep the file android-dls.com/update.txt updated whenever JF makes an update (and I normally know at least one day in advanced so its updated pretty fast). I also made it so that I have an rss feed on my site that is for JF releases only. Disconnect has one also and I will post both.

    http://android-dls.com/jesusfreke-updates.feed?type=rss (mine)
    http://andblogs.net/tag/jf/feed/ (Disconnects)

    We both keep these pages fairly updates (these are the stories we put on our front pages, and we tag/categorize them specially so they show up) and should have a new update within 8-10 hours max of a new release.
    1
    Any update on how this is going?

    Finally I have something to show :)


    We have created a project here: http://code.google.com/p/jfupdater/ to host all the application code.
    I've just uploaded a first beta version there.


    Currently the application can check for updates, download them, and put them on /sdcard/update.zip
    There is also a background service that would periodically check for updates.


    Some noteworthy missing features:
    * It can't detect the current version you are running, so every time you check for an update, it will find it.
    * Currently I was using two update files: the original JF v.1.41 RC30, and a dummy file (nammed TEST ADP1). You can download and apply JF one (it should work), but if you try to flash the dummy file, it will complain about missing signature.



    If anyone wants to give it a try, please post your comments here.
    Also remember to perform a backup before start playing with this.



    P.S: Beta-testers & artwork designers wanted!
    1
    just as an added thing .. it looks as tho the updater cannot distinguish between JFs update and my modded update file unless i modify the information for the phone to see something like "JF RC33 v.1.42REM US" or something .. correct me if i'm wrong .. this would be a first step to adding support for other ROM files?

    EDIT:
    or maybe the actual version has to change ie: 1.42.1

    That's right. JF has a system property named ro.modversion than I use (among others) to know the mod version. Maybe you could change this one / add another one so the updater can detect your mod.



    Anyway Darkrift & me had other not concerns, some of them than I remember right now (Maybe Darkrift can complete the list):

    * The application layout should be changed to support something like "MOD categories" ('original', Lite, Themes, etc..). Should the application allow to switch between them? In most of that cases, a wipe must be performed. I'm not sure if it's possible to do it right now programatically, so this will require another modification to JF recovery image.

    * BandWidth. Darkrift told me that he was about to hit his BW limit days go... So I'm not sure if there is currently an infrastructure to support all of this.

    * Administration. Currently the list of updates is managed by Darkrift manually. Increasing this list will also increase the time he need to spent to keep it updated.

    * Security. What are the list of mods the application would support? Who decides where this list ends? Who is responsible of uploading new updates? Should the updates be signed with a private key? (Hint: 3rd party update centers doesn't seem a good solution right now...)
    I recall JF saying (wisely) that he didn't like the idea of signing his updates with a private signature, because that will tie us to him. Maybe a solution could be to sign the update file?

    * My overall perception is that people doesn't know what they are doing. Letting all of these come into the market could make the application an "Android Bricker v.1.0"


    P.S: Just for the record, I'm not saying that it's not possible nor I don't want to add it, just that there are a lot of issues to iron out before proceeding with this, so any discussion about them is welcome :)