Example #1
0
    def sendSysinfo(self,  full):
        self.send(NUM_SYSINFO_REPLY_START)
        self.send(NUM_SYSINFO_REPLY_LINE, "program_version", VERSION)
        self.send(NUM_SYSINFO_REPLY_LINE, "battery", sysinfo.battery())
        self.send(NUM_SYSINFO_REPLY_LINE, "active_profile", sysinfo.active_profile())
        self.send(NUM_SYSINFO_REPLY_LINE, "free_ram", sysinfo.free_ram())
        self.send(NUM_SYSINFO_REPLY_LINE, "pys60_version", e32.pys60_version)

        if sysinfo.active_profile() == u"offline":
            # Return an error code if the phone is in offline mode
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_dbm", -1)
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_bars", -1)
        else:
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_dbm", sysinfo.signal_dbm())
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_bars", sysinfo.signal_bars())

        for drive,  free in sysinfo.free_drivespace().iteritems():
            self.send(NUM_SYSINFO_REPLY_LINE, "free_drivespace", str(drive) + str(free))

        if full:
            self.send(NUM_SYSINFO_REPLY_LINE, "display", str(sysinfo.display_pixels()[0]) + "x" + str(sysinfo.display_pixels()[1]))
            self.send(NUM_SYSINFO_REPLY_LINE, "imei", sysinfo.imei())
            self.send(NUM_SYSINFO_REPLY_LINE, "model", sysinfo.sw_version())
            self.send(NUM_SYSINFO_REPLY_LINE, "s60_version", e32.s60_version_info[0],  e32.s60_version_info[1] )
            self.send(NUM_SYSINFO_REPLY_LINE, "total_ram", sysinfo.total_ram())
            self.send(NUM_SYSINFO_REPLY_LINE, "total_rom", sysinfo.total_rom())

        self.send(NUM_SYSINFO_REPLY_END)
Example #2
0
 def __init__(s, un, psw, isp):
     s.imei = imei()
     s.pix = display_pixels()
     #以下为测试数据
     s.BDUSS = "None"
     s.psw = base64.encodestring(psw.encode('utf8')).replace(u"\n",
                                                             "").replace(
                                                                 u"=", "")
     s.un = un
     s.isp = isp
     s.token = "fb13bad79b3a1fefc0a5819a0b66eaa3e064a3bdf020f7f453a8ef905fd51aef"
     #s.client_id=s.getsync()
     s.client_id = "wappc_1426215240046_404"
def Info():
    #print 'Device Time: ' + sysinfo.active_profile()
    print 'Active Profile: '.ljust(24) + sysinfo.active_profile()
    print 'Software Version: '.ljust(24) + str(sysinfo.sw_version())
    print 'OS Version: '.ljust(24) + str(sysinfo.os_version())
    print 'Battery: '.ljust(24) + str(sysinfo.battery()) + '%'
    print 'Display Resolution: '.ljust(24) + str(
        sysinfo.display_pixels()[0]) + 'x' + str(sysinfo.display_pixels()[1])
    print 'IMEI: '.ljust(24) + sysinfo.imei()
    #print 'RAM Drive Size: ' + str(sysinfo.max_ramdrive_size())
    print 'RAM Size(total/free): '.ljust(24) + str(sysinfo.total_ram()) + str(
        sysinfo.free_ram())
    print 'ROM Size: '.ljust(24) + str(sysinfo.total_rom())
    print 'Free Drive Space: '.ljust(24) + str(sysinfo.free_drivespace())
    print 'Signal Strength:'.ljust(24) + str(sysinfo.signal_bars())
Example #4
0
    def sendSysinfo(self, full):
        self.send(NUM_SYSINFO_REPLY_START)
        self.send(NUM_SYSINFO_REPLY_LINE, "program_version", VERSION)
        self.send(NUM_SYSINFO_REPLY_LINE, "battery", sysinfo.battery())
        self.send(NUM_SYSINFO_REPLY_LINE, "active_profile",
                  sysinfo.active_profile())
        self.send(NUM_SYSINFO_REPLY_LINE, "free_ram", sysinfo.free_ram())
        self.send(NUM_SYSINFO_REPLY_LINE, "pys60_version", e32.pys60_version)

        if sysinfo.active_profile() == "offline":
            # Return an error code if the phone is in offline mode
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_dbm", -1)
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_bars", -1)
        else:
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_dbm",
                      sysinfo.signal_dbm())
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_bars",
                      sysinfo.signal_bars())

        for drive, free in sysinfo.free_drivespace().items():
            self.send(NUM_SYSINFO_REPLY_LINE, "free_drivespace",
                      str(drive) + str(free))

        if full:
            self.send(
                NUM_SYSINFO_REPLY_LINE,
                "display",
                str(sysinfo.display_pixels()[0]) + "x" +
                str(sysinfo.display_pixels()[1]),
            )
            self.send(NUM_SYSINFO_REPLY_LINE, "imei", sysinfo.imei())
            self.send(NUM_SYSINFO_REPLY_LINE, "model", sysinfo.sw_version())
            self.send(
                NUM_SYSINFO_REPLY_LINE,
                "s60_version",
                e32.s60_version_info[0],
                e32.s60_version_info[1],
            )
            self.send(NUM_SYSINFO_REPLY_LINE, "total_ram", sysinfo.total_ram())
            self.send(NUM_SYSINFO_REPLY_LINE, "total_rom", sysinfo.total_rom())

        self.send(NUM_SYSINFO_REPLY_END)
Example #5
0
def app():
    appuifw.app.exit_key_handler = lock.signal
    active_profile = sysinfo.active_profile()
    battery = sysinfo.battery()
    d1, d2 = sysinfo.display_pixels()
    free_ram = sysinfo.free_ram() / float(1024 * 1024)
    total_ram = sysinfo.total_ram() / float(1024 * 1024)
    imei = sysinfo.imei()
    sw_version_list = sysinfo.sw_version().split(' ')
    data_list = [(ru("Active Profile:"), ru(active_profile)),
                 (ru("Battery Percentage:"), ru(battery)),
                 (ru("Free RAM:"),
                  ru(str(free_ram)[:6] + " MB/" + str(total_ram)[:6] + " MB")),
                 (ru("Display:"), ru(str(d1) + " x " + str(d2))),
                 (ru("IMEI:"), imei),
                 (u"Software Version:", sw_version_list[0]),
                 (u"Software Version Date:", sw_version_list[1]),
                 (u"Type", sw_version_list[2])]

    list = appuifw.Listbox(data_list, lambda: None)
    appuifw.app.body = list
    appuifw.app.menu = [(u"Refresh Info", app), (u"About", about)]
Example #6
0
 def test_imei(self):
     self._test_util("imei", sysinfo.imei())
Example #7
0
import sysinfo


str =  "Active Profile: "+ sysinfo.active_profile()
str += "\nBattery Info: "+ sysinfo.battery()    #battery information in symbian 
str += "\nDisplay Info: "+ sysinfo.display_pixels()
str += "\nFree Space: "   + sysinfo.free_drivespace()
str += "\nRAM(F/T): " + str(sysinfo.free_ram()/(1024.0*1024.0)) +"/"+ str(sysinfo.total_ram()/(1024.0*1024.0))
str += "\nIMEI: "+ sysinfo.imei()

Example #8
0
#sysinfo是与系统信息有关的模块


def cn(x):
    return x.decode("utf8")


appuifw.app.body = t = appuifw.Text()
t.focus = False
appuifw.app.screen = "full"

t.add(cn("情景模式:") + sysinfo.active_profile())  #查看当前情景模式
t.add(cn("\n电量:") + unicode(sysinfo.battery()))  #查看当前电量
t.add(cn("\n屏幕分辨率:") + unicode(sysinfo.display_pixels()))  #查看屏幕分辨率
t.add(cn("\n剩余空间:\n"))
i = 0
drive = [u"C:", u"D:", u"E:"]
while i < len(drive):  #循环语句
    t.add(drive[i] + unicode(sysinfo.free_drivespace()[drive[i]] / 1024) +
          u"kb\n")  #查看C,D,E盘剩余空间
    i += 1
t.add(cn("剩余运存:") + unicode(sysinfo.free_ram() / 1024) + u"kb")  #查看剩余运存
t.add(cn("\nIMEI:") + unicode(sysinfo.imei()))  #查看手机串号
t.add(cn("\n系统版本:") + unicode(sysinfo.os_version()))  #查看系统版本信息
t.add(cn("\n响铃方式:") + unicode(sysinfo.ring_type()))  #查看响铃方式
t.add(cn("\n手机版本:") + unicode(sysinfo.sw_version()))  #查看手机版本
t.add(cn("\n缓存总大小:") + unicode(sysinfo.total_ram() / 1024) + u"kb")  #查看剩余缓存
t.add(cn("\nZ盘总大小:") + unicode(sysinfo.total_rom() / 1024) + u"kb")  #查看Z盘总大小

e32.Ao_lock().wait()
Example #9
0
## Loop scan for wireless x-driving
import wlantools as wl
import time as ti
import sysinfo as si
import location as loc
import positioning as pos
import audio as aud
import os
import sys


NUMLOOP=5000

imei = si.imei()
uagent = si.sw_version().split()[-1]

date = ti.strftime('%Y%m%d')

log_dir = "e:\\data\\wlan"
if not os.path.exists(log_dir):
    os.makedirs(log_dir)
logfile = os.path.join(log_dir, 'fpp_RawData_CMRI_'+date+'.csv')
fout = open(logfile, 'a')

media = "e:\\videos\\noti.mid"
try:
    snd = aud.Sound.open(media) 
    #print 'Sound ready!'
except:
    print 'Oops! NOT available: %s!' % media
Example #10
0
import sysinfo
print sysinfo.imei()

Example #11
0
import sysinfo, urllib, json, appuifw

URL = "http://192.168.0.2:9000"
imei = sysinfo.imei()


def json_request(req):
    enc = json.write(req)
    return json.read(urllib.urlopen(URL, enc).read())


def poll_server():
    global voted_already
    res = json_request({"voter": imei})
    votes, winner = res["winner"]

    if "closed" in res:
        appuifw.note(u"Winner is %s with %d votes" %\
                        (winner, votes))
        lock.signal()
        return False

    elif not voted_already and "title" in res:
        appuifw.app.title = u"Vote: %s" % res["title"]
        names = []
        for name in res["choices"]:
            names.append(unicode(name))
        idx = appuifw.selection_list(names)
        if idx == None:
            lock.signal()
            return False
Example #12
0
import sys
import os
import time
import sysinfo
import e32

sys.stdout.write("IMEI: %s\n" % sysinfo.imei())

sys.stdout.write("Battery strength: %s\n" % sysinfo.battery())
 
sys.stdout.write("Signal strength: %s\n" % sysinfo.signal_bars())
 
sys.stdout.write("Network signal strength in dBm: %s\n" % sysinfo.signal_dbm())
 
sys.stdout.write("SW version: %s\n" % sysinfo.sw_version())
 
sys.stdout.write("Display size:\n")
print(sysinfo.display_pixels())
 
sys.stdout.write("Current profile: %s\n" % sysinfo.active_profile())
 
sys.stdout.write("Ringing type: %s\n" % sysinfo.ring_type())
 
sys.stdout.write("OS version:\n")
print(sysinfo.os_version())

sys.stdout.write("Free/total RAM (MB): %.2f / %.2f\n" % (sysinfo.free_ram()/1024/1024,sysinfo.total_ram()/1024/1024))
 
sys.stdout.write("Total ROM (MB): %.2f \n" % (sysinfo.total_rom()/1024/1024))
 
sys.stdout.write("Free disk space C/E (MB): %.2f / %.2f\n" % (sysinfo.free_drivespace()['C:']/1024/1024,sysinfo.free_drivespace()['E:']/1024/1024))
Example #13
0
## Loop scan for wireless x-driving
import wlantools as wl
import time as ti
import sysinfo as si
import location as loc
import positioning as pos
import audio as aud
import os
import sys

NUMLOOP = 5000

imei = si.imei()
uagent = si.sw_version().split()[-1]

date = ti.strftime('%Y%m%d')

log_dir = "e:\\data\\wlan"
if not os.path.exists(log_dir):
    os.makedirs(log_dir)
logfile = os.path.join(log_dir, 'fpp_RawData_CMRI_' + date + '.csv')
fout = open(logfile, 'a')

media = "e:\\videos\\noti.mid"
try:
    snd = aud.Sound.open(media)
    #print 'Sound ready!'
except:
    print 'Oops! NOT available: %s!' % media

print
Example #14
0
a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\t'
def encode(s,n,o='',w='', al=a):
 for x in range(len(s)):
  n=n+1;c=s[x:x+1]
  if a.find(c)>=0 or w=='a':al+=a;o+=al[al.find(c)+n:al.find(c)+1+n]
  else:
   try:
    if int(c) in range(0,10):o+=chr(int(c)+n)
   except:
    o+=chr(ord(c)+100)
 return o
def decode(s,n,r='', al=a):
 print 'random no.',n
 for z in range(len(s)):
  n=n+1;c=s[z:z+1]
  if al.find(c)>=0:al+=a;r+=al[al.find(c)-n+1:al.find(c)+2-n]
  else:
   if ord(c) in range(0,10+n):r+=str(ord(c)-n+1)
   else:r+=chr(ord(s[z:z+1])-100)
 return r
def decodestring(s,a):return decode(str(s[int(float(s[:1]))+1:]),int(float(a.find(s[1:2])+1)))
def encodestring(s, a):K=random.randint(1,len(a)-1);k=encode(str(K), K, '', 'a');print 'random no.',K,'\nkey',k;return encode(s, K, str(len(k))+k)
import sysinfo
print 'imei',ints2chars(float(sysinfo.imei()))
O=raw_input('encode > ')
e=encodestring(O, a)
d=decodestring(e,a)
print 'origional string= '+O
print 'encoded string= '+e
print 'decoded string= '+d
print decodestring(raw_input('decode > '), a)
Example #15
0
    def create_config_file(self):
        iap_name_u = ask_iap_name()
        if iap_name_u is None:
            return
        iap_name = iap_name_u.encode("utf-8")
        iap_expr = """function () return cl2.iap_id_by_name('%s') end""" % iap_name

        mcc = appuifw.query(u"Home MCC:", "number", 244)
        if mcc is None:
            mcc = "nil"
        else:
            mcc = str(mcc)

        #operator = appuifw.query(u"Home operator:", "text", iap_name_u)
        #operator = appuifw.query(u"Home operator:", "text", u"Elisa")
        #if operator is None:
        #    operator = "nil"
        #else:
        #    operator = '"' + operator.encode("utf-8") + '"'

        import sysinfo
        username = appuifw.query(u"Username:"******"text", unicode(sysinfo.imei()))
        #username = appuifw.query(u"Username:"******"text", u"johndoe")
        if username is None:
            return
        username = username.encode("utf-8")

        remokon_password = appuifw.query(u"XMPP pw:", "text", u"")
        if remokon_password is None:
            remokon_password = "******"
        else:
            remokon_password = '******' + remokon_password.encode("utf-8") + '"'

        db_drive = appuifw.query(u"Log drive:", "text", u"e")
        if db_drive is None:
            return
        if len(db_drive) != 1:
            appuifw.note(u"Must be one letter", "error")
            return
        dbdir = (db_drive + u":\\\\data\\\\cl2").encode("utf-8")

        ldt = appuifw.query(u"Disk threshold (MB):", "number", 10)
        if ldt is None:
            return
        database_disk_threshold = ldt * 1e6

        compress_logs = choose_string_d(u"Compress logs?", [u"true", u"false"])

        log_sms_body = choose_string_d(u"Log SMS text?", [u"true", u"false"])

        text = """
        username = "******"
        remokon_password = %s
        iap = %s
        mcc = %s
        operator_name = nil
        database_dir = "%s"
        database_disk_threshold = %d
        compress_logs = %s
        log_sms_body = %s
	""" % (username, remokon_password, iap_expr, mcc, dbdir,
        database_disk_threshold, compress_logs, log_sms_body)
        make_file(config_file, str(text))
        appuifw.note(u"Config file written", "info")
 def devInfo(self):
     all=[(u'IMEI', sysinfo.imei()), (u'Total RAM', str(sysinfo.total_ram()/1024)+'KByte(s)'), (u'Free RAM', str(sysinfo.free_ram()/1024)+'KByte(s)'), (u'Battery', str(sysinfo.battery()*100/7)+u'%')]
     info='\n'.join(['%s: %s' %(k, v) for k, v in all])
     e32.ao_yield()
     return infopopup(info, u'Phone Info', OKREmpty)
Example #17
0
            al += a
            r += al[al.find(c) - n + 1:al.find(c) + 2 - n]
        else:
            if ord(c) in range(0, 10 + n): r += str(ord(c) - n + 1)
            else: r += chr(ord(s[z:z + 1]) - 100)
    return r


def decodestring(s, a):
    return decode(str(s[int(float(s[:1])) + 1:]),
                  int(float(a.find(s[1:2]) + 1)))


def encodestring(s, a):
    K = random.randint(1,
                       len(a) - 1)
    k = encode(str(K), K, '', 'a')
    print 'random no.', K, '\nkey', k
    return encode(s, K,
                  str(len(k)) + k)


import sysinfo
print 'imei', ints2chars(float(sysinfo.imei()))
O = raw_input('encode > ')
e = encodestring(O, a)
d = decodestring(e, a)
print 'origional string= ' + O
print 'encoded string= ' + e
print 'decoded string= ' + d
print decodestring(raw_input('decode > '), a)
Example #18
0
    def create_config_file(self):
        iap_name_u = ask_iap_name()
        if iap_name_u is None:
            return
        iap_name = iap_name_u.encode("utf-8")
        iap_expr = """function () return cl2.iap_id_by_name('%s') end""" % iap_name

        mcc = appuifw.query(u"Home MCC:", "number", 244)
        if mcc is None:
            mcc = "nil"
        else:
            mcc = str(mcc)
        
        #operator = appuifw.query(u"Home operator:", "text", iap_name_u)
        #operator = appuifw.query(u"Home operator:", "text", u"Elisa")
        #if operator is None:
        #    operator = "nil"
        #else:
        #    operator = '"' + operator.encode("utf-8") + '"'
        
        import sysinfo
        username = appuifw.query(u"Username:"******"text", unicode(sysinfo.imei()))
        #username = appuifw.query(u"Username:"******"text", u"johndoe")
        if username is None:
            return
        username = username.encode("utf-8")

        remokon_password = appuifw.query(u"XMPP pw:", "text", u"")
        if remokon_password is None:
            remokon_password = "******"
        else:
            remokon_password = '******' + remokon_password.encode("utf-8") + '"'
        
        db_drive = appuifw.query(u"Log drive:", "text", u"e")
        if db_drive is None:
            return
        if len(db_drive) != 1:
            appuifw.note(u"Must be one letter", "error")
            return
        dbdir = (db_drive + u":\\\\data\\\\cl2").encode("utf-8")
        
        ldt = appuifw.query(u"Disk threshold (MB):", "number", 10)
        if ldt is None:
            return
        database_disk_threshold = ldt * 1e6

        compress_logs = choose_string_d(u"Compress logs?", [u"true", u"false"])

        log_sms_body = choose_string_d(u"Log SMS text?", [u"true", u"false"])
        
	text = """
        username = "******"
        remokon_password = %s
        iap = %s
        mcc = %s
        operator_name = nil
        database_dir = "%s"
        database_disk_threshold = %d
        compress_logs = %s
        log_sms_body = %s
	""" % (username, remokon_password, iap_expr, mcc,
               dbdir, database_disk_threshold,
               compress_logs, log_sms_body)
	make_file(config_file, str(text))
        appuifw.note(u"Config file written", "info")
def imie():
    i = sysinfo.imei()
    appuifw.note(i)
    osama.add(
        ((itq('\n\t...................\nThe IMEI of phone is : \n') + i) +
         itq('\n\t...................\n')))