Documentation ¶
Index ¶
- Constants
- Variables
- func CheckDir(dir, name string)
- func Combine(a, b map[string]Unit) map[string]Unit
- func Dedup(a []string) []string
- func GetJSON(url string, target interface{}) error
- func LoadCfg(cfgFile string, requester int) error
- func StrMap(args ...string) map[string]Unit
- func UniqAppend(a []string, b []string) []string
- func WriteDEAN(w io.Writer, data interface{}) error
- func WriteJSON(w io.Writer, data interface{}) error
- type APIServCfg
- type APKDownloadDirectory
- type AnalyzerCfg
- type App
- type Config
- type DBCfg
- type DBCreds
- type GeoIPInfo
- type Permission
- type StorageConfig
- type SystemConfig
- type Unit
Constants ¶
const ( Analyzer = iota APIServ )
Enum used when loading the config in LoadCfg
const ( EMERG int = iota ALERT CRIT ERR WARNING NOTICE INFO DEBUG )
Debug levels corresponding to the syslog levels
Variables ¶
var Log = logger{}
Log is the namespace for the logger functions
Functions ¶
func LoadCfg ¶
LoadCfg Opens a config file and creates a series of objects using the information located in the file. It constructs a Config, populating information for the Analyser Config, API Server Config and the DB config.
func UniqAppend ¶
UniqAppend takes the contents of one array and adds any content not present in another array.
Types ¶
type APIServCfg ¶
type APIServCfg struct {
DB DBCreds `json:"db"`
}
APIServCfg Represents the Credentials used to connect to the DB as the API Server
type APKDownloadDirectory ¶
APKDownloadDirectory represents a possible location an APK could be stored on.
type AnalyzerCfg ¶
type AnalyzerCfg struct {
DB DBCreds `json:"db"`
}
AnalyzerCfg Represents the Credentials used to connect to the DB as the Analyser
type App ¶
type App struct { DBID int64 ID, Store, Region, Ver string Path, UnpackDir string Perms []Permission Hosts []string Packages []string Icon string UsesReflect bool APKLocationUUID string APKLocationPath string APKLocationRoot string Manifest string HasFacebook bool HasFirebase bool HasGAds bool }
App Struct for holding of information extracted from the APK
func NewApp ¶
func NewApp(dbID int64, id, store, region, ver, apkLocationPath, apkLocationRoot, apkLocationUUID string) *App
NewApp Constructs a new app. initialising values based on the parameters passed.
func (*App) ApkPath ¶
ApkPath will try and find the APK on any mounted disks in potential locations starting with the location specified in the DB, falling down to checking locations with the root of the path specidied in the DB substituted, follewed by checking each location in the config forming a path from the app version details.
type Config ¶
type Config struct { GeoIPEndpoint string `json:"geoipurl"` StorageConfig StorageConfig `json:"storage_config"` SystemConfig SystemConfig `json:"system_config"` Analyzer AnalyzerCfg `json:"analyzer"` APIServ APIServCfg `json:"apiserv"` DB DBCfg `json:"db"` }
Config Struct for the Xray Config information relating to Dir and file locations. As well as holding DB, Analyser and APIServ Config information.
var Cfg Config
Cfg is an instance of Config that will contain DB settings as well as Dir/file locations and information.
type DBCfg ¶
type DBCfg struct { Database string `json:"database"` User string `json:"-"` Password string `json:"-"` Host string `json:"host"` Port int `json:"port"` }
DBCfg Struct for the Database Config File information
type GeoIPInfo ¶
type GeoIPInfo struct { IP string `json:"ip"` CountryCode string `json:"country_code"` CountryName string `json:"country_name"` RegionCode string `json:"region_code"` RegionName string `json:"region_name"` City string `json:"city"` ZipCode string `json:"zip_code"` TimeZone string `json:"time_zone"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` MetroCode int `json:"metro_code"` }
GeoIPInfo stores apphosts data for geolocation
func GetHostGeoIP ¶
GetHostGeoIP grabs geo location information from hostname
type Permission ¶
Permission Struct represents the permission information found in an APK
type StorageConfig ¶
type StorageConfig struct { APKDownloadDirectories []APKDownloadDirectory `json:"apk_download_directories"` APKUnpackDirectory string `json:"apk_unpack_directory"` MinimumGBRequired string `json:"minimum_gb_required"` }
StorageConfig holds the config data related to where APK data may be stored.
type SystemConfig ¶
type SystemConfig struct { VMName string `json:"vm_name"` DownloaderCredentials string `json:"downloader_credentials"` }
SystemConfig represents the config info related to the system the program is running on.