Documentation ¶
Index ¶
- func AddHosts(app *util.App, hosts []string) error
- func AddPackages(app *util.App) error
- func AddPerms(app *util.App) error
- func GetAppHostIDs() ([]int64, error)
- func GetManualAltApps(appID string) ([]string, error)
- func HasAppVersionID(appID int64) bool
- func HasCompanyAppAssociation(appID int64, companyName string) bool
- func HasCompanyName(companyName string) bool
- func IncrementCompanyAppAssociationCount(appID int64, companyName string) error
- func InsertCompanyAppAssociation(appID int64, companyName string) error
- func InsertCompanyName(companyName string) error
- func Open(cfg util.Config, enable bool) error
- func SelectCompanyNames() ([]string, error)
- func SetAnalyzed(id int64) error
- func SetIcon(id int64, icon string) error
- func SetLastAnalyzeAttempt(id int64) error
- func SetManifest(id int64, manifest string) error
- func SetReflect(id int64, val bool) error
- func UnsetDownloaded(id int64) error
- type APIRequestError
- type AltApp
- type App
- type AppAssociations
- type AppHostRecord
- type AppStub
- type AppVersion
- type AssociatedCompany
- type Company
- type CompanyAssociations
- type CompanyCoverage
- type CompanyGenreCoverage
- type CompanyNames
- type CompanyTypeCoverage
- type Developer
- type GenreStats
- type PlayStoreInfo
- type Range
- type StoreInfo
- type TrackerMapperCompany
- type TrackerMapperRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHosts ¶
AddHosts is a function that allows you to add hosts to the Xray DB. The argument app must contain a DB ID.
func AddPackages ¶
AddPackages is a function that allows you to add packages to the Xray DB. The argument app must contain a DB ID and an array of package names.
func AddPerms ¶
AddPerms is a function that allows you to add permissions to the Xray DB. The argument app must contain a DB ID and an array of permissions.
func GetAppHostIDs ¶
GetAppHostIDs returns an array of app_version ids found in app_hosts.
func GetManualAltApps ¶
GetManualAltApps - Returns app ids that are logged as alternatives to the one given.
func HasAppVersionID ¶
HasAppVersionID Checks if app_versions table has the provided appversionId
func HasCompanyAppAssociation ¶
HasCompanyAppAssociation checks if an association between a given app and company name already exists.
func HasCompanyName ¶
HasCompanyName Checks if companyNames table has the provided company name
func IncrementCompanyAppAssociationCount ¶
IncrementCompanyAppAssociationCount increments the counter on the associated app and company
func InsertCompanyAppAssociation ¶
InsertCompanyAppAssociation inserts an app and company name association into the database.
func InsertCompanyName ¶
InsertCompanyName inserts the provided company name into the database.
func Open ¶
Open opens the database with the given config. If enable is false, the functions that modify the database are noops.
func SelectCompanyNames ¶
SelectCompanyNames returns an array of company names found in the DB.
func SetLastAnalyzeAttempt ¶
SetLastAnalyzeAttempt sets the last_analyzed_attempt of an app to the current time.
func SetManifest ¶
SetManifest is a function that sets the manifest field of the DB.
func SetReflect ¶
SetReflect sets the value of uses_reflect for an app version
func UnsetDownloaded ¶
UnsetDownloaded sets an downloaded=False for given app.
Types ¶
type APIRequestError ¶
type APIRequestError struct { ErrorType string `json:"ErrorType"` ErrorMessage string `json:"ErrorMsg"` APIRequest string `json:"APIRequest"` }
APIRequestError holds Error information sent via the API should na endpoint fail.
type AltApp ¶
type AltApp struct { AltAppTitle string `json:"altAppTitle"` AltToURL string `json:"altToURL"` GPlayURL string `json:"gPlayURL"` GPlayID string `json:"gPlayID"` IconURL string `json:"iconURL"` OfficialSiteURL string `json:"officialSiteURL"` IsScraped bool `json:"isScraped"` }
AltApp represents Alternative App title and playstore url. Used in API
func GetAltApps ¶
GetAltApps takes an app's DB ID and returns a collection of alternative apps for the specified app - For the API
type App ¶
App represents an app from the database
type AppAssociations ¶
type AppAssociations struct { AppVersionID int64 `json:"appVersionID"` AssociatedCompanies []AssociatedCompany `json:"associatedCompanies"` }
AppAssociations holds the result of a query to the DB for all company names with an app association.
func GetAppVersionAssociations ¶
func GetAppVersionAssociations(appID int64) (AppAssociations, error)
GetAppVersionAssociations returns an AppAssociations object containing an array of Company names and the number of times they are associated with this company.
type AppHostRecord ¶
AppHostRecord holds app_host data from the xray DB
func GetAppHostsByID ¶
func GetAppHostsByID(id int64) (AppHostRecord, error)
GetAppHostsByID selects an app host record from the DB using the provided ID
type AppStub ¶
AppStub represents the 'stub' of app data located in the Database. it is formed of only the title given to the app by the developer and the App ID that it can be uniquely identified as.
type AppVersion ¶
type AppVersion struct { ID int64 `json:"id"` App string `json:"app"` Store string `json:"string"` Region string `json:"region"` Ver string `json:"ver"` ScreenFlags int64 `json:"screenFlags"` StoreInfo StoreInfo `json:"storeinfo"` Icon string `json:"icon"` Dev Developer `json:"developer"` Hosts []string `json:"hosts"` Perms []string `json:"perms"` Packages []string `json:"packages"` IsAnalyzed bool `json:"isAnalyzed"` APKLocationUUID string `json:"apkLocationUUID"` APKLocationPath string `json:"apkLocationPath"` APKLocationRoot string `json:"apkLocationRoot"` }
AppVersion represents all the information about an app version contained in the database
func GetAppVersion ¶
func GetAppVersion(app, store, region, version string) (AppVersion, error)
GetAppVersion gets an app version from the database. The argument app is the app id, in the form com.example.app.
func GetAppVersionByID ¶
func GetAppVersionByID(id int64) (AppVersion, error)
GetAppVersionByID gets an app version given its ID in the database.
func GetAppsToAnalyze ¶
func GetAppsToAnalyze(limit int64) ([]AppVersion, error)
GetAppsToAnalyze returns a list of up to `limit` apps that have analyzed=False and downloaded=True for the analyzer.
func QueryAll ¶
func QueryAll( onlyAnalyzed bool, appStore string, limit string, offset string, developers []string, genres []string, permissions []string, appIDs []string, titles []string, startsWith []string, ) ([]AppVersion, error)
QueryAll depricates all of dean's queries.
func (AppVersion) UtilApp ¶
func (a AppVersion) UtilApp() *util.App
UtilApp creates a *util.App from an AppVersion
type AssociatedCompany ¶
type AssociatedCompany struct { CompanyName string `json:"companyName"` NumberOfAssociations int64 `json:"numberOfAssociations"` }
AssociatedCompany holds the name of a company and the number of associations that it has.
type Company ¶
type Company struct { ID string `json:"id"` Name string `json:"name"` Hosts []string `json:"nosts"` Founded string `json:"founded"` Acquired string `json:"acquired"` Type []string `json:"type"` TypeTag string `json:"typeTag"` Jurisdiction string `json:"jurisdiction"` Parent string `json:"parent"` Capital string `json:"capital"` Equity string `json:"equity"` Size Range `json:"size"` DataSources []string `json:"dataSources"` Description []string `json:"description"` }
Company represents a company from the database
func GetCompanies ¶
GetCompanies returns a list of companies.
func GetCompany ¶
GetCompany returns a company given its ID in the database.
type CompanyAssociations ¶
type CompanyAssociations struct { CompanyName string `json:"companyName"` AssociatedAppIDs []int64 `json:"associatedAppIDs"` AssociatedIoTDeviceIDs []int64 `json:"associatedIoTDeviceIDs"` AssociatedWebsiteIDs []int64 `json:"associatedWebsiteIDs"` }
CompanyAssociations holds a record of from the DB describing the associations between a single company and various apps/devices/websites.
func GetCompanyAssocations ¶
func GetCompanyAssocations(companyName string) (CompanyAssociations, error)
GetCompanyAssocations fetches the associations logged between a company and apps/websits/devices.
type CompanyCoverage ¶
type CompanyCoverage struct { Company string `json:"company"` Type string `json:"type"` AppCount int64 `json:"appCount"` TotalApps int64 `json:"totalApps"` CompanyFreq float64 `json:"companyFreq"` }
CompanyCoverage represents a row from the company_app_coverage statistics table found in the XRay DB.
func GetAppCompanyFreq ¶
func GetAppCompanyFreq() ([]CompanyCoverage, error)
GetAppCompanyFreq Queries the DB for global company stats. a generalised get Stat Freq table method should be created where the name of a freq table is specified. the tables would take a standardised format.
type CompanyGenreCoverage ¶
type CompanyGenreCoverage struct { Company string `json:"company"` CompanyCount int64 `json:"companyCount"` Genre string `json:"genre"` GenreTotal int64 `json:"genreTotal"` CoveragePct float64 `json:"companyPct"` }
CompanyGenreCoverage Stats for company Genre Coverage.
func GetCompanyGenreCoverage ¶
func GetCompanyGenreCoverage() ([]CompanyGenreCoverage, error)
GetCompanyGenreCoverage queries DB for stats.
type CompanyNames ¶
type CompanyNames struct {
CompanyNames []string `json:"companyNames"`
}
CompanyNames represents the json structure used to send company names selected from the DB via the rest API.
type CompanyTypeCoverage ¶
type CompanyTypeCoverage struct { Type string `json:"type"` AppCount int64 `json:"appCount"` TotalApps int64 `json:"totalApps"` TypeFreq float64 `json:"typeFreq"` }
CompanyTypeCoverage represents a row from the app_type_coverage statistics table found in the XRay DB
func GetAppTypeFreq ¶
func GetAppTypeFreq() ([]CompanyTypeCoverage, error)
GetAppTypeFreq Querys the DB for rows in the app_types_coverage stats table
type Developer ¶
type Developer struct { Emails []string `json:"emails"` Name string `json:"name"` StoreSite string `json:"storeSite"` Site string `json:"site"` }
Developer represents a developer from the database
func GetDeveloper ¶
GetDeveloper gets a developer given its ID in the database.
func GetDevelopers ¶
GetDevelopers returns a list of developers.
type GenreStats ¶
type GenreStats struct { Category string `json:"category"` HostCount int64 `json:"hostCount"` AppCount int64 `json:"appCount"` GenreAvg float64 `json:"genreAvg"` }
GenreStats represents a row from the Genre average statistics table
func GetGenreHostAverages ¶
func GetGenreHostAverages() ([]GenreStats, error)
GetGenreHostAverages Queries DB for Genre averages stats view.
type PlayStoreInfo ¶
type PlayStoreInfo struct { Title string `json:"title"` Summary string `json:"summary"` //TODO:Omitempty for null vlaues? Description string `json:"description"` StoreURL string `json:"storeURL"` Price string `json:"price"` Free bool `json:"free"` Rating string `json:"rating"` NumReviews int64 `json:"numReviews"` Genre string `json:"genre"` FamilyGenre string `json:"familyGenre"` Installs Range `json:"installs"` Developer int64 `json:"developer"` Updated time.Time `json:"updated"` AndroidVer string `json:"androidVer"` ContentRating string `json:"contentRating"` Screenshots []string `json:"screenshots"` Video string `json:"video"` RecentChanges []string `json:"recentChanges"` CrawlDate time.Time `json:"crawlDate"` Permissions []string `json:"permissions"` }
PlayStoreInfo represents the data contained in the google play store
type StoreInfo ¶
type StoreInfo interface{}
StoreInfo represents the information contained about an app in its respective store
type TrackerMapperCompany ¶
type TrackerMapperCompany struct { HostName string `json:"hostName"` HostID int64 `json:"hostID"` CompanyName string `json:"companyName"` CompanyID int64 `json:"companyID"` Locale string `json:"locale"` Categories []string `json:"categories"` }
TrackerMapperCompany holds the data requested from the OxfordHCC TrackerMapper API.
type TrackerMapperRequest ¶
type TrackerMapperRequest struct {
HostNames []string `json:"host_names"`
}
TrackerMapperRequest holds the data used in requests to the OxfordHCC TrackerMapper API.