Author Topic: [FFOS] FIREFOXER 1.25 for Geeksphone Revolution [FROZEN]  (Read 20840 times)

Offline Bada3.0

  • Sr. Member
  • ****
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 381
  • Karma: 36
  • FREIHEIT!
    • View Profile
    • FIREFOXER
[FFOS] FIREFOXER 1.25 for Geeksphone Revolution [FROZEN]
« on: April 09, 2014, 01:59:44 PM »
Hello everybody  :)

Installing and configuring the ANDROID-SDK-TOOLS is not very easy for normal users -  especially for those who use Linux.
When the software is installed the torture continues... "How do I connect my Geeksphone Revolution to my PC?

Neuromancer2013 started "GP-Revolution-FFOS-Mini-HowTo's" --> http://forum.geeksphone.com/index.php?topic=5975.0
Thanks to him and many other helpful users in this forum, we have a nice thread where we can find useful documentations for different workarounds!

Although the authors do their best to write detailed workarounds, it's sometimes pretty hard to understand, if you are not that familiar with linux console commands.

That's why I decided to create

FIREFOXER
 
a scripting tool which was designed for users with less technical knowledge, but who also want to explore their Geeksphone Revolution :)


The script was created and tested on Xubuntu 14.04 LTS



Current Version:       FIREFOXER 1.25


written for Firefox OS 1.3, not yet compatible to Firefox OS 2.0


Description / Features:

- Download and extraction of android sdk tools [DONE]
- Installation of android sdk tools [DONE]
- Connecting Geeksphone REVOLUTION to PC using adb [DONE]
- Script optimization [DONE]
- Implementation of Luis's Workaround for Bug "SIM Card missing" --> https://forum.geeksphone.com/index.php?topic=6030.msg64082#msg64082 [DONE]
- Adding 'Changelog' function for viewing during the script [DONE]
- Exporting REVOLUTIONs internal filesystem as '.tgz' file on SDCARD for further analysis [DONE]
- Adding a new compiled busybox version (thanks to user "mik") to REVOLUTION which improves "wget" [DONE]
- Adding new alert tones to REVOLUTION (First wave: samsung_galaxy_s2.ogg, piper.ogg, bubbles.ogg   + restore function) [DONE]
- GPS Improvement for faster satfix outdoors & indoors (thanks to Sergi Mansilla --> http://sergimansilla.com/blog/making-geolocation-work-geeksphone ) [DONE]
- Adding an "ads blocker" to get protection against advertisement & malware (thanks to xda-developers --> http://forum.xda-developers.com/firefox-os/general/zte-c-2-1-modui-t2853315/page5 ) [DONE]
- Changing the search engine from "Google" to "Startpage", "ixquick" or "duckduckgo" (thanks to user "souptytwist") [DONE, NEW!]



Planned features / Improvements:

- Adding a log file for the whole script
- Adding a 'tidy up' - function to delete unnecessary subfolders and files in '/storage/sdcard/FIREFOXER/...'
- Installing a ssh server on GP Revolution as a faster & easier alternative to ADB [FROZEN]
- Complete Restructuring of "new-alert-tones feature" + adding 5 new alert tones [FROZEN]
- Building a Firefox OS 2.0 compatible version of FIREFOXER (as soon as released) [FROZEN]
- Enable large picture support ("Picture is too large for opening on that device") [FROZEN]
- Support for Windows users (*.bat file) - if needed... [CANCELED]


With releases of future versions I will update these lists of course  :)
Needless to say you can also find all the improvements in the "History / Changelog" section inside the script  8)


And now it's up to you, guys:  Feel free to test it!  :D

Just download it from the following link or from the attachments:


As the script needs root permissions it is recommended to look FIRST over the whole script BEFORE you run it!!!
I tried my very best to write it as clearly as I could  :P

Please tell me what you think about this scripting tool. As I am not a professional in scripting (working with Linux / UNIX in my company since June last year) please also let me know how to improve it - Spelling & grammer errors should also be deleted so please inform me about them.

Feel free to post your opinions, critics and questions in this thread - I'm looking forward to hear what you think about FIREFOXER  ;)


Sincerly,

Bada3.0





« Last Edit: March 17, 2015, 02:37:18 AM by Bada3.0 »
Geeksphone Revolution
ZTE Open C (FFOS 2.2)
Samsung Wave II

Havin' problems with connecting your GP Revolution with ADB or want to add some features or some improvements? Try my little scripting project "FIREFOXER" and tell me your opinion :-)

--> http://forum.geeksphone.com/index.php?topic=6063.0

Offline luis.cuervo

  • Administrator
  • Top Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 64
  • Posts: 816
  • Karma: 114
    • View Profile
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #1 on: April 10, 2014, 12:14:28 AM »
Perfect.

Thanks a lot.

Anything you need, just ask me and I will help you as much as I can :)

Offline Bada3.0

  • Sr. Member
  • ****
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 381
  • Karma: 36
  • FREIHEIT!
    • View Profile
    • FIREFOXER
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #2 on: April 10, 2014, 12:23:27 AM »
Perfect.

Thanks a lot.

Anything you need, just ask me and I will help you as much as I can :)

Thank you for that offer - Trying my best to improve FIREFOXER and to implement new features in the future :)
Geeksphone Revolution
ZTE Open C (FFOS 2.2)
Samsung Wave II

Havin' problems with connecting your GP Revolution with ADB or want to add some features or some improvements? Try my little scripting project "FIREFOXER" and tell me your opinion :-)

--> http://forum.geeksphone.com/index.php?topic=6063.0

Offline CC

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 34
  • Karma: 2
    • View Profile
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #3 on: April 10, 2014, 02:14:24 AM »
Hi Bada3.0,

good idea. :)

Maybe you could improve user experience by wrapping the parts where you expect some specific user input with "while" loops.
Killing the script and forcing the misbehaving ;D user to start all over just because of a possible typo seems a little bit harsh :).

Do the echos with the "yes" and "no" in double quotes really produce the intended output?
I would expect there will be no quotes around the "yes" and "no".
You should use, e. g., single quotes inside the double quotes instead.

You could do the "adb devices" result testing inside the script too and decide what to do next without questioning the potentially unexperienced user.


But, if the targeted user for this script is a user which is not able to perform the commands from your script manually on a console, which steps will he be able to perform after successfully connecting the phone?

Otherwise it speeds up these things for everyone. :D


With openSUSE 13.1 you don't need to download the android kit, you just need to install "android-tools" via yast or zipper, plug in the phone and there you go. :)


Offline Bada3.0

  • Sr. Member
  • ****
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 381
  • Karma: 36
  • FREIHEIT!
    • View Profile
    • FIREFOXER
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #4 on: April 10, 2014, 02:38:12 AM »
Hi Bada3.0,

good idea. :)

Maybe you could improve user experience by wrapping the parts where you expect some specific user input with "while" loops.
Killing the script and forcing the misbehaving ;D user to start all over just because of a possible typo seems a little bit harsh :).

Do the echos with the "yes" and "no" in double quotes really produce the intended output?
I would expect there will be no quotes around the "yes" and "no".
You should use, e. g., single quotes inside the double quotes instead.

You could do the "adb devices" result testing inside the script too and decide what to do next without questioning the potentially unexperienced user.


But, if the targeted user for this script is a user which is not able to perform the commands from your script manually on a console, which steps will he be able to perform after successfully connecting the phone?

Otherwise it speeds up these things for everyone. :D


With openSUSE 13.1 you don't need to download the android kit, you just need to install "android-tools" via yast or zipper, plug in the phone and there you go. :)

Hi CC!

1. I also thought that the "Exiting..." is not the best solution - so replacing it with 'while' is more comfortable and will be hopefully part of the next release. Maybe I do a nightshift today and start with that part  ;)

2. I thought that when I compare the content of a variable with a WORD (yes no) not a VALUE (1,2,3...), it is better to set the " " around the word - don't know if it is really necessary, but I saw this in a forum about bash scripting  :)

3. Of course the normal user who can't handle the commands won't do more than the script does  ;)
I agree, the description of the script should also be updated...   :P

4. Thanks for the information about SUSE - In my opinion Ubuntu does not have the android tools in its repositories  :)

Thank you for your feedback, CC  :)
Geeksphone Revolution
ZTE Open C (FFOS 2.2)
Samsung Wave II

Havin' problems with connecting your GP Revolution with ADB or want to add some features or some improvements? Try my little scripting project "FIREFOXER" and tell me your opinion :-)

--> http://forum.geeksphone.com/index.php?topic=6063.0

Offline CC

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 34
  • Karma: 2
    • View Profile
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #5 on: April 10, 2014, 02:58:46 AM »
About 2.:

What I meant was:

echo "Sorry, I did not understand... Only "yes" or "no" is accepted - Exiting..."

will output:

Sorry, I did not understand... Only yes or no is accepted - Exiting...

:)

Offline Bada3.0

  • Sr. Member
  • ****
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 381
  • Karma: 36
  • FREIHEIT!
    • View Profile
    • FIREFOXER
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #6 on: April 10, 2014, 03:23:35 AM »
About 2.:

What I meant was:

echo "Sorry, I did not understand... Only "yes" or "no" is accepted - Exiting..."

will output:

Sorry, I did not understand... Only yes or no is accepted - Exiting...

:)


Aaah, I forgot those! Will fix it soon, thanks - you're right the " " do not show up when you run the script
Geeksphone Revolution
ZTE Open C (FFOS 2.2)
Samsung Wave II

Havin' problems with connecting your GP Revolution with ADB or want to add some features or some improvements? Try my little scripting project "FIREFOXER" and tell me your opinion :-)

--> http://forum.geeksphone.com/index.php?topic=6063.0

Offline xinouch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 169
  • Karma: 13
    • View Profile
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #7 on: April 10, 2014, 07:07:53 AM »
hey!!!
good thing ;)
I'm at work right now, but I'll have a look when time.

as CC said, in most linux distributions, if you don't want to develop android applications, you just have to install the package "android-tools-adb", which of course exists in ubuntu: http://packages.ubuntu.com/fr/raring/android-tools-adb ;)

this will minimize a lot the useless things installed.

another thing: you should put your script in github: https://github.com/
if you have trouble with it (I know you're not a developer ^^), just send me a PM (I don't remember what is your native language, but if it is french, write it in french ^^)
This will help us to take your work and make modifications, create a list of todo and bugs and submit you our patches ;)

oh and final word: always put a license on a work that you put on internet. here, the BSD / WTF license should fits you, but you also can take a big gnu GPL or other (this will allows us to know if we can distribute modifications of your work or not, i.e create forks on github or not)

Offline Bada3.0

  • Sr. Member
  • ****
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 381
  • Karma: 36
  • FREIHEIT!
    • View Profile
    • FIREFOXER
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #8 on: April 10, 2014, 11:17:35 AM »
Hi xinouch!

Thank you for those hints  :)

2 Questions:
- Github... really?  :o I mean it's just a little bash script not a complex program with graphical interface.
 I have no idea about Github and about GITs. I have to read more about this topic, but first of all I want to create a full functional basic script  ;)  Nevertheless I will think about it!  :)

- How do I put my script under a license? Just adding some necessary lines inside my script that tell the reader that this script is protected? Normally I would search about it in the internet, but what is SEARCH WORD?  :D "How to put my software under a license" ?


Sorry for those questions, but I'm not familiar with that ^^

Geeksphone Revolution
ZTE Open C (FFOS 2.2)
Samsung Wave II

Havin' problems with connecting your GP Revolution with ADB or want to add some features or some improvements? Try my little scripting project "FIREFOXER" and tell me your opinion :-)

--> http://forum.geeksphone.com/index.php?topic=6063.0

Offline xinouch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 169
  • Karma: 13
    • View Profile
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #9 on: April 10, 2014, 12:21:41 PM »
for a simple license like BSD, you just have to write at the beginning of your file (in your comments), the template given here: http://opensource.org/licenses/BSD-3-Clause
for the WTFPL: https://en.wikipedia.org/wiki/WTFPL

for github, it is just a mean to make the collaborative work easier. but as you said, this is just a little script, and I don't think a lot of people will change a lot of things in it. don't bother with it ;)

Offline Bada3.0

  • Sr. Member
  • ****
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 381
  • Karma: 36
  • FREIHEIT!
    • View Profile
    • FIREFOXER
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #10 on: April 10, 2014, 03:57:00 PM »
So...

I've worked on the script the whole evening - it's completely restructured, you won't recognize it anymore  :D

- I eliminated the exiting and replace it with while loops
- I added a license
- I deleted some errors in the script


Unfortunately the script does not work yet... Something's going wrong.

I'll check that tomorrow - too tired for today  :o
Geeksphone Revolution
ZTE Open C (FFOS 2.2)
Samsung Wave II

Havin' problems with connecting your GP Revolution with ADB or want to add some features or some improvements? Try my little scripting project "FIREFOXER" and tell me your opinion :-)

--> http://forum.geeksphone.com/index.php?topic=6063.0

Offline xinouch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 169
  • Karma: 13
    • View Profile
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #11 on: April 11, 2014, 04:52:00 AM »
you haven't uploaded it, so can't help you ;D

actually, I'm working on installing "android-tools-adb" for different major distrib if it is possible, otherwise fall back on your wget.
(I don't know very well shell ^^)

one thing that seems important: you should use "exit 1" when the script finished because of an error. like that, we can use your script in another command like
Code: [Select]
./firefoxer.sh || echo "I'll never be able to connect my revolution :'("and you should echo your error messages on stderr (see https://stackoverflow.com/questions/2990414/echo-that-outputs-to-stderr). It will make logging easier for users
Code: [Select]
./firefoxer.sh 2> errors.txt
oh, and why ksh? I haven't tested yet, but it should work fine with bash, wich is installed in all linux distribution by default, not ksh ;)
« Last Edit: April 11, 2014, 04:57:26 AM by xinouch »

Offline CC

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 34
  • Karma: 2
    • View Profile
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #12 on: April 11, 2014, 05:02:08 AM »
Is your syntax o.k.?

Code: [Select]
:~ # bash -n firefoxer....sh
Would you like to post the reworked script - as xinouch already suggested while I was still typing and the forum software was so kind to inform me about a new post :D - so others could check too? :)

Offline Bada3.0

  • Sr. Member
  • ****
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 381
  • Karma: 36
  • FREIHEIT!
    • View Profile
    • FIREFOXER
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #13 on: April 11, 2014, 09:10:18 AM »
Hi everybody!  :)

In THIS post you'll find the "new" version attached - which is - in fact not really functional.  :(

I replaced the exiting through while loops but in the end I had several while oops in while loops (6 times! loop in loop in loop in loop in loop in loop...)  :o ??? Very confusing in the end^^  and VERY HARD WORK for me  ;)

Maybe I should replace them with "functions"...  ;)


Good point to log the error stream in an extra file, thank you  :)

I've chosen korn shell because nearlly every linux / unix owns that shell. If the commands and parameters are compatible, user will be able to run the script on redhat, solaris, openindiana, debian, ubuntu, ... - well it was just an idea in the beginning  ;)


Nevertheless here is  FIREFOXER 0.34  :)


I'm really really glad that you support me with that project  :)


@ all the others: DON'T use it, it's not ready yet!!



P.S.: My Problem is that the script stops at that point:

root@dreamer:/home/XXXX/Skripte# sh firefoxer_0.34_IN_PROGRESS.sh
=========================
==== FIREFOXER 0.34 =====
========= for ===========
= Geeksphone REVOLUTION =
=========================

Created & Tested on Ubuntu 12.04 LTS



For the next steps root access is necessary
Checking ...
[OK]


Do you wish to install ~Android SDK Tools~? These tools are necessary for the next steps.   (yes / no)
no

OK, then let's go on!
^C

« Last Edit: April 11, 2014, 09:38:45 AM by Bada3.0 »
Geeksphone Revolution
ZTE Open C (FFOS 2.2)
Samsung Wave II

Havin' problems with connecting your GP Revolution with ADB or want to add some features or some improvements? Try my little scripting project "FIREFOXER" and tell me your opinion :-)

--> http://forum.geeksphone.com/index.php?topic=6063.0

Offline xinouch

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 169
  • Karma: 13
    • View Profile
Re:[FFOS] FIREFOXER for Geeksphone Revolution
« Reply #14 on: April 11, 2014, 11:52:40 AM »
I've chosen korn shell because nearlly every linux / unix owns that shell. If the commands and parameters are compatible, user will be able to run the script on redhat, solaris, openindiana, debian, ubuntu, ... - well it was just an idea in the beginning  ;)

my point is: as it is for beginners, it could be great to use a shell that is already installed on all linux distrib. I don't know for ubuntu and others, but it is not installed by default in Debian, while I'm sure that sh and bash are installed by default on all distrib ;)

I'll check your file when time :p