Lin script with C++ application for changing your operator name on the Motorola ROKR E8 display.

You must have click&play enabled firmware (such that runs sh and lin scripts).

Download HERE

ilove3d was so kind to provide also the application source code:

#define QT_NO_DRAGANDDROP
#define QT_NO_PROPERTIES
#include <ZApplication.h>
#include <ZLineEdit.h>
#include "ZSingleCaptureDlg.h"
#include <ZMessageDlg.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <qtextcodec.h>

extern "C" int UTIL_SetServiceName(const char *);

QTextCodec* gbk_codec = QTextCodec::codecForName("UTF-8");
QString ChineseAndEnglish(const char*ChineseString)
{
        return gbk_codec->toUnicode(ChineseString);
}

int mod(char *buf)
{
        if(strcmp(buf, "")==0)
        {
                printf("empty input\n");
                return -1;
        }
        unsigned int i;
        unsigned int j=0;
        unsigned int k=strlen(buf);
        unsigned int l=0;
        for(i=0; i<k; i++, j++)
        {
                if(buf[i]!=' ') break;
        }
        if(j==k)
        {
                printf("all blank input\n");
                return -1;
        }
        for(i=k-1; i>0; i--, l++)
        {
                if(buf[i]!=' ') break;
        }
        buf[k-l]=0;
        return j;
}

int main( int argc, char **argv )
{

        ZApplication* a = new ZApplication( argc, argv );
        int myuid=getuid();
        if(myuid!=0)
        {
                printf("not excute by root, but by %d\n", myuid);
                //ZMessageDlg* showQDlg = new ZMessageDlg(ChineseAndEnglish("火星电讯"),
ChineseAndEnglish("检测到本程序未以root身份执行,将不作任何操作!"), (ZMessageDlg::MessageDlgType)2);
                ZMessageDlg* showQDlg = new ZMessageDlg(ChineseAndEnglish("phoneName"),
ChineseAndEnglish("should run by root!"), (ZMessageDlg::MessageDlgType)2);
                showQDlg->exec();
                delete showQDlg;
                delete a;
                return 1;
        }
        char disiredname[100];
        memset(disiredname, 0, 100);
        //QString title=ChineseAndEnglish("火星电讯");
        //QString context=ChineseAndEnglish("运营商名称");
        QString title=ChineseAndEnglish("phoneName");
        QString context=ChineseAndEnglish("Operator name:");

        ZSingleCaptureDlg* dlg = new ZSingleCaptureDlg(title, context, (ZSingleCaptureDlg::CaptureDlgType)type,
NULL, "ZSingleCaptureDlg", true, 0, 0);
        ZLineEdit *line = dlg->getLineEdit();
        line->selectAll();

        a->setMainWidget( dlg );
        dlg->show();
        a->exec();

        int result = dlg->result();
        if(result)
        {
                strcpy(disiredname, dlg->getResultText().utf8());
                int cut=mod(disiredname);
                if(cut!=-1)
                {
                        printf("setup to '%s'\n", disiredname+cut);
                        UTIL_SetServiceName(disiredname+cut);
                        result = 1;
                }
                else
                        result = -1;
                if(result==1)
                {
                        //ZMessageDlg* showQdlg = new ZMessageDlg(ChineseAndEnglish("火星电讯"),
ChineseAndEnglish("设置OK,是否刷新手机?"), (ZMessageDlg::MessageDlgType)1);
                        ZMessageDlg* showQdlg = new ZMessageDlg(ChineseAndEnglish("phoneName"),
ChineseAndEnglish("settings done, refresh the phone?"), (ZMessageDlg::MessageDlgType)1);
                        if(showQdlg->exec()==1)
                        {
                                system("sleep 1s && kill `pidof phone` &");
                        }
                        delete showQdlg;
                }
        }

        delete dlg;
        delete a;
        return result;
}

 

 Discuss that article