Commit 1030c197 authored by bernd's avatar bernd
Browse files

Runs on Android with some minor bugs

parent c356fa34
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ UValue test# 0 to test#
: >cache ( addr u -- addr' u' ) [: ." .cache" .test# ." /" type ;] $tmp ;

: init-cache' ( -- )
    "" >cache 1- file-status nip #-514 = IF
    "" >cache 1- file-status nip no-file# = IF
	"" >cache 1- $1FF =mkdir throw
    THEN ;

+5 −5
Original line number Diff line number Diff line
@@ -42,8 +42,8 @@ Variable replay-mode
: >chatid ( group u -- id u )  lastkey@ keyed-hash#128 ;

: save-msgs ( group u -- )
    otr-mode @ replay-mode @ or IF  2drop  EXIT  THEN  init-chatlog
    enc-file $off  n2o:new-msg >o
    otr-mode @ replay-mode @ or IF  2drop  EXIT  THEN
    init-chatlog  enc-file $off  n2o:new-msg >o
    2dup msg-logs #@ bounds ?DO
	I $@ [: net2o-base:$, net2o-base:nestsig ;]
	gen-cmd$ enc-file $+!
@@ -58,7 +58,7 @@ Variable replay-mode

: load-msg ( group u -- )
    >chatid [: ." ~/.net2o/chats/" 85type ." .v2o" ;] $tmp
    2dup file-status nip #-514 = ?EXIT
    2dup file-status nip no-file# = ?EXIT
    vault>msg decrypt-file
    replay-mode off ;

+4 −2
Original line number Diff line number Diff line
@@ -426,7 +426,9 @@ $10 Constant datesize#

\ copy files

: throw?exists ( throwcode -- )  dup #-514 <> and throw ;
#-514 Constant no-file#

: throw?exists ( throwcode -- )  dup no-file# <> and throw ;

: >backup ( addr u -- )
    2dup 2dup [: type '~' emit ;] $tmp rename-file throw?exists
@@ -437,7 +439,7 @@ $10 Constant datesize#

: >copy ( addr u -- fd )
    2dup >new { fd1 }
    r/o open-file dup #-514 = IF
    r/o open-file dup no-file# = IF
	2drop
    ELSE
	throw 0 { fd0 w^ cpy }
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ Variable key-list
    vaultkey $100 erase
    enc-mode @ $FF and $20 - rng$ vkey state# move-rep
    key( ." vkey: " vkey state# 85type forth:cr )
    enc-mode @ dup lit, vault-crypt 8 rshift $FF and >crypt
    enc-mode @ dup ulit, vault-crypt 8 rshift $FF and >crypt
    [: [: drop vsk swap keygendh ed-dh 2>r
	vkey vaultkey $10 + enc-mode @ $FF and $20 - move
	vaultkey enc-mode @ $FF and 2r> encrypt$