Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
anonymous1184 committed May 27, 2021
2 parents 7065e8a + 4882727 commit ff96c66
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 39 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ YYYY/MM/DD - MAJOR.MINOR.RELEASE
[!] = Fix / Security


2021/05/27 - 1.0.1
——————————————————
[!] Sync icon when logged out
[+] Reduced memory footprint
[*] Minor code refactoring
[*] Better settings change detection


2021/05/21 - 1.0.0
——————————————————
[!] Less fatal errors
Expand Down
2 changes: 1 addition & 1 deletion Lib/autoType.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ autoType(entry, mode)
{
if INI.GENERAL.totp
Clipboard := entry.totp
TrayTip % appTitle, % "TOTP: " formatOtp(entry.totp), 10, 0x20
tip("TOTP: " formatOtp(entry.totp))
}
}

Expand Down
4 changes: 2 additions & 2 deletions Lib/init.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ init()
SetTimer bwStatus, -1 ; Async
}

if isLocked
if !isLogged || isLocked
ExitApp 1

; Decrypt data
getData()

; Acknowledge
Menu Tray, Icon, % A_IsCompiled ? A_ScriptFullPath : A_ScriptDir "\assets\bw-at.ico"
TrayTip % appTitle, Auto-Type Ready, 10, 0x20
tip("Auto-Type Ready")

; Setup PIN
if INI.PIN.use = -1 && !INI.PIN.hex && pin := pinSetup()
Expand Down
20 changes: 10 additions & 10 deletions Lib/settings.ahk
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@

settings()
{
SetTimer fileUpdate, 1000
SplitPath settings, fileName
if !WinExist(fileName)
Run % "edit " settings
WinWait % fileName
WinWaitClose % fileName
SetTimer fileUpdate, Delete
SplitPath settings, filename
Run % "edit " settings
WinWait % filename
SetTimer settings_update, 1000
}

fileUpdate()
settings_update()
{
static last := 0
FileGetTime mTime, % settings
if !last
if !last || WinExist("Secure Password Generator")
last := mTime
if (last != mTime)
else if (last != mTime)
{
MsgBox % 0x4|0x20|0x40000, % appTitle, Application needs to be reloaded for the changes to take effect. Reload now?
IfMsgBox Yes
Reload
last := mTime
}
SplitPath settings, filename
if !WinExist(filename)
SetTimer % A_ThisFunc, Delete
}
2 changes: 1 addition & 1 deletion Lib/sync.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sync(showTip := false)
SetTimer bwStatus, -1
getData()
if showTip
TrayTip % appTitle, Sync complete, 10, 0x20
tip("Sync complete")
}

sync_auto(mins)
Expand Down
7 changes: 7 additions & 0 deletions Lib/tip.ahk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

tip(txt)
{
TrayTip % appTitle, % txt, 10, 0x20
fn := Func("DllCall").Bind("K32EmptyWorkingSet", "Int",-1)
SetTimer % fn, -1000
}
4 changes: 2 additions & 2 deletions Lib/toggleLock.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ toggleLock(showTip := false)
Menu Tray, Icon, % A_IsCompiled ? A_ScriptFullPath : A_ScriptDir "\assets\bw-at.ico"
isLocked := false
if showTip
TrayTip % appTitle, Vault unlocked, 10, 0x20
tip("Vault unlocked")
return passwd
}
else
{
Menu Tray, Disable, 1&
Menu Tray, Rename , 2&, Un&Lock
if showTip
TrayTip % appTitle, Vault locked, 10, 0x20
tip("Vault locked")
Menu Tray, Icon, shell32.dll, 48
isLocked := true
}
Expand Down
4 changes: 2 additions & 2 deletions Lib/toggleLogin.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ toggleLogin(showTip := true)
if isLogged
{
isLogged := false
TrayTip % appTitle, Logged out, 10, 0x20
tip("Logged out")
; Update Menu
Menu Tray, Disable, 1&
Menu Tray, Disable, 2&
Expand Down Expand Up @@ -55,7 +55,7 @@ toggleLogin(showTip := true)
Menu Tray, Rename, 3&, Log&out
Menu Tray, Icon, % A_IsCompiled ? A_ScriptFullPath : A_ScriptDir "\assets\bw-at.ico"
if showTip
TrayTip % appTitle, Logged In, 10, 0x20
tip("Logged In")
return passwd
}
}
6 changes: 4 additions & 2 deletions Lib/update.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ update_isLatest()
if A_IsCompiled
FileGetVersion current, % A_ScriptFullPath
else
FileRead current, version
FileRead current, % A_ScriptDir "\version"
try
{
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET"
, "https://raw.githubusercontent.com/anonymous1184/bitwarden-autotype/master/version"
, false), whr.Send()
return (current = RTrim(whr.ResponseText, "``r`n"))
online := RTrim(whr.ResponseText, "`r`n")
return checkVersion(current, online)

}
return true ; Error while checking
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ This is a script-based utility; not a full-fledged, enterprise-ready application
[04]: https://bitwarden.com "Bitwarden"
[05]: https://github.com/anonymous1184/bitwarden-autotype/wiki "Wiki not written yet"
[06]: https://keepass.info/help/v2/autotype_obfuscation.html "TCATO: Two-Channel Auto-Type Obfuscation"
[07]: https://i.imgur.com/WeddYxr.png "Entry with Authenticator Key"
[07]: https://i.imgur.com/Qwv9oKQ.png "Entry with Authenticator Key"
[08]: https://github.com/bitwarden/cli "Bitwarden CLI"
[09]: https://github.com/bitwarden/jslib/blob/master/src/models/view/loginUriView.ts#L9 "loginUriView.ts:9"
[10]: https://github.com/bitwarden/jslib/blob/master/src/angular/components/icon.component.ts#L80 "icon.component.ts:6"
Expand Down
Binary file modified assets/bw-at.ini
Binary file not shown.
4 changes: 2 additions & 2 deletions bw-at.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,5 @@ return ; End of auto-execute
;@Ahk2Exe-SetMainIcon %A_ScriptDir%\assets\bw-at.ico
;@Ahk2Exe-SetName Bitwarden Auto-Type
;@Ahk2Exe-SetOrigFilename bw-at.ahk
;@Ahk2Exe-SetVersion 1.0.0.1
;@Ahk2Exe-SetProductVersion 1.0.0.1
;@Ahk2Exe-SetVersion 1.0.1.1
;@Ahk2Exe-SetProductVersion 1.0.1.1
21 changes: 8 additions & 13 deletions setup.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ DetectHiddenWindows On

; Arguments
verbose := !quiet := DEBUG := false
for i,arg in A_Args
{
if arg ~= "i)[-|\/]quiet"
verbose := !quiet := true
else if arg ~= "i)[-|\/]debug"
DEBUG := true
}
if A_Args[1] ~= "i)[-|\/]quiet"
verbose := !quiet := true
FileGetVersion version, % A_ScriptFullPath
if StrSplit(version, ".")[1] > 2020
DEBUG := true

; Check if latest version
if !DEBUG && !update_isLatest()
Expand Down Expand Up @@ -96,15 +94,12 @@ if verbose
}

; Progress
Gui New, +AlwaysOnTop +HwndHwnd +ToolWindow
Gui New, +AlwaysOnTop +HwndHwnd -SysMenu
Gui Font, s11 q5, Consolas
Gui Add, Text,, Getting version...
Gui Show,, > Download
Hotkey IfWinActive, % "ahk_id" hWnd
Hotkey !F4, WinExist
hMenu := DllCall("User32\GetSystemMenu", "UInt",hWnd, "UInt",0)
for i,uPosition in { SC_MINIMIZE: 0xF020, SC_CLOSE: 0xF060 }
DllCall("User32\DeleteMenu", "UInt",hMenu, "UInt",uPosition, "UInt",0)

; Latest
while !latest
Expand Down Expand Up @@ -171,6 +166,6 @@ return
;@Ahk2Exe-SetMainIcon %A_ScriptDir%\assets\bw-at.ico
;@Ahk2Exe-SetName Bitwarden Auto-Type
;@Ahk2Exe-SetOrigFilename setup.ahk
;@Ahk2Exe-SetVersion 1.0.0.1
;@Ahk2Exe-SetProductVersion 1.0.0.1
;@Ahk2Exe-SetVersion 1.0.1.1
;@Ahk2Exe-SetProductVersion 1.0.1.1
;@Ahk2Exe-UpdateManifest 1
4 changes: 2 additions & 2 deletions uninstall.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ Run % ComSpec " /C " quote("timeout /t 1 & del " quote(A_ScriptFullPath)),, Hide
;@Ahk2Exe-SetMainIcon %A_ScriptDir%\assets\uninstall.ico
;@Ahk2Exe-SetName Bitwarden Auto-Type
;@Ahk2Exe-SetOrigFilename uninstall.ahk
;@Ahk2Exe-SetVersion 1.0.0.1
;@Ahk2Exe-SetProductVersion 1.0.0.1
;@Ahk2Exe-SetVersion 1.0.1.1
;@Ahk2Exe-SetProductVersion 1.0.1.1
;@Ahk2Exe-UpdateManifest 1
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0.1
1.0.1.1

0 comments on commit ff96c66

Please sign in to comment.