!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Microsoft-IIS/10.0. PHP/7.4.33 

uname -a: Windows NT LAKE 10.0 build 20348 (Windows Server 2016) AMD64 

IWPD_801(traduongco) 

Safe-mode: OFF (not secure)

C:\Windows\SystemApps\Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy\core\js\appLaunchers\   drwxrwxrwx
Free 20.92 GB of 99.4 GB (21.05%)
Detected drives: [ a ] [ c ] [ d ] [ e ]
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     OobeAutoPilot.js (15.9 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
//
// Copyright (C) Microsoft. All rights reserved.
//

define(['legacy/core'], (core) => {
    class OOBEAutoPilot {
        launchAsync(currentNode) {
            return new WinJS.Promise(async function (completeDispatch) {
                try {
                    const OS_DEFAULT = "os-default";
                    let autoPilot = new EnterpriseDeviceManagement.Service.AutoPilot.AutoPilotServer();
                    switch (currentNode.policyName) {
                        // Set language
                        case "CloudAssignedLanguage":
                            try {
                                let policyValue = await autoPilot.getStringPolicyAsync(currentNode.policyName);

                                if (policyValue) {
                                    let languageManager = AppObjectFactory.getInstance().getObjectFromString("CloudExperienceHostAPI.OobeDisplayLanguageManagerCore");
                                    let languages = CloudExperienceHostAPI.OobeDisplayLanguagesCore.getDisplayLanguages();
                                    let policyLanguage = languages.find((language) => language.tag.localeCompare(policyValue, undefined, { sensitivity: 'base' }) === 0); // String-insensitive compare, allows accent marks to be treated the same if the same base

                                    // If no match on installed languages or policy value is "os-default", set to the first (defaulted) language in the list
                                    if ((!policyLanguage) ||
                                        (policyValue === OS_DEFAULT)) {
                                        policyLanguage = languages[0];
                                    }
                                    languageManager.commitDisplayLanguageAsync(policyLanguage).action.done(() => {
                                        CloudExperienceHost.Telemetry.logEvent("Language set by AutoPilot policy");

                                        completeDispatch(CloudExperienceHost.AppResult.success);
                                    });
                                } else {
                                    completeDispatch(CloudExperienceHost.AppResult.success);
                                }
                            } catch (e) {
                                CloudExperienceHost.Telemetry.logEvent(`"Error getting Autopilot string policy '${currentNode.policyName}'"`);
                                completeDispatch(CloudExperienceHost.AppResult.fail);
                            }
                            break;

                        // Set region
                        case "CloudAssignedRegion":
                            try {
                                CloudExperienceHost.AutoPilot.logInfoEvent(
                                    CloudExperienceHost.AutoPilot.EventName_CommercialOOBE_AutopilotRegion_SettingRetrieval_Start,
                                    "Retrieving Autopilot region settings policy.");

                                let policyValue = await autoPilot.getStringPolicyAsync(currentNode.policyName);

                                CloudExperienceHost.AutoPilot.logInfoEvent(
                                    CloudExperienceHost.AutoPilot.EventName_CommercialOOBE_AutopilotRegion_SettingRetrieval_Succeeded,
                                    "Successfully retrieved Autopilot region settings policy.")

                                if (policyValue) {
                                    let regionCode = policyValue;

                                    if (policyValue === OS_DEFAULT) {
                                        regionCode = CloudExperienceHost.Globalization.GeographicRegion.getCode().toLowerCase();
                                    }

                                    CloudExperienceHost.AutoPilot.logInfoEvent(
                                        CloudExperienceHost.AutoPilot.EventName_CommercialOOBE_AutopilotRegion_SettingApplication_Start,
                                        "Applying Autopilot region settings policy.");

                                    let regionManager = AppObjectFactory.getInstance().getObjectFromString("CloudExperienceHostAPI.OobeRegionManagerStaticsCore");
                                    let commitRegion = regionManager.commitRegionAsync(regionCode);
                                    commitRegion.action.done(() => {
                                        CloudExperienceHost.Telemetry.logEvent("Region set by AutoPilot policy");
                                        CloudExperienceHost.AutoPilot.logInfoEvent(
                                            CloudExperienceHost.AutoPilot.EventName_CommercialOOBE_AutopilotRegion_SettingApplication_Succeeded,
                                            "Region set by AutoPilot policy.");
                                        if (commitRegion.effects.rebootRequired) {
                                            CloudExperienceHost.Telemetry.logEvent("CommitRegionRebootRequired");
                                        }

                                        // Additionally, set the keyboard since language and region have already been established.
                                        // This avoids the necessity of creating another appLauncher node after OobeKeyboard
                                        // when we've already determined the keyboard(s) at this point.
                                        let keyboardManager = AppObjectFactory.getInstance().getObjectFromString("CloudExperienceHostAPI.OobeKeyboardManagerStaticsCore");
                                        let keyboards = CloudExperienceHostAPI.OobeKeyboardStaticsCore.getKeyboardsForDefaultInputLanguage();
                                        let defaultKeyboard = [keyboards[0]]; // Set to the first default keyboard in the list
                                        keyboardManager.commitKeyboardsAsync(defaultKeyboard).done(() => {
                                            CloudExperienceHost.Telemetry.logEvent("Keyboard set by AutoPilot policy");

                                            // Notify the chrome footer to update the input switch button
                                            CloudExperienceHost.setShowInputSwitchButton();

                                            completeDispatch(CloudExperienceHost.AppResult.success);
                                        }, (err) => {
                                            CloudExperienceHost.AutoPilot.logInfoEvent(
                                                CloudExperienceHost.AutoPilot.EventName_CommercialOOBE_AutopilotRegion_SettingApplication_Failed,
                                                "Failed to set region by AutoPilot policy.");
                                        });
                                    });
                                } else {
                                    completeDispatch(CloudExperienceHost.AppResult.success);
                                }
                            } catch (e) {
                                CloudExperienceHost.Telemetry.logEvent(`"Error getting Autopilot string policy '${currentNode.policyName}'"`);
                                CloudExperienceHost.AutoPilot.logInfoEvent(
                                    CloudExperienceHost.AutoPilot.EventName_CommercialOOBE_AutopilotRegion_SettingRetrieval_Failed,
                                    `"Error getting Autopilot string policy '${currentNode.policyName}'"`);
                                completeDispatch(CloudExperienceHost.AppResult.fail);
                            }
                            break;

                        case "offlineCheck":
                            autoPilot.getStringPolicyAsync("CloudAssignedTenantId").then(function (policyValue) {
                                if ((policyValue === null) || (policyValue === "")) {
                                    // No valid autopilot profile since there is no valid Tenant ID in Autopilot profile.
                                    // success as "no autopilot profile"
                                    completeDispatch(CloudExperienceHost.AppResult.success);
                                } else {
                                    // Take action1, since there is a valid autopilot profile.
                                    completeDispatch(CloudExperienceHost.AppResult.action1);
                                }
                            }, function (err) {
                                completeDispatch(CloudExperienceHost.AppResult.abort);
                            });
                            break;

                        case "postReset":
                            let pluginManager = new CloudExperienceHostAPI.Provisioning.PluginManager();
                            let isAutopilotReset = pluginManager.isPostPowerwash();

                            // This tells the AAD sign in service to enable navigation to the Enterprise Provisioning page
                            CloudExperienceHost.Storage.SharableData.addValue("AADProvisioningPage", "OobeEnterpriseProvisioning");

                            if (isAutopilotReset === true) {
                                CloudExperienceHost.Telemetry.logEvent("Device is in a post Autopilot reset flow.");

                                let isHybridDomainJoinEnabled = (await EnterpriseDeviceManagement.Service.AutoPilot.AutoPilotUtilStatics.getDwordPolicyAsync("CloudAssignedDomainJoinMethod") === 1);

                                if (isHybridDomainJoinEnabled) {
                                    // Skip Hybrid DJ
                                    CloudExperienceHost.Telemetry.logEvent("Skipping domain join flow due to Autopilot reset.");
                                    completeDispatch(CloudExperienceHost.AppResult.action2);
                                } else {
                                    // Skip AAD registration
                                    CloudExperienceHost.Telemetry.logEvent("Skipping AAD registration flow due to Autopilot reset.");
                                    completeDispatch(CloudExperienceHost.AppResult.action1);
                                }
                            }
                            else {
                                let profileState = await EnterpriseDeviceManagement.Service.AutoPilot.AutoPilotUtilStatics.getProfileStateAsync();

                                // If the device is Autopilot-registered, skip to the AAD sign-in page. Otherwise, navigate to the normal OOBE flow
                                if (EnterpriseDeviceManagement.Service.AutoPilot.AutoPilotProfileState.available === profileState) {
                                    CloudExperienceHost.Telemetry.logEvent("Autopilot profile is available.");

                                    let enrollmentStaticApis = new EnterpriseDeviceManagement.Enrollment.ReflectedEnrollmentStatics();

                                    if (enrollmentStaticApis.ShouldSkip() === 1) {
                                        CloudExperienceHost.Telemetry.logEvent("No Hybrid AADJ specified in the Autopilot profile. Move to AADJ sign-in.");

                                        completeDispatch(CloudExperienceHost.AppResult.action3);
                                    } else {
                                        CloudExperienceHost.Telemetry.logEvent("Hybrid AADJ is specified in the Autopilot profile. Move to Hybrid AADJ sign-in.");

                                        completeDispatch(CloudExperienceHost.AppResult.success);
                                    }
                                } else {
                                    CloudExperienceHost.Telemetry.logEvent("No Autopilot profile available.");
                                    completeDispatch(CloudExperienceHost.AppResult.success);
                                }
                            }

                            break;

                        case "prefetch":
                            CloudExperienceHost.Telemetry.logEvent("AutoPilot prefetch ZTP policy cache started");
                            let startTime = performance.now();
                            let cxidOrResult = CloudExperienceHost.AppResult.success;
                            let clearAndPopulateZTPCachePromise = EnterpriseDeviceManagement.Service.AutoPilot.AutoPilotUtilStatics.clearDdsCacheAsync().then(() => {
                                CloudExperienceHost.Telemetry.logEvent("AutoPilot policy cache cleared");
                            }).then(() => {
                                return EnterpriseDeviceManagement.Service.AutoPilot.AutoPilotUtilStatics.retrieveSettingsAsync();
                            }).then(() => {
                                let details = { timeElapsed: performance.now() - startTime };
                                CloudExperienceHost.Telemetry.logEvent("AutoPilot prefetch ZTP policy cache returned", JSON.stringify(details));
                            }, (error) => {
                                CloudExperienceHost.Telemetry.logEvent("AutoPilot prefetch ZTP policy cache failed");
                            }).then(() => {
                                return EnterpriseDeviceManagement.Service.AutoPilot.AutoPilotUtilStatics.getCXIDPostRebootAsync();
                            }).then((cxidToJumpTo) => {
                                const UpdateRebootCXIDKey = "UpdateRebootCXID";
                                if ((cxidToJumpTo !== null) && (cxidToJumpTo !== "")) {
                                    let lastResetWasFromAutopilotUpdate = CloudExperienceHost.Storage.SharableData.getValue("resetFromAutopilotUpdate");
                                    if (lastResetWasFromAutopilotUpdate) {
                                        cxidOrResult = cxidToJumpTo;
                                        CloudExperienceHost.Storage.SharableData.addValue("resetFromAutopilotUpdate", false);
                                        // Reset the UpdateRebootCXID node after it is used.
                                        return autoPilot.storeSettingAsync(UpdateRebootCXIDKey, "");
                                    }
                                }
                            });

                            // The ZTP call doesn't actually support cancellation and is basically fire-and-forget,
                            // but we wait up to 36 seconds for it to finish before moving on to give it adequate time to complete.
                            let timedOut = false;
                            let timeoutPromise = WinJS.Promise.timeout(36000 /*36 second timeout*/).then(() => { timedOut = true; });
                            WinJS.Promise.any([clearAndPopulateZTPCachePromise, timeoutPromise]).then((result) => {
                                if (timedOut) {
                                    CloudExperienceHost.Telemetry.logEvent("AutoPilot prefetch ZTP policy cache timed out");
                                } else {
                                    CloudExperienceHost.Telemetry.logEvent("AutoPilot prefetch ZTP policy cache done");
                                }

                                completeDispatch(cxidOrResult);
                            }, function (err) {
                                completeDispatch(CloudExperienceHost.AppResult.fail);
                            });
                            break;

                        default:
                            completeDispatch(CloudExperienceHost.AppResult.success);
                            break;
                    }
                } catch (err) {
                    CloudExperienceHost.Telemetry.logEvent(`Failed to run app launcher Autopilot policy '${currentNode.policyName}' for node '${currentNode.cxid}'`);
                    completeDispatch(CloudExperienceHost.AppResult.fail);
                }
            });
        }
    }
    return OOBEAutoPilot;
});

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.6173 ]--