Discussion:
unknown
1970-01-01 00:00:00 UTC
Permalink
<rant>
Anyway, I see no reason why my code was changed in the first place as my code reflects exactly what the VX-9100 Dll does. Is there a reason why the DM version needs to be hardcoded for each phone? DMv6 is an simply extension of DMv5 and can be detected on the fly. But, this is like using a timeout instead of entering DM whenever the phone lock is detected. The timer works but is certainly less elegant. Besides, LG's Dlls do exactly what the timer-free code did by entering DM whenever it detected the filesystem relocking.
</rant>

Anyway, Aaron's patch will fix the problem with DMv6.

-Nathan
The current code allows users to navigate through the filesystem, but
not read or write to it.
The attached patch allows users to read and write the filesystem on
their enV2. Something has changed that isn't allowing me to read/write
data through the other features. I'll have to look into that some more.
Enjoy.
-A
I just committed some premilinary support to the VX9100: auto-detection and filesystem access. Please check it out and report any problems you may find. Ringtones may also be added into the next test release.
-Joe Pham
____________________________________________________________
Beauty Advice Just Got a Makeover
Read reviews about the beauty products you have always wanted to try
http://thirdpartyoffers.netzero.net/TGL2231/fc/JKFkuJO6pwAd1h55sjcxqUCu4ty8j87RSh5usYfvyeY8S7b2Hiq20k/
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Index: src/phones/com_lg.py
===================================================================
--- src/phones/com_lg.py (revision 4620)
+++ src/phones/com_lg.py (working copy)
@@ -1606,21 +1606,24 @@
# similar but slightly different from v5, the enV2 started this!
# request the seed
- _req=self.protocolclass.DMKeyReq()
+ _req=self.protocolclass.DMKeyReq(unlock_key=0)
_resp=self.sendbrewcommand(_req, self.protocolclass.DMKeyResp)
_key=self.get_challenge_response(_resp.unlock_key)
+
self.log('Failed to get the key.')
raise EnterDMError('Failed to get the key')
- _req=self.protocolclass.DMEnterReq(unlock_key=_key)
- _req.unlock_code=1
- _req.unlock_code=3
- _req.convert_to_key2()
- raise EnterDMError('Unknown unlock_code: %d'%_resp.unlock_code)
+
+ xorkey = _key ^ 0xffffffffL
+ key0 = 0x86b206a0L
+ key1 = 0x86b200a0L | ((xorkey & 0x000000ffL) << 8)
+ key2 = 0xb8200033L | (xorkey & 0x0000ff00L)
+ key3 = 0x57410069L | ((xorkey & 0x00ff0000L) >> 8)
+ key4 = 0x8da4007fL | ((xorkey & 0xff000000L) >> 16)
+
+ _req = self.protocolclass.DMEnterReq(unlock_code=3, key0=key0, key1=key1, key2=key2, key3=key3, key4=key4)
_resp=self.sendbrewcommand(_req, self.protocolclass.DMEnterResp)
+
raise EnterDMError('Bad response - unlock_ok: %d'%_resp.result)
@@ -1645,8 +1648,8 @@
self.log('Failed to transition to DM')
self._in_DM=False
-## raise
+ raise
return
Index: src/phones/com_lgvx9100.py
===================================================================
--- src/phones/com_lgvx9100.py (revision 4620)
+++ src/phones/com_lgvx9100.py (working copy)
@@ -106,21 +106,23 @@
return self.imagetargets
_supportedsyncs=(
-## ('phonebook', 'read', None), # all phonebook reading
-## ('calendar', 'read', None), # all calendar reading
-## ('wallpaper', 'read', None), # all wallpaper reading
-## ('ringtone', 'read', None), # all ringtone reading
-## ('call_history', 'read', None),# all call history list reading
-## ('sms', 'read', None), # all SMS list reading
-## ('memo', 'read', None), # all memo list reading
-## ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook
-## ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar
-## ('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper
-## ('wallpaper', 'write', 'OVERWRITE'),
-## ('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone
-## ('ringtone', 'write', 'OVERWRITE'),
-#### ('sms', 'write', 'OVERWRITE'), # all SMS list writing
-## ('memo', 'write', 'OVERWRITE'), # all memo list writing
-#### ('playlist', 'read', 'OVERWRITE'),
-#### ('playlist', 'write', 'OVERWRITE'),
+ ('phonebook', 'read', None), # all phonebook reading
+ ('calendar', 'read', None), # all calendar reading
+ ('wallpaper', 'read', None), # all wallpaper reading
+ ('ringtone', 'read', None), # all ringtone reading
+ ('call_history', 'read', None),# all call history list reading
+ ('sms', 'read', None), # all SMS list reading
+ ('memo', 'read', None), # all memo list reading
+ ('t9_udb', 'read', 'OVERWRITE'),
+ ('phonebook', 'write', 'OVERWRITE'), # only overwriting phonebook
+ ('calendar', 'write', 'OVERWRITE'), # only overwriting calendar
+ ('wallpaper', 'write', 'MERGE'), # merge and overwrite wallpaper
+ ('wallpaper', 'write', 'OVERWRITE'),
+ ('ringtone', 'write', 'MERGE'), # merge and overwrite ringtone
+ ('ringtone', 'write', 'OVERWRITE'),
+ ('sms', 'write', 'OVERWRITE'), # all SMS list writing
+ ('memo', 'write', 'OVERWRITE'), # all memo list writing
+## ('playlist', 'read', 'OVERWRITE'),
+## ('playlist', 'write', 'OVERWRITE'),
+ ('t9_udb', 'write', 'OVERWRITE'),
)
Index: src/phones/p_lg.p
===================================================================
--- src/phones/p_lg.p (revision 4620)
+++ src/phones/p_lg.p (working copy)
@@ -144,7 +144,7 @@
1 UINT { 'default': 0x00 } +unlock_code
4 UINT unlock_key
1 UINT { 'default': 0x00 } +zero
-
+
""
1 UINT cmd
@@ -154,7 +154,7 @@
"Slightly different command for DMv6"
- 1 UINT { 'default': 0xFE } +cmd
+ 1 UINT { 'constant': 0xFE } +cmd
1 UINT { 'default': 0x00 } +unlock_code
4 UINT { 'default': 0x00 } +unlock_key
1 UINT { 'default': 0x00 } +zero
@@ -168,42 +168,22 @@
"Request to transition to DMv6"
- 1 UINT { 'default': 0xFE } +cmd
- 1 UINT { 'default': 0x00 } +unlock_code
- 4 UINT { 'default': 0x00 } +unlock_key
- 1 UINT { 'default': 0x00 } +zero
- 1 UINT { 'default': 0x00 } +option
- * LIST { 'createdefault': True,
- 1 UINT { 'default': 0 } +data
- %{
+ 1 UINT { 'constant': 0xFE } +cmd
+ 1 UINT { 'default': 0x03 } +unlock_code
+ 4 UINT key0
+ 2 UINT { 'default': 0x00 } +zero
+ 4 UINT key1
+ 4 UINT key2
+ 4 UINT key3
+ 4 UINT key4
- if self.unlock_code==3 and \
- self.unlock_key2.append(0)
-
- """Convert the key value to key2"""
- return
- self.init_key2()
- _buf=buffer()
- UINT(sizeinbytes=4, value=self.unlock_key).writetobuffer(_buf)
- _key=_buf.getvalue()
- self.unlock_key2[_idx*4]=~ord(_key[_idx])
-
- %}
-
"Response to our request to enter DMv6"
1 UINT cmd
1 UINT unlock_code
4 UINT unlock_key
1 UINT result "0=Failure, 1=Success"
-
+ * DATA bytes
+
* DATA bytes
Index: src/phones/p_lg.py
===================================================================
--- src/phones/p_lg.py (revision 4620)
+++ src/phones/p_lg.py (working copy)
@@ -2346,7 +2346,7 @@
self._bufferstartoffset=buf.getcurrentoffset()
try: self.__field_cmd
- self.__field_cmd=UINT(**{'sizeinbytes': 1, 'default': 0xFE })
+ self.__field_cmd=UINT(**{'sizeinbytes': 1, 'constant': 0xFE })
self.__field_cmd.writetobuffer(buf)
try: self.__field_unlock_code
@@ -2372,7 +2372,7 @@
'Reads this packet from the supplied buffer'
self._bufferstartoffset=buf.getcurrentoffset()
if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
- self.__field_cmd=UINT(**{'sizeinbytes': 1, 'default': 0xFE })
+ self.__field_cmd=UINT(**{'sizeinbytes': 1, 'constant': 0xFE })
self.__field_cmd.readfrombuffer(buf)
self.__field_unlock_code=UINT(**{'sizeinbytes': 1, 'default': 0x00 })
self.__field_unlock_code.readfrombuffer(buf)
@@ -2388,14 +2388,14 @@
try: self.__field_cmd
- self.__field_cmd=UINT(**{'sizeinbytes': 1, 'default': 0xFE })
+ self.__field_cmd=UINT(**{'sizeinbytes': 1, 'constant': 0xFE })
return self.__field_cmd.getvalue()
self.__field_cmd=value
- self.__field_cmd=UINT(value,**{'sizeinbytes': 1, 'default': 0xFE })
+ self.__field_cmd=UINT(value,**{'sizeinbytes': 1, 'constant': 0xFE })
def __delfield_cmd(self): del self.__field_cmd
@@ -2585,7 +2585,7 @@
"Request to transition to DMv6"
- __fields=['cmd', 'unlock_code', 'unlock_key', 'zero', 'option', 'unlock_key2']
+ __fields=['cmd', 'unlock_code', 'key0', 'zero', 'key1', 'key2', 'key3', 'key4']
dict={}
@@ -2620,29 +2620,21 @@
self._bufferstartoffset=buf.getcurrentoffset()
try: self.__field_cmd
- self.__field_cmd=UINT(**{'sizeinbytes': 1, 'default': 0xFE })
+ self.__field_cmd=UINT(**{'sizeinbytes': 1, 'constant': 0xFE })
self.__field_cmd.writetobuffer(buf)
try: self.__field_unlock_code
- self.__field_unlock_code=UINT(**{'sizeinbytes': 1, 'default': 0x00 })
+ self.__field_unlock_code=UINT(**{'sizeinbytes': 1, 'default': 0x03 })
self.__field_unlock_code.writetobuffer(buf)
- try: self.__field_unlock_key
- self.__field_unlock_key=UINT(**{'sizeinbytes': 4, 'default': 0x00 })
- self.__field_unlock_key.writetobuffer(buf)
+ self.__field_key0.writetobuffer(buf)
try: self.__field_zero
- self.__field_zero=UINT(**{'sizeinbytes': 1, 'default': 0x00 })
+ self.__field_zero=UINT(**{'sizeinbytes': 2, 'default': 0x00 })
self.__field_zero.writetobuffer(buf)
- try: self.__field_option
- self.__field_option=UINT(**{'sizeinbytes': 1, 'default': 0x00 })
- self.__field_option.writetobuffer(buf)
- try: self.__field_unlock_key2
- self.__field_unlock_key2=LIST(**{'elementclass': _gen_p_lg_179, 'createdefault': True, 'length': 16 })
- self.__field_unlock_key2.writetobuffer(buf)
+ self.__field_key1.writetobuffer(buf)
+ self.__field_key2.writetobuffer(buf)
+ self.__field_key3.writetobuffer(buf)
+ self.__field_key4.writetobuffer(buf)
self._bufferendoffset=buf.getcurrentoffset()
if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
@@ -2651,33 +2643,36 @@
'Reads this packet from the supplied buffer'
self._bufferstartoffset=buf.getcurrentoffset()
if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
- self.__field_cmd=UINT(**{'sizeinbytes': 1, 'default': 0xFE })
+ self.__field_cmd=UINT(**{'sizeinbytes': 1, 'constant': 0xFE })
self.__field_cmd.readfrombuffer(buf)
- self.__field_unlock_code=UINT(**{'sizeinbytes': 1, 'default': 0x00 })
+ self.__field_unlock_code=UINT(**{'sizeinbytes': 1, 'default': 0x03 })
self.__field_unlock_code.readfrombuffer(buf)
- self.__field_unlock_key=UINT(**{'sizeinbytes': 4, 'default': 0x00 })
- self.__field_unlock_key.readfrombuffer(buf)
- self.__field_zero=UINT(**{'sizeinbytes': 1, 'default': 0x00 })
+ self.__field_key0=UINT(**{'sizeinbytes': 4})
+ self.__field_key0.readfrombuffer(buf)
+ self.__field_zero=UINT(**{'sizeinbytes': 2, 'default': 0x00 })
self.__field_zero.readfrombuffer(buf)
- self.__field_option=UINT(**{'sizeinbytes': 1, 'default': 0x00 })
- self.__field_option.readfrombuffer(buf)
- self.__field_unlock_key2=LIST(**{'elementclass': _gen_p_lg_179, 'createdefault': True, 'length': 16 })
- self.__field_unlock_key2.readfrombuffer(buf)
+ self.__field_key1=UINT(**{'sizeinbytes': 4})
+ self.__field_key1.readfrombuffer(buf)
+ self.__field_key2=UINT(**{'sizeinbytes': 4})
+ self.__field_key2.readfrombuffer(buf)
+ self.__field_key3=UINT(**{'sizeinbytes': 4})
+ self.__field_key3.readfrombuffer(buf)
+ self.__field_key4=UINT(**{'sizeinbytes': 4})
+ self.__field_key4.readfrombuffer(buf)
self._bufferendoffset=buf.getcurrentoffset()
try: self.__field_cmd
- self.__field_cmd=UINT(**{'sizeinbytes': 1, 'default': 0xFE })
+ self.__field_cmd=UINT(**{'sizeinbytes': 1, 'constant': 0xFE })
return self.__field_cmd.getvalue()
self.__field_cmd=value
- self.__field_cmd=UINT(value,**{'sizeinbytes': 1, 'default': 0xFE })
+ self.__field_cmd=UINT(value,**{'sizeinbytes': 1, 'constant': 0xFE })
def __delfield_cmd(self): del self.__field_cmd
@@ -2686,201 +2681,119 @@
try: self.__field_unlock_code
- self.__field_unlock_code=UINT(**{'sizeinbytes': 1, 'default': 0x00 })
+ self.__field_unlock_code=UINT(**{'sizeinbytes': 1, 'default': 0x03 })
return self.__field_unlock_code.getvalue()
self.__field_unlock_code=value
- self.__field_unlock_code=UINT(value,**{'sizeinbytes': 1, 'default': 0x00 })
+ self.__field_unlock_code=UINT(value,**{'sizeinbytes': 1, 'default': 0x03 })
def __delfield_unlock_code(self): del self.__field_unlock_code
unlock_code=property(__getfield_unlock_code, __setfield_unlock_code, __delfield_unlock_code, None)
- try: self.__field_unlock_key
- self.__field_unlock_key=UINT(**{'sizeinbytes': 4, 'default': 0x00 })
- return self.__field_unlock_key.getvalue()
+ return self.__field_key0.getvalue()
- self.__field_unlock_key=value
+ self.__field_key0=value
- self.__field_unlock_key=UINT(value,**{'sizeinbytes': 4, 'default': 0x00 })
+ self.__field_key0=UINT(value,**{'sizeinbytes': 4})
- def __delfield_unlock_key(self): del self.__field_unlock_key
+ def __delfield_key0(self): del self.__field_key0
- unlock_key=property(__getfield_unlock_key, __setfield_unlock_key, __delfield_unlock_key, None)
+ key0=property(__getfield_key0, __setfield_key0, __delfield_key0, None)
try: self.__field_zero
- self.__field_zero=UINT(**{'sizeinbytes': 1, 'default': 0x00 })
+ self.__field_zero=UINT(**{'sizeinbytes': 2, 'default': 0x00 })
return self.__field_zero.getvalue()
self.__field_zero=value
- self.__field_zero=UINT(value,**{'sizeinbytes': 1, 'default': 0x00 })
+ self.__field_zero=UINT(value,**{'sizeinbytes': 2, 'default': 0x00 })
def __delfield_zero(self): del self.__field_zero
zero=property(__getfield_zero, __setfield_zero, __delfield_zero, None)
- try: self.__field_option
- self.__field_option=UINT(**{'sizeinbytes': 1, 'default': 0x00 })
- return self.__field_option.getvalue()
+ return self.__field_key1.getvalue()
- self.__field_option=value
+ self.__field_key1=value
- self.__field_option=UINT(value,**{'sizeinbytes': 1, 'default': 0x00 })
+ self.__field_key1=UINT(value,**{'sizeinbytes': 4})
- def __delfield_option(self): del self.__field_option
+ def __delfield_key1(self): del self.__field_key1
- option=property(__getfield_option, __setfield_option, __delfield_option, None)
+ key1=property(__getfield_key1, __setfield_key1, __delfield_key1, None)
- try: self.__field_unlock_key2
- self.__field_unlock_key2=LIST(**{'elementclass': _gen_p_lg_179, 'createdefault': True, 'length': 16 })
- return self.__field_unlock_key2.getvalue()
+ return self.__field_key2.getvalue()
- self.__field_unlock_key2=value
+ self.__field_key2=value
- self.__field_unlock_key2=LIST(value,**{'elementclass': _gen_p_lg_179, 'createdefault': True, 'length': 16 })
+ self.__field_key2=UINT(value,**{'sizeinbytes': 4})
- def __delfield_unlock_key2(self): del self.__field_unlock_key2
+ def __delfield_key2(self): del self.__field_key2
- unlock_key2=property(__getfield_unlock_key2, __setfield_unlock_key2, __delfield_unlock_key2, None)
+ key2=property(__getfield_key2, __setfield_key2, __delfield_key2, None)
- return True
+ return self.__field_key3.getvalue()
- yield ('cmd', self.__field_cmd, None)
- yield ('unlock_code', self.__field_unlock_code, None)
- yield ('unlock_key', self.__field_unlock_key, None)
- yield ('zero', self.__field_zero, None)
- yield ('option', self.__field_option, None)
- yield ('unlock_key2', self.__field_unlock_key2, None)
+ self.__field_key3=value
+ self.__field_key3=UINT(value,**{'sizeinbytes': 4})
+ def __delfield_key3(self): del self.__field_key3
- if self.unlock_code==3 and \
- self.unlock_key2.append(0)
+ key3=property(__getfield_key3, __setfield_key3, __delfield_key3, None)
- """Convert the key value to key2"""
- return
- self.init_key2()
- _buf=buffer()
- UINT(sizeinbytes=4, value=self.unlock_key).writetobuffer(_buf)
- _key=_buf.getvalue()
- self.unlock_key2[_idx*4]=~ord(_key[_idx])
+ return self.__field_key4.getvalue()
-
-
-
-
- 'Anonymous inner class'
- __fields=['data']
-
- dict={}
- # What was supplied to this function
- dict.update(kwargs)
- # Parent constructor
- super(_gen_p_lg_179,self).__init__(**dict)
- self._update(args,dict)
-
-
- return self.__fields
-
-
- super(_gen_p_lg_179,self)._update(args,kwargs)
- keys=kwargs.keys()
- setattr(self, key, kwargs[key])
- del kwargs[key]
- # Were any unrecognized kwargs passed in?
- self._complainaboutunusedargs(_gen_p_lg_179,kwargs)
- dict2={'sizeinbytes': 1, 'default': 0 }
- dict2.update(kwargs)
- kwargs=dict2
- self.__field_data=UINT(*args,**dict2)
- # Make all P fields that haven't already been constructed
-
-
- 'Writes this packet to the supplied buffer'
- self._bufferstartoffset=buf.getcurrentoffset()
- try: self.__field_data
- self.__field_data=UINT(**{'sizeinbytes': 1, 'default': 0 })
- self.__field_data.writetobuffer(buf)
- self._bufferendoffset=buf.getcurrentoffset()
- if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
-
-
- 'Reads this packet from the supplied buffer'
- self._bufferstartoffset=buf.getcurrentoffset()
- if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
- self.__field_data=UINT(**{'sizeinbytes': 1, 'default': 0 })
- self.__field_data.readfrombuffer(buf)
- self._bufferendoffset=buf.getcurrentoffset()
-
-
- try: self.__field_data
- self.__field_data=UINT(**{'sizeinbytes': 1, 'default': 0 })
- return self.__field_data.getvalue()
-
- self.__field_data=value
+ self.__field_key4=value
- self.__field_data=UINT(value,**{'sizeinbytes': 1, 'default': 0 })
+ self.__field_key4=UINT(value,**{'sizeinbytes': 4})
- def __delfield_data(self): del self.__field_data
+ def __delfield_key4(self): del self.__field_key4
- data=property(__getfield_data, __setfield_data, __delfield_data, None)
+ key4=property(__getfield_key4, __setfield_key4, __delfield_key4, None)
return True
- yield ('data', self.__field_data, None)
+ yield ('cmd', self.__field_cmd, None)
+ yield ('unlock_code', self.__field_unlock_code, None)
+ yield ('key0', self.__field_key0, None)
+ yield ('zero', self.__field_zero, None)
+ yield ('key1', self.__field_key1, None)
+ yield ('key2', self.__field_key2, None)
+ yield ('key3', self.__field_key3, None)
+ yield ('key4', self.__field_key4, None)
"Response to our request to enter DMv6"
- __fields=['cmd', 'unlock_code', 'unlock_key', 'result']
+ __fields=['cmd', 'unlock_code', 'unlock_key', 'result', 'bytes']
dict={}
@@ -2917,6 +2830,7 @@
self.__field_unlock_code.writetobuffer(buf)
self.__field_unlock_key.writetobuffer(buf)
self.__field_result.writetobuffer(buf)
+ self.__field_bytes.writetobuffer(buf)
self._bufferendoffset=buf.getcurrentoffset()
if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
@@ -2933,6 +2847,8 @@
self.__field_unlock_key.readfrombuffer(buf)
self.__field_result=UINT(**{'sizeinbytes': 1})
self.__field_result.readfrombuffer(buf)
+ self.__field_bytes=DATA()
+ self.__field_bytes.readfrombuffer(buf)
self._bufferendoffset=buf.getcurrentoffset()
@@ -2988,6 +2904,19 @@
result=property(__getfield_result, __setfield_result, __delfield_result, "0=Failure, 1=Success")
+ return self.__field_bytes.getvalue()
+
+ self.__field_bytes=value
+ self.__field_bytes=DATA(value,)
+
+ def __delfield_bytes(self): del self.__field_bytes
+
+ bytes=property(__getfield_bytes, __setfield_bytes, __delfield_bytes, None)
+
return True
@@ -2996,6 +2925,7 @@
yield ('unlock_code', self.__field_unlock_code, None)
yield ('unlock_key', self.__field_unlock_key, None)
yield ('result', self.__field_result, "0=Failure, 1=Success")
+ yield ('bytes', self.__field_bytes, None)
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Loading...