private void GetAppComplete(string result) { Debug.Log(result); string version = null; InstalledApps apps = JsonUtil.Deserialize <InstalledApps>(result); for (int i = 0; i < apps.InstalledPackages.Count; i++) { InstalledApp app = apps.InstalledPackages[i]; if (app.Name == SpectatorViewAppName) { appInfo = new SpectatorViewAppInfo(); byte[] bytes = Encoding.GetEncoding("utf-8").GetBytes(app.PackageRelativeId); appInfo.appid = System.Convert.ToBase64String(bytes); bytes = Encoding.GetEncoding("utf-8").GetBytes(app.PackageFullName); appInfo.package = System.Convert.ToBase64String(bytes); version = "" + app.Version.Major + "." + app.Version.Minor + "." + app.Version.Build + "." + app.Version.Revision; break; } } panel.hololensStatusPanel.ShowAppStatus(version); if (version != null) { StartCoroutine(GetAppRunningStatus()); } }
public List <InstalledApps> GetInstalledApp() { List <InstalledApps> installedApps = new List <InstalledApps>(); try { var apps = Android.App.Application.Context.PackageManager.GetInstalledApplications(PackageInfoFlags.MetaData); if (apps != null) { if (apps.Count > 0) { for (int i = 0; i < apps.Count; i++) { var info = Android.App.Application.Context.PackageManager.GetPackageInfo(apps[i].PackageName, 0); if (IsSystemPackage(info) == false) { InstalledApps installapps = new InstalledApps() { AppName = apps[i].LoadLabel(Android.App.Application.Context.PackageManager), PackageName = apps[i].PackageName, Icon = apps[i].LoadIcon(Android.App.Application.Context.PackageManager).ToString() }; installedApps.Add(installapps); } } return(installedApps); } } return(installedApps); } catch (Exception) { throw; } }
void PrintInstalledApps() { try { Beaprint.MainPrint("Installed Applications --Via Program Files/Uninstall registry--"); Beaprint.LinkPrint("https://book.hacktricks.xyz/windows/windows-local-privilege-escalation#software", "Check if you can modify installed software"); SortedDictionary <string, Dictionary <string, string> > installedAppsPerms = InstalledApps.GetInstalledAppsPerms(); string format = " ==> {0} ({1})"; foreach (KeyValuePair <string, Dictionary <string, string> > app in installedAppsPerms) { if (string.IsNullOrEmpty(app.Value.ToString())) //If empty, nothing found, is good { Beaprint.GoodPrint(app.Key); } else //Then, we need to look deeper { //Checkeamos si la carpeta (que va a existir como subvalor dentro de si misma) debe ser good if (string.IsNullOrEmpty(app.Value[app.Key])) { Beaprint.GoodPrint(" " + app.Key); } else { Beaprint.BadPrint(string.Format(" {0}({1})", app.Key, app.Value[app.Key])); app.Value[app.Key] = ""; //So no reprinted later } //Check the rest of the values to see if we have something to print in red (permissions) foreach (KeyValuePair <string, string> subfolder in app.Value) { if (!string.IsNullOrEmpty(subfolder.Value)) { Beaprint.BadPrint(string.Format(format, subfolder.Key, subfolder.Value)); } } } } Console.WriteLine(); } catch (Exception e) { Beaprint.PrintException(e.Message); } }
public void method_4() { foreach (Control control in this.panel1.Controls) { control.Dispose(); } this.panel1.Controls.Clear(); InstalledApps apps = new InstalledApps { TopLevel = false, FormBorderStyle = FormBorderStyle.None, Visible = true }; this.panel1.Controls.Add(apps); }
public void method_4() { foreach (Control control in this.panel1.Controls) { control.Dispose(); } this.panel1.Controls.Clear(); InstalledApps installedApps = new InstalledApps(); installedApps.TopLevel = false; installedApps.FormBorderStyle = FormBorderStyle.None; installedApps.Visible = true; this.panel1.Controls.Add(installedApps); }