Beispiel #1
0
        public override Intent getLaunchIntentForPackage(string packageName)
        {
            if (!loaded_packages.ContainsKey(packageName))
            {
                return(null);
            }

            XobotPackageInfo info = loaded_packages [packageName];

            if (info.Info.applicationInfo == null)
            {
                throw new RuntimeException("Cannot get ApplicationInfo from package.");
            }
            if (info.Info.activities.Length < 1)
            {
                throw new RuntimeException("Package does not contain any Activity.");
            }

            ActivityInfo ai = info.Info.activities [0];

            ai.applicationInfo.uid = android.os.Process.SYSTEM_UID;

            Intent intent = new Intent(Intent.ACTION_MAIN);

            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.setPackage(packageName);
            intent.setClassName(info.Info.packageName, ai.name);

            return(intent);
        }
		internal PackageInfo LoadPackage (Assembly asm)
		{
			var path = asm.Location;

			int flags = GET_ACTIVITIES | GET_CONFIGURATIONS | GET_SERVICES;
			PackageInfo pkg = getPackageArchiveInfo (path, flags);
			if (pkg == null)
				throw new RuntimeException ("Failed to read package '{0}'", path);

			pkg.applicationInfo.sourceDir = path;

			XobotPackageInfo info = new XobotPackageInfo (asm, pkg);
			loaded_packages.Add (pkg.packageName, info);
			return pkg;
		}
Beispiel #3
0
        internal PackageInfo LoadPackage(Assembly asm)
        {
            var path = asm.Location;

            int         flags = GET_ACTIVITIES | GET_CONFIGURATIONS | GET_SERVICES;
            PackageInfo pkg   = getPackageArchiveInfo(path, flags);

            if (pkg == null)
            {
                throw new RuntimeException("Failed to read package '{0}'", path);
            }

            pkg.applicationInfo.sourceDir = path;

            XobotPackageInfo info = new XobotPackageInfo(asm, pkg);

            loaded_packages.Add(pkg.packageName, info);
            return(pkg);
        }