Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #197890

Re: PSA: A python script to clone your phone exactly, over Wi-Fi or USB

Path csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From Lawrence D’Oliveiro <ldo@nz.invalid>
Newsgroups comp.sys.mac.system, alt.os.linux, comp.lang.python
Subject Re: PSA: A python script to clone your phone exactly, over Wi-Fi or USB
Date Fri, 21 Aug 2026 07:04:20 -0000 (UTC)
Organization A noiseless patient Spider
Lines 48
Message-ID <1168t9k$403a$1@dont-email.me> (permalink)
References <116673g$ptq$1@nnrp.usenet.blueworldhosting.com> <11673rv$3iopn$3@dont-email.me> <20260820190640.20824006bb95f4403a2158d8@127.0.0.1> <1168jmh$1glq$1@dont-email.me>
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Injection-Date Fri, 21 Aug 2026 07:04:21 +0000 (UTC)
Injection-Info dont-email.me; logging-data="131178"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WNyppQ8VCBMzIaJWwNM0i"; posting-host="5aa6ab69e58325afd5f6f85406745311"
User-Agent Pan/0.165 (Kostiantynivka)
Cancel-Lock sha1:Hyl/0WaMvnCNlGaJofTFH7PfnpE= sha256:vvNyx6U2z2u732OHZmUk4hj5j1Xj7MpUX5CsC4SsUdk= sha1:IXbQINPI6O26z8O/vumOJ6U/sA8= sha256:FJ7nbpD0cjLnNgy6ssNYD1zTYDd3VTA7Ad23g6xJynU=
Xref csiph.com comp.sys.mac.system:146462 alt.os.linux:83092 comp.lang.python:197890

Cross-posted to 3 groups.

Show key headers only | View raw


On Fri, 21 Aug 2026 04:20:33 -0000 (UTC), Chris wrote:

> Especially python where the lack of whitespace consistency completely
> breaks the code.

However:

def netstring_encode(s, as_str = False) :
"encodes a string or bytes object as a netstring. Returns the encoded" \
" format as a string or bytes object, depending on as_str."
if isinstance(s, str) :
sb = s.encode()
elif isinstance(s, (bytes, bytearray)) :
sb = s
else :
raise TypeError("input value should be str or bytes")
if len(sb) > MAX_NETSTRING_LEN :
raise ValueError("netstring length of %d exceeds %d bytes" % (len(sb), MAX_NETSTRING_LEN))
result = b"%d:%s," % (len(sb), sb)
if as_str :
result = result.decode()
return \
result

Hopeless gibberish. But:

def netstring_encode(s, as_str = False) :
"encodes a string or bytes object as a netstring. Returns the encoded" \
" format as a string or bytes object, depending on as_str."
if isinstance(s, str) :
sb = s.encode()
elif isinstance(s, (bytes, bytearray)) :
sb = s
else :
raise TypeError("input value should be str or bytes")
#end if
if len(sb) > MAX_NETSTRING_LEN :
raise ValueError("netstring length of %d exceeds %d bytes" % (len(sb), MAX_NETSTRING_LEN))
#end if
result = b"%d:%s," % (len(sb), sb)
if as_str :
result = result.decode()
#end if
return \
result
#end netstring_encode

Some chance of restoring meaning.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: PSA: A python script to clone your phone exactly, over Wi-Fi or USB Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-21 07:04 +0000

csiph-web