Skip to content

Commit a618ed6

Browse files
committed
Successfully built SLIP-39.app
o Simplify Backup display o Correctly deduce user name
1 parent de708f4 commit a618ed6

12 files changed

+190
-148
lines changed

GNUmakefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -613,13 +613,13 @@ dist/SLIP-39.app: SLIP-39-macOS.spec \
613613
# $@
614614
# echo "Checking signature (app code signed)..."; ./SLIP-39.metadata/check-signature $@ || true
615615
# codesign --verify $@
616-
# codesign --deep --force \
617-
# --all-architectures --options=runtime --timestamp \
618-
# --entitlements ./SLIP-39.metadata/entitlements.plist \
619-
# --sign "$(DEVID)" \
620-
# $@
621-
# echo "Checking signature (app code + entitlements signed w/ $(DEVID))..."; ./SLIP-39.metadata/check-signature $@ || true
622-
# codesign --verify $@
616+
codesign --deep --force \
617+
--all-architectures --options=runtime --timestamp \
618+
--entitlements ./SLIP-39.metadata/entitlements.plist \
619+
--sign "$(DEVID)" \
620+
$@
621+
echo "Checking signature (app code + entitlements signed w/ $(DEVID))..."; ./SLIP-39.metadata/check-signature $@ || true
622+
codesign --verify $@
623623
touch $@ # try to avoid unnecessary rebuilding
624624

625625
#

README.org

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ slip39 -q --secret "seven replace great luggage fox rent general tower guess ins
8686

8787
#+RESULTS:
8888
:results:
89-
SLIP39-2023-10-26+13.21.19-ETH-0x6E6268F14B922cb924C7683A415B30C2bf967000.pdf
89+
SLIP39-2023-10-27+05.09.52-ETH-0x6E6268F14B922cb924C7683A415B30C2bf967000.pdf
9090
:end:
9191

9292
#+LATEX: }
@@ -109,18 +109,19 @@ slip39 -q --secret "seven replace great luggage fox rent general tower guess ins
109109
[[./images/SLIP39-recover-BIP39-entropy.png]]
110110

111111
Later, when you need to recover your BIP-39 Seed Entropy and Mnemonic, use this SLIP-39 App or
112-
[[https://iancoleman.com]], and entry some of your SLIP-39 Mnemonic Cards. These may need to be collected from friends and family.
112+
[[https://iancoleman.com/slip39/]] and entry some of your SLIP-39 Mnemonic Cards. These may need
113+
to be collected from friends and family.
113114

114115
In this case, we're using the First and Second cards, intended for you to secure, separately from
115-
each other; for example, in two safes or other secure locations like locked filing cabinets, and
116+
each other; for example, in two safes or other secure locations like locked filing cabinets, at
116117
2 locations known to you and your partner(s):
117118

118119
#+CAPTION: BIP-39 Mnemonic
119120
#+ATTR_LATEX: :float wrap :width 2in :placement {r}
120121
[[./images/SLIP39-recover-BIP39-mnemonic.png]]
121122

122123
Finally, convert the recovered Seed Entropy back to your BIP-39 Mnemonic. This requires 2 steps
123-
if you use [[https://iancoleman.com]].
124+
if you use [[https://iancoleman.com/bip39/]]
124125

125126
In this step, we're simply converting the recovered Seed Entropy back into its BIP-39 Mnemonic.
126127
You need to select the "[X] show entropy details" checkbox in order to enter the raw Seed Entropy

README.pdf

779 KB
Binary file not shown.

README.txt

Lines changed: 119 additions & 118 deletions
Large diffs are not rendered by default.

SLIP-39-macOS.spec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ a = Analysis(['SLIP-39.py'],
1313
pathex=[],
1414
binaries=[],
1515
datas=datas,
16-
hiddenimports=[],
16+
hiddenimports=['ipaddress'],
1717
hookspath=[],
1818
hooksconfig={},
1919
runtime_hooks=[],
@@ -50,9 +50,9 @@ coll = COLLECT(exe,
5050
app = BUNDLE(coll,
5151
name='SLIP-39.app',
5252
icon='images/SLIP-39.icns',
53-
version='9.1.2',
53+
version='11.0.2',
5454
info_plist={
55-
'CFBundleVersion':'9.1.2',
55+
'CFBundleVersion':'11.0.2',
5656
'CFBundlePackageType':'APPL',
5757
'LSApplicationCategoryType':'public.app-category.finance',
5858
'LSMinimumSystemVersion':'10.15.0',

images/SLIP39 - Screen Shot 1.png

1.86 MB
Loading

images/SLIP39 - Screen Shot 1.xcf

4.01 MB
Binary file not shown.

images/slip39.png

1.29 MB
Loading

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ aiosmtpd >=1.4, <2
22
build
33
cx_Freeze >=6.12
44
flake8
5-
pyinstaller >=5.5
5+
pyinstaller >=6.1
66
pytest >=7.4.2,<8
77
pytest-cov >=4.1.0,<5
88
setuptools

slip39/gui/main.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
from ..api import Account, create, group_parser, random_secret, cryptopaths_parser, paper_wallet_available
3636
from ..recovery import recover, recover_bip39, produce_bip39, scan_entropy, display_entropy
37-
from ..util import log_level, log_cfg, ordinal, commas, chunker, hue_shift, rate_dB, entropy_rating_dB, timing, avg
37+
from ..util import log_level, log_cfg, ordinal, commas, chunker, hue_shift, rate_dB, entropy_rating_dB, timing, avg, parse_scutil
3838
from ..layout import write_pdfs, printers_available
3939
from ..defaults import (
4040
GROUPS, GROUP_THRESHOLD_RATIO, MNEM_PREFIX, CRYPTO_PATHS, BITS, BITS_BIP39, BITS_DEFAULT,
@@ -277,11 +277,10 @@ def groups_layout(
277277
visible=LO_CRE, **T_hue( B_kwds, 0/20 )),
278278
sg.Radio( "256-bit", "SD", key='-SD-256-RND-', visible=LO_CRE, **T_hue( B_kwds, 0/20 )),
279279
sg.Radio( "512-bit", "SD", key='-SD-512-RND-', visible=LO_PRO, **T_hue( B_kwds, 0/20 )),
280-
sg.Text( "Recover:", visible=LO_BAK, **T_hue( T_kwds, 2/20 )),
280+
sg.Text( "Recover:", visible=LO_CRE, **T_hue( T_kwds, 2/20 )),
281281
sg.Radio( "SLIP-39", "SD", key='-SD-SLIP-', visible=LO_REC, **T_hue( B_kwds, 2/20 )),
282282
sg.Radio( "BIP-39", "SD", key='-SD-BIP-', default=LO_BAK,
283-
visible=LO_BAK or LO_CRE,
284-
**T_hue( B_kwds, 2/20 )),
283+
visible=LO_CRE, **T_hue( B_kwds, 2/20 )),
285284
sg.Radio( "BIP-39 Seed", "SD", key='-SD-BIP-SEED-', visible=LO_PRO, **T_hue( B_kwds, 2/20 )),
286285
sg.Checkbox( 'Passphrase', key='-SD-PASS-C-', visible=False, **T_hue( B_kwds, 2/20 )),
287286
],
@@ -350,9 +349,10 @@ def groups_layout(
350349
sg.Text( "", key='-SEED-', size=inlong, **T_kwds ),
351350
],
352351
[
353-
sg.Checkbox( "Using BIP-39:", key='-AS-BIP-CB-', default=True,
352+
sg.Checkbox( "Using BIP-39:", key='-AS-BIP-CB-', visible=LO_CRE,
353+
default=True,
354354
size=prefix, **T_hue( B_kwds, -1/20 )),
355-
sg.Text( '', key='-AS-BIP-', visible=True, **T_hue( T_kwds_dense, -1/20 )),
355+
sg.Text( '', key='-AS-BIP-', visible=LO_CRE, **T_hue( T_kwds_dense, -1/20 )),
356356
],
357357
[
358358
sg.Column( [
@@ -602,12 +602,12 @@ def update_seed_data( event, window, values ):
602602
# We're recovering the BIP-39 Seed Phrase *Entropy*, NOT the derived (decrypted) 512-bit
603603
# Seed Data! So, we don't deal in Passphrases, here. The Passphrase (to encrypt the Seed,
604604
# when "Using BIP-39") is only required to display the correct wallet addresses.
605-
window['-SD-DATA-F-'].update( "BIP-39 Mnemonic: " )
605+
window['-SD-DATA-F-'].update( "BIP-39 Mnemonic to Back Up: " )
606606
window['-SD-DATA-F-'].update( visible=True )
607607
window['-SD-PASS-C-'].update( visible=False )
608608
window['-SD-PASS-F-'].update( visible=False )
609609
elif 'SLIP' in update_seed_data.src:
610-
window['-SD-DATA-F-'].update( "SLIP-39 Mnemonics: " )
610+
window['-SD-DATA-F-'].update( "SLIP-39 Mnemonics to Back Up: " )
611611
window['-SD-DATA-F-'].update( visible=True )
612612
window['-SD-PASS-C-'].update( visible=True )
613613
window['-SD-PASS-F-'].update(
@@ -1026,11 +1026,13 @@ def user_name_full():
10261026
f"{' '.join( command )!r} command failed, or no output returned"
10271027

10281028
if sys.platform == 'darwin':
1029-
for li in subproc.stdout.split( '\n' ):
1030-
if 'kCGSessionLongUserNameKey' in li:
1031-
# eg.: " kCGSessionLongUserNameKey : Perry Kundert"
1032-
full_name = li.split( ':' )[1].strip()
1033-
break
1029+
scutil = parse_scutil( subproc.stdout )
1030+
if uid := scutil.get( 'UID' ):
1031+
for session in scutil.get( 'SessionInfo', {} ).values():
1032+
if session.get( 'kCGSSessionUserIDKey' ) == uid:
1033+
# eg.: " kCGSessionLongUserNameKey : Perry Kundert"
1034+
full_name = session.get( 'kCGSessionLongUserNameKey' )
1035+
break
10341036
elif sys.platform == 'win32':
10351037
for li in subproc.stdout.split( '\n' ):
10361038
if li.startswith( 'Full Name' ):
@@ -1352,7 +1354,9 @@ def deficiency( *deficiencies ):
13521354

13531355
# Recover any passphrase, discarding any details on change. The empty passphrase b'' is the
13541356
# default for both SLIP-39 and BIP-39.
1355-
window['-AS-BIP-'].update( visible=values['-AS-BIP-CB-'] )
1357+
if window['-AS-BIP-CB-'].visible:
1358+
# Only if the checkbox is visible in this mode, also make the BIP-39 rendering visible
1359+
window['-AS-BIP-'].update( visible=values['-AS-BIP-CB-'] )
13561360
window['-PASSPHRASE-F-'].update(
13571361
'BIP-39 Passphrase' if using_bip39 else passphrase_trezor_incompatible )
13581362
passphrase_now = values['-PASSPHRASE-'].strip().encode( 'UTF-8' )

0 commit comments

Comments
 (0)