utils

package
v0.0.0-...-8c5d249 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnalysisBinPath string
View Source
var AnalysisDir string
View Source
var UnzippedAnalBinPath string

Functions

func CopyFile

func CopyFile(src, dst string) (err error)

func CreateAnalysisDir

func CreateAnalysisDir(targetAppPath string)

func Description

func Description() string

Description Dummy function to check scope

func ExactMatch

func ExactMatch(haystack string, needle string) []string

ExactMatch searches for a string in a string, returns matches

func FindFilesInDir

func FindFilesInDir(needles []string, haystack string) []string

func GetDroidManifest

func GetDroidManifest(abs string) map[string]string

GetDroidManifest parses the target binaries AndroidManifest.xml file

func GetDroidPermissions

func GetDroidPermissions()

func GetProjectRootDir

func GetProjectRootDir() string

GetProjectRootDir returns the project root dir of MobProtID

func GetRuleFiles

func GetRuleFiles(partialOrFullName string) []string

func GetWorkingDir

func GetWorkingDir() string

GetWorkingDir - More info on Getwd() https://golang.org/src/os/getwd.go

func IsCommandAvailable

func IsCommandAvailable(name string) bool

IsCommandAvailable checks if a command is exists in shell

func PrepBinaryForAnal

func PrepBinaryForAnal(path string)

func RegexMatch

func RegexMatch(haystack string, regularExp string) []string

RegexMatch searching a string using a regex, returns matches

func Retry

func Retry(attempts int, sleep time.Duration, f func() error) (err error)

Retry is used to retry functions that may fail outside of the app's control

func Unzip

func Unzip(src, dest string) error

Unzip takes a zip archive and unzips it to the dest

func WriteResultsToFile

func WriteResultsToFile(file string, data map[string][]model.RuleResult)

WriteResultsToFile writes parsed rule results to file for downstream consumption

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL