/// <summary> /// Kills the target application on the target device. /// </summary> /// <param name="packageFamilyName"></param> /// <param name="targetDevice"></param> /// <param name="showDialog"></param> /// <returns>true, if application was successfully stopped.</returns> public static bool KillApp(string packageFamilyName, ConnectInfo targetDevice, bool showDialog = true) { AppDetails appDetails = QueryAppDetails(packageFamilyName, targetDevice); if (appDetails == null) { Debug.LogError("Application not found"); return(false); } string query = string.Format("{0}?package={1}", string.Format(API_AppQuery, FinalizeUrl(targetDevice.IP)), WWW.EscapeURL(EncodeTo64(appDetails.PackageFullName))); bool success = WebRequestDelete(query, GetBasicAuthHeader(targetDevice), showDialog); MachineName targetMachine = GetMachineName(targetDevice); if (success) { Debug.LogFormat("Successfully stopped {0} on {1}.", packageFamilyName, targetMachine.ComputerName); } return(success); }
/// <summary> /// Downloads and launches the Log file for the target application on the target device. /// </summary> /// <param name="packageFamilyName"></param> /// <param name="targetDevice"></param> /// <returns>True, if download success.</returns> public static bool DeviceLogFile_View(string packageFamilyName, ConnectInfo targetDevice) { EditorUtility.DisplayProgressBar("Download Log", "Downloading Log File for " + packageFamilyName, 0.25f); AppDetails appDetails = QueryAppDetails(packageFamilyName, targetDevice); if (appDetails == null) { Debug.LogWarningFormat("{0} not installed on target device", packageFamilyName); EditorUtility.ClearProgressBar(); return(false); } string logFile = string.Format("{0}/{1}_{2}{3}{4}{5}{6}{7}_deviceLog.txt", Application.temporaryCachePath, targetDevice.MachineName, DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); string response = WebRequestGet(string.Format(API_FileQuery, FinalizeUrl(targetDevice.IP), appDetails.PackageFullName), GetBasicAuthHeader(targetDevice, true)); bool success = !string.IsNullOrEmpty(response); if (success) { File.WriteAllText(logFile, response); Process.Start(logFile); } EditorUtility.ClearProgressBar(); return(success); }
/// <summary> /// Method to Return partial view to create token /// </summary> /// <returns>partial view for create token</returns> public ActionResult GenerateNewToken() { AppDetails model = new AppDetails(); return(PartialView(model)); }
/// <summary> /// Requests app information for a single app. Use the overload for requesting information on a batch of apps. /// Results are returned in a <see cref="AppInfoCallback"/> callback. /// </summary> /// <param name="app">The app to request information for.</param> /// <param name="supportsBatches">if set to <c>true</c>, the request supports batches.</param> /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="SteamClient.JobCallback<T>"/>.</returns> public JobID GetAppInfo( AppDetails app, bool supportsBatches = false ) { return GetAppInfo( new AppDetails[] { app }, supportsBatches ); }
/// <summary> /// Requests app information for a single app. Use the overload for requesting information on a batch of apps. /// Results are returned in a <see cref="AppInfoCallback"/> callback. /// </summary> /// <param name="app">The app to request information for.</param> /// <param name="supportsBatches">if set to <c>true</c>, the request supports batches.</param> /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="SteamClient.JobCallback<T>"/>.</returns> public JobID GetAppInfo(AppDetails app, bool supportsBatches = false) { return(GetAppInfo(new AppDetails[] { app }, supportsBatches)); }
/// <summary> /// Updates app details for this edit. This method supports patch semantics. /// Documentation https://developers.google.com/androidpublisher/v2/reference/details/patch /// Generation Note: This does not always build corectly. Google needs to standardise things I need to figuer out which ones are wrong. /// </summary> /// <param name="service">Authenticated AndroidPublisher service.</param> /// <param name="packageName">Unique identifier for the Android app that is being updated; for example, "com.spiffygame".</param> /// <param name="editId">Unique identifier for this edit.</param> /// <param name="body">A valid AndroidPublisher v2 body.</param> /// <returns>AppDetailsResponse</returns> public static AppDetails Patch(AndroidPublisherService service, string packageName, string editId, AppDetails body) { try { // Initial validation. if (service == null) { throw new ArgumentNullException("service"); } if (body == null) { throw new ArgumentNullException("body"); } if (packageName == null) { throw new ArgumentNullException(packageName); } if (editId == null) { throw new ArgumentNullException(editId); } // Make the request. return(service.Details.Patch(body, packageName, editId).Execute()); } catch (Exception ex) { throw new Exception("Request Details.Patch failed.", ex); } }
private bool HaveUniqueFolder(AppDetails cmd, string folder) { return(_appRules.IsAppFolderUnique(folder, cmd.Id)); }
/// <summary> /// News the application_ add new relationship implementation. /// </summary> /// <param name="cardinality">The cardinality.</param> /// <param name="cascadeDelete">if set to <c>true</c> [cascade delete].</param> /// <param name="cascadeDeleteTo">if set to <c>true</c> [cascade delete to].</param> /// <param name="implicitInSolution">if set to <c>true</c> [implicit in solution].</param> /// <param name="reverseImplicitInSolution">if set to <c>true</c> [reverse implicit in solution].</param> public void NewApplication_AddNewRelationshipImpl(CardinalityEnum_Enumeration cardinality, bool cascadeDelete, bool cascadeDeleteTo, bool implicitInSolution, bool reverseImplicitInSolution) { var application = TestMigrationHelper.CreateAppLibraryApplication( ); application.SetCardinality(cardinality); DataTable appDataBit = application.Data.Tables[TableNames.AppDataBit]; AppDetails.CreateAppDataRow(appDataBit, application.AppVerUid, application.RelationshipUid, AppDetails.CascadeDeleteUid, cascadeDelete); AppDetails.CreateAppDataRow(appDataBit, application.AppVerUid, application.RelationshipUid, AppDetails.CascadeDeleteToUid, cascadeDeleteTo); AppDetails.CreateAppDataRow(appDataBit, application.AppVerUid, application.RelationshipUid, AppDetails.ImplicitInSolutionUid, implicitInSolution); AppDetails.CreateAppDataRow(appDataBit, application.AppVerUid, application.RelationshipUid, AppDetails.ReverseImplicitInSolutionUid, reverseImplicitInSolution); TestMigrationHelper.SaveAppLibraryApplication(application); AppManager.DeployApp(RunAsDefaultTenant.DefaultTenantName, application.SolutionUid.ToString("B")); long tenantId = RequestContext.TenantId; DatabaseContext context = DatabaseContext.GetContext( ); Assert.IsTrue(TenantMergeProcessorTestHelper.ConfirmTenantEntity(context, tenantId, application.FromTypeUid), "Type A was not deployed as part of an existing application."); Assert.IsTrue(TenantMergeProcessorTestHelper.ConfirmTenantEntity(context, tenantId, application.ToTypeUid), "Type B was not deployed as part of an existing application."); Assert.IsTrue(TenantMergeProcessorTestHelper.ConfirmTenantEntity(context, tenantId, application.RelationshipUid), "Relationship was not deployed as part of an existing application."); Assert.IsTrue(TenantMergeProcessorTestHelper.ConfirmTenantRelationship(context, tenantId, Direction.Forward, AppDetails.CardinalityUid, application.RelationshipUid, AppDetails.ConvertCardinalityEnumToUpgradeId(cardinality)), "Relationship cardinality was not deployed."); Assert.IsTrue(TenantMergeProcessorTestHelper.ConfirmTenantFieldValue(context, tenantId, DataTableType.Bit, application.RelationshipUid, AppDetails.CascadeDeleteUid, cascadeDelete), "Relationship cascadeDelete value was not deployed."); Assert.IsTrue(TenantMergeProcessorTestHelper.ConfirmTenantFieldValue(context, tenantId, DataTableType.Bit, application.RelationshipUid, AppDetails.CascadeDeleteToUid, cascadeDeleteTo), "Relationship cascadeDelete to value was not deployed."); Assert.IsTrue(TenantMergeProcessorTestHelper.ConfirmTenantFieldValue(context, tenantId, DataTableType.Bit, application.RelationshipUid, AppDetails.ImplicitInSolutionUid, implicitInSolution), "Relationship implicitInSolution value was not deployed."); Assert.IsTrue(TenantMergeProcessorTestHelper.ConfirmTenantFieldValue(context, tenantId, DataTableType.Bit, application.RelationshipUid, AppDetails.ReverseImplicitInSolutionUid, reverseImplicitInSolution), "Relationship reverseImplicitInSolution value was not deployed."); }
public YouTubeDataController(AppDetails appDetails) { _appDetails = appDetails; }
private bool HaveUniqueName(AppDetails cmd, string name) { return(_appRules.IsAppNameUnique(name, cmd.Id)); }
public YouTubeQueryMain(AppDetails appDetails) { _appDetails = appDetails; }
public HomeController(AppDetails appDetails) { _appDetails = appDetails; }
public AsyncJob <AppInfoCallback> GetAppInfo(AppDetails app, bool supportsBatches = false) { return(GetAppInfo(new AppDetails[] { app }, supportsBatches)); }
/// <summary> /// Requests app information for a single app. Use the overload for requesting information on a batch of apps. /// Results are returned in a <see cref="AppInfoCallback"/> callback. /// The returned <see cref="AsyncJob{T}"/> can also be awaited to retrieve the callback result. /// /// Consider using <see cref="o:SteamApps.PICSGetProductInfo"/> instead. /// </summary> /// <param name="app">The app to request information for.</param> /// <param name="supportsBatches">if set to <c>true</c>, the request supports batches.</param> /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="AppInfoCallback"/>.</returns> public AsyncJob<AppInfoCallback> GetAppInfo( AppDetails app, bool supportsBatches = false ) { return GetAppInfo( new AppDetails[] { app }, supportsBatches ); }
public async Task <IActionResult> GetPublishedAppDetails(string package) { // Get the play-listing/manifest.json artifact var manifestArtifact = await ProductService.GetPublishedAppDetails(package); if (manifestArtifact == null) { return(NotFound()); } // Get the size of the apk var apkArtifact = await ProductService.GetPublishedFile(manifestArtifact.ProductId, "apk"); if (apkArtifact == null) { return(NotFound()); } var updatedApkArtifact = WebRequestWrapper.GetFileInfo(apkArtifact); // Get the contents of the manifest.json var manifestJson = await WebClient.DownloadStringTaskAsync(manifestArtifact.Url); var manifest = JsonConvert.DeserializeObject <ManifestResponse>(manifestJson); var url = manifest.url; var titles = new Dictionary <string, string>(manifest.languages.Count); var descriptions = new Dictionary <string, string>(manifest.languages.Count); foreach (string language in manifest.languages) { var title = ""; var titleSearch = $"{language}/title.txt"; var titlePath = manifest.files.Where(s => s.Contains(titleSearch)).FirstOrDefault(); if (!string.IsNullOrEmpty(titlePath)) { title = await WebClient.DownloadStringTaskAsync(url + titlePath); } titles.Add(language, title.Trim()); var description = ""; var descriptionSearch = $"{language}/short_description.txt"; var descriptionPath = manifest.files.Where(s => s.Contains(descriptionSearch)).FirstOrDefault(); if (!string.IsNullOrEmpty(descriptionPath)) { description = await WebClient.DownloadStringTaskAsync(url + descriptionPath); } descriptions.Add(language, description); } var details = new AppDetails { Id = manifestArtifact.ProductId, Link = $"/api/products/{manifestArtifact.ProductId}/files/published/apk", Size = updatedApkArtifact.FileSize.Value, DefaultLanguage = manifest.defaultLanguage, Color = manifest.color, Icon = url + manifest.icon, Languages = manifest.languages, Titles = titles, Descriptions = descriptions, DownloadApkStrings = manifest.downloadApkStrings }; return(Ok(details)); }