Subido a Gitea

This commit is contained in:
luisgulo 2023-06-02 17:38:45 +02:00
commit b8d27db3fb
28 changed files with 662 additions and 0 deletions

2
.directory Normal file
View file

@ -0,0 +1,2 @@
[Desktop Entry]
Icon=./.icon.png

BIN
.gambas/FMAIN Normal file

Binary file not shown.

BIN
.gambas/FRMROOTPASSWORD Normal file

Binary file not shown.

3
.hidden/CHANGELOG Normal file
View file

@ -0,0 +1,3 @@
* Sun Jan 12 2020 luisgulo <luisgulo@soloconlinux.org.es> 1.0.5
- Lanzamiento inicial

BIN
.icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

20
.lang/#project.pot Normal file
View file

@ -0,0 +1,20 @@
# /home/luisgulo/ProyectosGAMBAS/WifiQR/.project
# Generated by the Gambas IDE
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: WifiQR 3.12.2\n"
"POT-Creation-Date: 2020-01-12 17:31 UTC\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: .project:1
msgid "WIFI & QR"
msgstr ""
#: .project:2
msgid "Recupera tus claves WIFI y genera conexiones a ellas como códigos QR"
msgstr ""

53
.lang/.pot Normal file
View file

@ -0,0 +1,53 @@
#, fuzzy
msgid ""
msgstr ""
"#-#-#-#-# #project.pot (WifiQR 3.12.2) #-#-#-#-#\n"
"Project-Id-Version: WifiQR 3.12.2\n"
"POT-Creation-Date: 2020-01-12 17:28 UTC\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"#-#-#-#-# FMain.pot ($(PACKAGE) $(VERSION)) #-#-#-#-#\n"
"Project-Id-Version: $(PACKAGE) $(VERSION)\n"
"POT-Creation-Date: 2020-01-12 17:28 UTC\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"#-#-#-#-# frmRootPassword.pot ($(PACKAGE) $(VERSION)) #-#-#-#-#\n"
"Project-Id-Version: $(PACKAGE) $(VERSION)\n"
"POT-Creation-Date: 2020-01-12 17:28 UTC\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: .project:1 FMain.form:15
msgid "WIFI & QR"
msgstr ""
#: .project:2
msgid "Recupera tus claves WIFI y genera conexiones a ellas como códigos QR"
msgstr ""
#: FMain.form:29
msgid "WiFi a las que te has conectado"
msgstr ""
#: FMain.form:34
msgid "abc123ABC"
msgstr ""
#: frmRootPassword.form:11
msgid "Necesario usar clave de 'root'"
msgstr ""
#: frmRootPassword.form:22
msgid "Contraseña de 'root'"
msgstr ""
#: frmRootPassword.form:27
msgid "Aceptar"
msgstr ""
#: frmRootPassword.form:33
msgid " Salir"
msgstr ""

24
.lang/FMain.pot Normal file
View file

@ -0,0 +1,24 @@
# /home/luisgulo/ProyectosGAMBAS/WifiQR/.src/FMain.class
# Generated by the Gambas 3.12 compiler
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: $(PACKAGE) $(VERSION)\n"
"POT-Creation-Date: 2020-01-12 17:28 UTC\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: FMain.form:15
msgid "WIFI & QR"
msgstr ""
#: FMain.form:29
msgid "WiFi a las que te has conectado"
msgstr ""
#: FMain.form:34
msgid "abc123ABC"
msgstr ""

BIN
.lang/en.mo Normal file

Binary file not shown.

43
.lang/en.po Normal file
View file

@ -0,0 +1,43 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: WifiQR 3.12.2\n"
"PO-Revision-Date: 2020-01-12 17:17 UTC\n"
"Last-Translator: luisgulo <luisgulo@gmail.com>\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: .project:1 FMain.form:15
msgid "WIFI & QR"
msgstr "WIFI & QR"
#: .project:2
msgid "Recupera tus claves WIFI y genera conexiones a ellas como códigos QR"
msgstr "Recover your WIFI keys and generate connections to them as QR codes"
#: FMain.form:29
msgid "WiFi a las que te has conectado"
msgstr "WiFi you have connected to"
#: FMain.form:34
msgid "abc123ABC"
msgstr "abc123ABC"
#: frmRootPassword.form:11
msgid "Necesario usar clave de 'root'"
msgstr "You need to use 'root' password"
#: frmRootPassword.form:22
msgid "Contraseña de 'root'"
msgstr "'root' password"
#: frmRootPassword.form:27
msgid "Aceptar"
msgstr ""
#: frmRootPassword.form:33
msgid " Salir"
msgstr "Quit"

BIN
.lang/es_ES.mo Normal file

Binary file not shown.

43
.lang/es_ES.po Normal file
View file

@ -0,0 +1,43 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: WifiQR 3.12.2\n"
"PO-Revision-Date: 2020-01-12 17:16 UTC\n"
"Last-Translator: luisgulo <luisgulo@gmail.com>\n"
"Language: es_ES\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: .project:1 FMain.form:15
msgid "WIFI & QR"
msgstr "WIFI & QR"
#: .project:2
msgid "Recupera tus claves WIFI y genera conexiones a ellas como códigos QR"
msgstr "Recupera tus claves WIFI y genera conexiones a ellas como códigos QR"
#: FMain.form:29
msgid "WiFi a las que te has conectado"
msgstr "WiFi a las que te has conectado"
#: FMain.form:34
msgid "abc123ABC"
msgstr "abc123ABC"
#: frmRootPassword.form:11
msgid "Necesario usar clave de 'root'"
msgstr "Necesario usar clave de 'root'"
#: frmRootPassword.form:22
msgid "Contraseña de 'root'"
msgstr "Contraseña de 'root'"
#: frmRootPassword.form:27
msgid "Aceptar"
msgstr "Aceptar"
#: frmRootPassword.form:33
msgid " Salir"
msgstr " Salir"

28
.lang/frmRootPassword.pot Normal file
View file

@ -0,0 +1,28 @@
# /home/luisgulo/ProyectosGAMBAS/WifiQR/.src/frmRootPassword.class
# Generated by the Gambas 3.12 compiler
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: $(PACKAGE) $(VERSION)\n"
"POT-Creation-Date: 2020-01-12 17:28 UTC\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: frmRootPassword.form:11
msgid "Necesario usar clave de 'root'"
msgstr ""
#: frmRootPassword.form:22
msgid "Contraseña de 'root'"
msgstr ""
#: frmRootPassword.form:27
msgid "Aceptar"
msgstr ""
#: frmRootPassword.form:33
msgid " Salir"
msgstr ""

31
.project Normal file
View file

@ -0,0 +1,31 @@
# Gambas Project File 3.0
Title=WIFI & QR
Startup=FMain
Icon=WifiQR-icono.png
Version=1.0.5
Component=gb.image
Component=gb.gui
Component=gb.form
Description="Recupera tus claves WIFI y genera conexiones a ellas como códigos QR"
Authors="Luis GuLo"
TabSize=2
Translate=1
Language=es_ES
SourcePath=/home/luisgulo/ProyectosGAMBAS/SOURCEs
Maintainer=luisgulo
Vendor=LuisGulo
Address=luisgulo@soloconlinux.org.es
Url=https://repositorio.soloconlinux.org.es
License=General Public License
PackageName=wifiqr-1.0.5
CreateEachDirectory=1
Packager=1
Systems=debian
Menus=debian:"Applications/Network/Monitoring"
Categories=debian:"Network"
Groups=debian:"net"
ExtraDependencies=debian:"qrencode\t\t"
Tags=Network,Profiling,RasterGraphics,System,Web
Dependencies=qrencode
WebSite=https://repositorio.soloconlinux.org.es
CreateMenu=1

18
.settings Normal file
View file

@ -0,0 +1,18 @@
[Breakpoints]
Count=0
[DebugWindow]
Count=0
[Executable]
Path="WifiQR.gambas"
[OpenFile]
Active=2
File[1]=".src/FMain.form"
File[2]=".src/FMain.class:69.8"
Count=2
[Watches]
Count=0

102
.src/FMain.class Normal file
View file

@ -0,0 +1,102 @@
' Gambas class file
'' Generar Imagen QR desde consola
' echo 'WIFI:S:IDENTIFICADOR_WIFI;T:WEP;P:ABC1234;;' |qrencode -o /tmp/qr2.png -s 9 -v l
' Idem pero generar hacia standard output
' echo 'WIFI:S:IDENTIFICADOR_WIFI;T:WEP;P:ABC1234;;' |qrencode -o - -s 9 -v 3
' Codificacion(T) => WEP/WPA/nopass
Public RootPassword As String = ""
Public RutaWIFIS As String = "/etc/NetworkManager/system-connections"
Public Sub Form_Open()
System.Shell = "/bin/bash"
Me.Text = "WIFI & QR " & " Versión " & Application.Version
RellenarWifis()
' Pintamos QR de Ejemplo
GeneraImagenWifiQR("SOLO_CON_LINUX", "WPA", "ABCD1234")
Me.Show
'Pedimos clave de Root y comprobamos si es correcta
frmRootPassword.ShowModal
CompruebaPwRoot()
End
Public Function RellenarWifis()
'Buscar lista de Wifis a las que se ha conectado el equipo alguna vez
Dim Fichero As String
For Each Fichero In Dir(RutaWIFIS).Sort()
ComboWIFIS.Add(Fichero)
Next
End
Public Sub CheckMostrarClave_Click()
If CheckMostrarClave.Value
txtClave.Password = False
Else
txtClave.Password = True
Endif
End
Public Sub OjoVerClave_MouseDown()
CheckMostrarClave_Click()
CheckMostrarClave.Value = Not CheckMostrarClave.Value
End
Public Sub ComboWIFIS_Click()
Dim FicheroWifi As String
FicheroWifi = Shell$(RutaWIFIS & "/" & ComboWIFIS.Current.Text)
'Message("Ahora es:" & FicheroWifi)
'Cargar Valores
Dim SSID As String
Dim TIPO As String
Dim CLAVE As String
Shell "echo -n $(echo " & RootPassword & " | su --session-command \"grep -i 'SSID' " & FicheroWifi & "\" | awk -F '=' '{print $2}')" To SSID
Shell "echo -n $(echo " & RootPassword & " | su --session-command \"grep -i 'KEY-MGMT' " & FicheroWifi & "\" | awk -F '=' '{print $2}')" To TIPO
Shell "echo -n $(echo " & RootPassword & " | su --session-command \"grep -i 'PSK=' " & FicheroWifi & "\" | awk -F '=' '{print $2}')" To CLAVE
txtClave.Text = CLAVE
GeneraImagenWifiQR(SSID, TIPO, CLAVE)
End
Public Sub botonClaveRoot_Click()
frmRootPassword.ShowModal
CompruebaPwRoot()
End
Public Function CompruebaPwRoot()
Dim Resultado As String
Dim F1 As String
F1 = Shell$(RutaWIFIS & "/" & ComboWIFIS[0].Text)
Shell "echo " & RootPassword & " | su --session-command \"cat " & F1 & "\" 1>/dev/null 2>/dev/null; echo -n $?" To Resultado
'Message("recibi: -" & Resultado & "-")
If Resultado = "0"
' Clave Correcta => Desbloqueamos Controles
ComboWIFIS.Enabled = True
OjoVerClave.Enabled = True
CheckMostrarClave.Enabled = True
botonGrabarQR.Enabled = True
Else
' Clave Incorrecta => Bloqueado
ComboWIFIS.Enabled = False
OjoVerClave.Enabled = False
CheckMostrarClave.Enabled = False
botonGrabarQR.Enabled = False
Endif
End
Public Sub botonGrabarQR_Click()
Dim ruta As String
ruta = User.Home & "/WifiQR-" & ComboWIFIS.Current.Text & ".png"
imagenQR.Picture.Save(ruta)
Message("Conexión WifiQR grabada en: " & ruta)
End
Public Function GeneraImagenWifiQR(SSID As String, TIPO As String, CLAVE As String)
'Generamos PNG en formato String
Dim TEXTOQR As String
'Shell "echo 'WIFI:S:SOLO_CON_LINUX;T:WPA;P:ABC1234;;' |qrencode -o - -s 9 -v 3" To TEXTOQR
Shell "echo 'WIFI:S:" & SSID & ";T:" & TIPO & ";P:" & CLAVE & ";;' |qrencode -o - -s 9 -v 3" To TEXTOQR
imagenQR.Picture = Picture.FromString(TEXTOQR)
End

103
.src/FMain.class~ Normal file
View file

@ -0,0 +1,103 @@
' Gambas class file
'' Generar Imagen QR desde consola
' echo 'WIFI:S:IDENTIFICADOR_WIFI;T:WEP;P:ABC1234;;' |qrencode -o /tmp/qr2.png -s 9 -v l
' Idem pero generar hacia standard output
' echo 'WIFI:S:IDENTIFICADOR_WIFI;T:WEP;P:ABC1234;;' |qrencode -o - -s 9 -v 3
' Codificacion(T) => WEP/WPA/nopass
Public RootPassword As String = ""
Public RutaWIFIS As String = "/etc/NetworkManager/system-connections"
Public Sub Form_Open()
System.Shell = "/bin/bash"
Me.Text = "WIFI & QR " & " Versión " & Application.Version
RellenarWifis()
' Pintamos QR de Ejemplo
GeneraImagenWifiQR("SOLO_CON_LINUX", "WPA", "ABCD1234")
Me.Show
'Pedimos clave de Root y comprobamos si es correcta
frmRootPassword.ShowModal
CompruebaPwRoot()
End
Public Function RellenarWifis()
'Buscar lista de Wifis a las que se ha conectado el equipo alguna vez
Dim Fichero As String
ComboWIFIS.Add("SOLO_CON_LINUX")
For Each Fichero In Dir(RutaWIFIS).Sort()
ComboWIFIS.Add(Fichero)
Next
End
Public Sub CheckMostrarClave_Click()
If CheckMostrarClave.Value
txtClave.Password = False
Else
txtClave.Password = True
Endif
End
Public Sub OjoVerClave_MouseDown()
CheckMostrarClave_Click()
CheckMostrarClave.Value = Not CheckMostrarClave.Value
End
Public Sub ComboWIFIS_Click()
Dim FicheroWifi As String
FicheroWifi = Shell$(RutaWIFIS & "/" & ComboWIFIS.Current.Text)
'Message("Ahora es:" & FicheroWifi)
'Cargar Valores
Dim SSID As String
Dim TIPO As String
Dim CLAVE As String
Shell "echo -n $(echo " & RootPassword & " | su --session-command \"grep -i 'SSID' " & FicheroWifi & "\" | awk -F '=' '{print $2}')" To SSID
Shell "echo -n $(echo " & RootPassword & " | su --session-command \"grep -i 'KEY-MGMT' " & FicheroWifi & "\" | awk -F '=' '{print $2}')" To TIPO
Shell "echo -n $(echo " & RootPassword & " | su --session-command \"grep -i 'PSK=' " & FicheroWifi & "\" | awk -F '=' '{print $2}')" To CLAVE
txtClave.Text = CLAVE
GeneraImagenWifiQR(SSID, TIPO, CLAVE)
End
Public Sub botonClaveRoot_Click()
frmRootPassword.ShowModal
CompruebaPwRoot()
End
Public Function CompruebaPwRoot()
Dim Resultado As String
Dim F1 As String
F1 = Shell$(RutaWIFIS & "/" & ComboWIFIS[0].Text)
Shell "echo " & RootPassword & " | su --session-command \"cat " & F1 & "\" 1>/dev/null 2>/dev/null; echo -n $?" To Resultado
'Message("recibi: -" & Resultado & "-")
If Resultado = "0"
' Clave Correcta => Desbloqueamos Controles
ComboWIFIS.Enabled = True
OjoVerClave.Enabled = True
CheckMostrarClave.Enabled = True
botonGrabarQR.Enabled = True
Else
' Clave Incorrecta => Bloqueado
ComboWIFIS.Enabled = False
OjoVerClave.Enabled = False
CheckMostrarClave.Enabled = False
botonGrabarQR.Enabled = False
Endif
End
Public Sub botonGrabarQR_Click()
Dim ruta As String
ruta = User.Home & "/WifiQR-" & ComboWIFIS.Current.Text & ".png"
imagenQR.Picture.Save(ruta)
Message("Conexión WifiQR grabada en: " & ruta)
End
Public Function GeneraImagenWifiQR(SSID As String, TIPO As String, CLAVE As String)
'Generamos PNG en formato String
Dim TEXTOQR As String
'Shell "echo 'WIFI:S:SOLO_CON_LINUX;T:WPA;P:ABC1234;;' |qrencode -o - -s 9 -v 3" To TEXTOQR
Shell "echo 'WIFI:S:" & SSID & ";T:" & TIPO & ";P:" & CLAVE & ";;' |qrencode -o - -s 9 -v 3" To TEXTOQR
imagenQR.Picture = Picture.FromString(TEXTOQR)
End

50
.src/FMain.form Normal file
View file

@ -0,0 +1,50 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,50,62)
Text = ("WIFI & QR")
Icon = Picture["WifiQR-icono.png"]
Resizable = False
{ CheckMostrarClave CheckBox
MoveScaled(40,9,8,4)
Enabled = False
Text = (" ")
}
{ ComboWIFIS ComboBox
MoveScaled(2,3,36,4)
Enabled = False
ReadOnly = True
Text = ("WiFi a las que te has conectado")
}
{ txtClave TextBox
MoveScaled(7,9,32,4)
Text = ("abc123ABC")
ReadOnly = True
Password = True
}
{ imagenQR PictureBox
MoveScaled(2,14,46,46)
Expand = True
Border = Border.Plain
Stretch = True
}
{ PictureBox1 PictureBox
MoveScaled(40,1,8,8)
Picture = Picture["WifiQR-icono.png"]
Stretch = True
}
{ OjoVerClave PictureBox
MoveScaled(43,9,5,5)
Enabled = False
Picture = Picture["icon:/32/watch"]
}
{ botonClaveRoot Button
MoveScaled(2,9,4,4)
Picture = Picture["icon:/22/unlock"]
}
{ botonGrabarQR Button
MoveScaled(43,56,5,4)
Enabled = False
Picture = Picture["icon:/22/save"]
}
}

50
.src/FMain.form~ Normal file
View file

@ -0,0 +1,50 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,50,62)
Text = ("WIFI & QR")
Icon = Picture["WifiQR-icono.png"]
Resizable = False
{ CheckMostrarClave CheckBox
MoveScaled(40,9,8,4)
Enabled = False
Text = (" ")
}
{ ComboWIFIS ComboBox
MoveScaled(2,3,36,4)
Enabled = False
ReadOnly = True
Text = ("WiFi a las que te has conectado")
}
{ txtClave TextBox
MoveScaled(7,9,32,4)
Text = ("abc123ABC")
ReadOnly = True
Password = True
}
{ imagenQR PictureBox
MoveScaled(2,14,46,46)
Expand = True
Border = Border.Plain
Stretch = True
}
{ PictureBox1 PictureBox
MoveScaled(40,1,8,8)
Picture = Picture["WifiQR-icono.png"]
Stretch = True
}
{ OjoVerClave PictureBox
MoveScaled(43,9,5,5)
Enabled = False
Picture = Picture["icon:/32/watch"]
}
{ botonClaveRoot Button
MoveScaled(2,9,4,4)
Picture = Picture["icon:/22/unlock"]
}
{ botonGrabarQR Button
MoveScaled(42,55,5,4)
Enabled = False
Picture = Picture["icon:/22/save"]
}
}

View file

@ -0,0 +1,18 @@
' Gambas class file
Public Sub Form_Open()
'Situar dentro de FMain
Me.X = FMain.X + 20
Me.Y = FMain.Y + 40
End
Public Sub botonAbandonar_Click()
' No sabe clave o quiere salir
Quit
End
Public Sub botonAceptar_Click()
FMain.RootPassword = txtRootPassword.Text
Me.Close
End

View file

@ -0,0 +1,18 @@
' Gambas class file
Public Sub Form_Open()
'Situar dentro de FMain
Me.X = FMain.X + 20
Me.Y = FMain.Y + 20
End
Public Sub botonAbandonar_Click()
' No sabe clave o quiere salir
Quit
End
Public Sub botonAceptar_Click()
FMain.RootPassword = txtRootPassword.Text
Me.Close
End

26
.src/frmRootPassword.form Normal file
View file

@ -0,0 +1,26 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,41,15)
Text = ("Necesario usar clave de 'root'")
Icon = Picture["WifiQR-icono.png"]
Resizable = False
{ txtRootPassword TextBox
MoveScaled(1,5,39,4)
Password = True
}
{ Label1 Label
MoveScaled(1,1,24,4)
Text = ("Contraseña de 'root'")
}
{ botonAceptar Button
MoveScaled(24,10,16,4)
Text = ("Aceptar")
Picture = Picture["icon:/22/unlock"]
}
{ botonAbandonar Button
MoveScaled(7,10,16,4)
Text = (" Salir")
Picture = Picture["icon:/22/quit"]
}
}

View file

@ -0,0 +1,20 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,41,15)
Text = ("Necesario usar clave de 'root'")
Icon = Picture["WifiQR-icono.png"]
Resizable = False
{ txtRootPassword TextBox
MoveScaled(1,5,39,4)
Password = True
}
{ Label1 Label
MoveScaled(1,1,24,4)
Text = ("Contraseña de 'root'")
}
{ botonAceptar Button
MoveScaled(24,10,16,4)
Text = ("Aceptar")
}
}

10
.startup Normal file
View file

@ -0,0 +1,10 @@
FMain
WIFI & QR
0
0
1.0.5
gb.image
gb.gui
gb.form

0
README.md Normal file
View file

BIN
WifiQR-icono.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
WifiQR.gambas Executable file

Binary file not shown.

BIN
WifiQR_Ejemplo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B