bettercap: fix so that caplets can be installed correctly

This commit is contained in:
Henrik Grimler 2019-09-12 07:06:16 +02:00 committed by Yaksh Bariya
parent c1e7c2a10b
commit f7dca60f61
No known key found for this signature in database
GPG Key ID: F7486BA7D3D27581
3 changed files with 47 additions and 0 deletions

View File

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.bettercap.org
TERMUX_PKG_DESCRIPTION="The Swiss Army knife for 802.11, BLE and Ethernet networks reconnaissance and MITM attacks"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=2.24.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/bettercap/bettercap/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=590cef2b2b24fd9f67c57c8cb19ab8ff08b11d43bfc23b468013ddad907bb8b8
TERMUX_PKG_DEPENDS="libpcap, libusb"

View File

@ -0,0 +1,26 @@
diff --git a/caplets/env.go b/caplets/env.go
index 4c803b6..eccfe7e 100644
--- a/caplets/env.go
+++ b/caplets/env.go
@@ -11,7 +11,7 @@ const (
EnvVarName = "CAPSPATH"
Suffix = ".cap"
InstallArchive = "https://github.com/bettercap/caplets/archive/master.zip"
- InstallBase = "/usr/local/share/bettercap/"
+ InstallBase = "@TERMUX_PREFIX@/local/share/bettercap/"
)
var (
diff --git a/modules/ui/ui.go b/modules/ui/ui.go
index f5d6950..4059c6c 100644
--- a/modules/ui/ui.go
+++ b/modules/ui/ui.go
@@ -36,7 +36,7 @@ func NewUIModule(s *session.Session) *UIModule {
}
mod.AddParam(session.NewStringParameter("ui.basepath",
- "/usr/local/share/bettercap/",
+ "@TERMUX_PREFIX@/local/share/bettercap/",
"",
"UI base installation path."))

View File

@ -0,0 +1,20 @@
--- ../caplets.go.orig 2019-09-12 07:01:02.402741887 +0200
+++ ./modules/caplets/caplets.go 2019-09-12 07:01:26.121229567 +0200
@@ -120,7 +120,7 @@
}
}
- out, err := os.Create("/tmp/caplets.zip")
+ out, err := os.Create("@TERMUX_PREFIX@/tmp/caplets.zip")
if err != nil {
return err
}
@@ -140,7 +140,7 @@
mod.Info("installing caplets to %s ...", caplets.InstallPath)
- if _, err = zip.Unzip("/tmp/caplets.zip", caplets.InstallBase); err != nil {
+ if _, err = zip.Unzip("@TERMUX_PREFIX@/tmp/caplets.zip", caplets.InstallBase); err != nil {
return err
}