LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ApplicationInstaller Class Reference

#include <ApplicationInstaller.h>

Inheritance diagram for ApplicationInstaller:
[legend]
Collaboration diagram for ApplicationInstaller:
[legend]

Public Member Functions

bool install (const std::string &targetPackageName, unsigned int uncompressedAppSizeInKB, const unsigned long ticket)
 
void notifyAppInstalled (const std::string &appId, const std::string &appVersion)
 
bool downloadAndInstall (LSHandle *handle, const std::string &targetPackageFile, struct json_object *authToken, struct json_object *deviceId, unsigned long ticket, bool subscribe)
 
void oneCommandProcessed ()
 
void notifyAppRemoved (const std::string &appId, const std::string &appVersion, int cause=APPREMOVED_CAUSE_UNKNOWN)
 
bool allowSuspend ()
 
json_object * packageInfoFileToJson (const std::string &packageId)
 

Static Public Member Functions

static ApplicationInstallerinstance ()
 
static bool cbInstallProgressQuery (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbInstall (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbInstallNoVerify (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbRemove (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static gboolean cbShallowRemove (gpointer param)
 
static bool cbIsInstalled (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbNotifyOnChange (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbGetSizes (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbQueryInstallCapacity (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbDetermineInstallSpaceNeeded (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbRevoke (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbPubSubRegister (LSHandle *handle, LSMessage *message, void *ctxt)
 
static bool cbPubSubStatus (LSHandle *handle, LSMessage *msg, void *ctxt)
 
static bool cbDbgGetPkgInfoFromStatusFile (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbDbgCopyDir (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbDbgFakeFsSize (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbDbgUnFakeFsSizes (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbGetFsSize (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbDbgFillSize (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static bool cbDbgGetAppSizeOnFs (LSHandle *lshandle, LSMessage *msg, void *user_data)
 
static uint64_t getSizeOfAppDir (const std::string &dirName)
 
static int _getSizeCbFn (const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf)
 
static int _getSizeOfAppCbFn (const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf)
 
static uint64_t getSizeOfAppOnFs (const std::string &destFsPath, const std::string &dirName, uint32_t *r_pBsize=NULL)
 
static uint64_t getSizeOfPackageOnFsGenerateManifest (const std::string &destFsPath, PackageDescription *packageDesc, uint32_t *r_pBsize)
 
static uint64_t getSizeOfPackageById (const std::string &packageId)
 
static uint64_t getFsFreeSpaceInMB (const std::string &pathOnFs)
 
static uint64_t getFsFreeSpaceInBlocks (const std::string &pathOnFs, uint64_t *pBlockSize=0)
 
static bool extractVersionFromAppInfo (const std::string &appBaseDir, std::string &r_versionString)
 
static bool getDownloadPathBasedOnSpaceRemaining (std::string &packageDownloadPath)
 
static bool isValidInstallURI (const std::string &url)
 

Static Public Attributes

static std::string s_installer_version = "1.0.0"
 
static Mutex s_sizeFnMutex
 
static uint64_t s_sizeFnAccumulator = 0
 
static uint64_t s_auxSizeFnAccumulator = 0
 
static uint64_t s_targetFsBlockSize = 0
 
static std::string s_sizeFnBaseDir
 
static json_object * s_manifestJobj = 0
 

Member Function Documentation

int ApplicationInstaller::_getSizeCbFn ( const char *  fpath,
const struct stat *  sb,
int  typeflag,
struct FTW *  ftwbuf 
)
static
int ApplicationInstaller::_getSizeOfAppCbFn ( const char *  fpath,
const struct stat *  sb,
int  typeflag,
struct FTW *  ftwbuf 
)
static
bool ApplicationInstaller::allowSuspend ( )
static bool ApplicationInstaller::cbDbgCopyDir ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbDbgFakeFsSize ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbDbgFillSize ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbDbgGetAppSizeOnFs ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbDbgGetPkgInfoFromStatusFile ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbDbgUnFakeFsSizes ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
static bool ApplicationInstaller::cbDetermineInstallSpaceNeeded ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbGetFsSize ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbGetSizes ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbInstall ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbInstallNoVerify ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static

Nearly identical to cbInstall, but will pass in a parameter to cbInstall_detached that will disable package verification.

The reason why this is a completely separate function is that it seems the current lunabus security mechanism cannot disallow only parameters to functions, but whole functions only. Therefore a separate function for "no verify" exists so it can be locked down

bool ApplicationInstaller::cbInstallProgressQuery ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbIsInstalled ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbNotifyOnChange ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbPubSubRegister ( LSHandle *  handle,
LSMessage *  message,
void *  ctxt 
)
static
bool ApplicationInstaller::cbPubSubStatus ( LSHandle *  handle,
LSMessage *  msg,
void *  ctxt 
)
static
bool ApplicationInstaller::cbQueryInstallCapacity ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbRemove ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
bool ApplicationInstaller::cbRevoke ( LSHandle *  lshandle,
LSMessage *  msg,
void *  user_data 
)
static
gboolean ApplicationInstaller::cbShallowRemove ( gpointer  param)
static
bool ApplicationInstaller::downloadAndInstall ( LSHandle *  handle,
const std::string &  targetPackageFile,
struct json_object *  authToken,
struct json_object *  deviceId,
unsigned long  ticket,
bool  subscribe 
)
bool ApplicationInstaller::extractVersionFromAppInfo ( const std::string &  appBaseDir,
std::string &  r_versionString 
)
static
static bool ApplicationInstaller::getDownloadPathBasedOnSpaceRemaining ( std::string &  packageDownloadPath)
static
uint64_t ApplicationInstaller::getFsFreeSpaceInBlocks ( const std::string &  pathOnFs,
uint64_t *  pBlockSize = 0 
)
static
uint64_t ApplicationInstaller::getFsFreeSpaceInMB ( const std::string &  pathOnFs)
static
uint64_t ApplicationInstaller::getSizeOfAppDir ( const std::string &  dirName)
static
uint64_t ApplicationInstaller::getSizeOfAppOnFs ( const std::string &  destFsPath,
const std::string &  dirName,
uint32_t *  r_pBsize = NULL 
)
static
uint64_t ApplicationInstaller::getSizeOfPackageById ( const std::string &  packageId)
static
uint64_t ApplicationInstaller::getSizeOfPackageOnFsGenerateManifest ( const std::string &  destFsPath,
PackageDescription packageDesc,
uint32_t *  r_pBsize 
)
static
bool ApplicationInstaller::install ( const std::string &  targetPackageName,
unsigned int  uncompressedAppSizeInKB,
const unsigned long  ticket 
)
ApplicationInstaller * ApplicationInstaller::instance ( void  )
static
bool ApplicationInstaller::isValidInstallURI ( const std::string &  url)
static

Check for valid URI and ipk

void ApplicationInstaller::notifyAppInstalled ( const std::string &  appId,
const std::string &  appVersion 
)
void ApplicationInstaller::notifyAppRemoved ( const std::string &  appId,
const std::string &  appVersion,
int  cause = APPREMOVED_CAUSE_UNKNOWN 
)
void ApplicationInstaller::oneCommandProcessed ( )
json_object * ApplicationInstaller::packageInfoFileToJson ( const std::string &  packageId)

Member Data Documentation

uint64_t ApplicationInstaller::s_auxSizeFnAccumulator = 0
static
std::string ApplicationInstaller::s_installer_version = "1.0.0"
static
json_object * ApplicationInstaller::s_manifestJobj = 0
static
uint64_t ApplicationInstaller::s_sizeFnAccumulator = 0
static
std::string ApplicationInstaller::s_sizeFnBaseDir
static
Mutex ApplicationInstaller::s_sizeFnMutex
static
uint64_t ApplicationInstaller::s_targetFsBlockSize = 0
static

The documentation for this class was generated from the following files: