Anda di halaman 1dari 3

"use strict";class TimeSpan{constructor(e){this.

value=e}ticks(){return
this.value}milliseconds(){return this.ticks()/1e4}static fromTicks(e){return new
TimeSpan(e)}static fromMilliseconds(e){return TimeSpan.fromTicks(e*1e4)}static
fromSeconds(e){return TimeSpan.fromMilliseconds(e*1e3)}static fromMinutes(e){return
TimeSpan.fromSeconds(e*60)}static fromHours(e){return
TimeSpan.fromMinutes(e*60)}}var $;!function(e){function n(e,n){const t={};return
t[e]=n,t}function t(e,n){if(e instanceof Array){for(let t=0;t<e.length;+
+t)if(n(e[t])===!1)return!1}else for(let o in
e)if(e.hasOwnProperty(o)&&n(o,e[o])===!1)return!1;return!0}function o(e,n){return!
t(e,((e,t)=>!n(e,t)))}function i(e,n){return e.map(n).reduce(((e,n)=>e.concat(n)),
[])}function r(e,n){return e.map(n)}function s(e,n){return i(e,(e=>{const
t=n(e);return null!=t?[t]:[]}))}function c(e){function n(t,o){return t<e.length?
e[t].then((e=>n(t+1,o.concat([e])))):Promise.resolve(o)}return n(0,[])}function
u(e,...n){for(let o=0;o<n.length;++o)t(n[o],((n,t)=>{return e[n]=t,!0}));return
e}function a(e,n,t){return n.split(".").reduce(((e,n)=>null==e?e:e[n]),e)||
t}function f(e){switch((e||"").toLowerCase())
{case"us":return"https://unitedstates.smartscreen.microsoft.com";case"uk":return"ht
tps://unitedkingdom.smartscreen.microsoft.com";case"eu":return"https://europe.smart
screen.microsoft.com";default:return
null}}e.createObject=n,e.each=t,e.any=o,e.collect=i,e.map=r,e.choose=s,e.sequence=c
,e.extend=u,e.get=a,e.serviceUriForGeoId=f}($||($={}));var Base64;!function(e)
{function n(e){if(!e.match(/(^$)|(^([A-Za-z0-9+\/]{4})*([A-Za-z0-9+\/]{4}|[A-Za-z0-
9+\/]{3}=|[A-Za-z0-9+\/]{2}==))$/g))throw`decodeToString: Invalid base64
string.`;var n=new Uint8Array(.75*e.length);for(let
i,r,s,c,u=0,a=0;u<e.length;)i=o.indexOf(e[u++]),r=o.indexOf(e[u+
+]),s=o.indexOf(e[u++]),c=o.indexOf(e[u++]),n[a++]+=i<<2|r>>4,64!=s&&(n[a++]
+=(15&r)<<4|s>>2),64!=c&&(n[a++]+=(3&s)<<6|c);return t(n)}function t(e){var
n="";for(let t=0,o=0,i=0,r=0,s=0;t<e.length;){if(o=e[t++],o>127)if(o>191&&224>o)
{if(t>=e.length)throw"utf8ToString: Invalid 2-byte sequence.";i=e[t++],o=(31&o)<<6|
63&i}else if(o>223&&240>o){if(t+1>=e.length)throw"utf8ToString: Invalid 3-byte
sequence.";i=e[t++],r=e[t++],o=(15&o)<<12|(63&i)<<6|63&r}else{if(!
(o>239&&248>o))throw"utf8ToString: Unknown multibyte
sequence";if(t+2>=e.length)throw"utf8ToString: Invalid 4-byte sequence.";i=e[t+
+],r=e[t++],s=e[t++],o=(7&o)<<18|(63&i)<<12|(63&r)<<6|
63&s}if(65535>=o)n+=String.fromCharCode(o);else{if(!
(1114111>=o))throw"utf8ToString: Largest UTF8 Code point reached.";o-
=65536,n+=String.fromCharCode(o>>10|55296),n+=String.fromCharCode(1023&o|
56320)}}return n}const
o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.decodeToStr
ing=n}(Base64||(Base64={}));class LoggingChannel{constructor(e)
{e("Windows.Foundation.Diagnostics");this.loggingChannel=new
Windows.Foundation.Diagnostics.LoggingChannel("Microsoft.Windows.SmartScreen",new
Windows.Foundation.Diagnostics.LoggingChannelOptions("4f50731a-89cf-4782-b3e0-
dce8c90476ba"),"39bd9805-3945-4878-aecc-096a23369f68")}logException(e,n){let t=new
Windows.Foundation.Diagnostics.LoggingFields;t.addString("name",
$.get(e,"name",""));t.addString("message",
$.get(e,"message",""));t.addString("stack",
$.get(e,"stack",""));t.addString("context",n?
n:"");this.loggingChannel.logEvent("Exception",t,Windows.Foundation.Diagnostics.Log
gingLevel.Error,new
Windows.Foundation.Diagnostics.LoggingOptions(70368744177664))}logInfo(e)
{this.loggingChannel.logEvent(e.name,e.fields,Windows.Foundation.Diagnostics.Loggin
gLevel.Information,new
Windows.Foundation.Diagnostics.LoggingOptions(70368744177664))}}class
ApiBase{constructor(e,n=.01,t=1)
{this.defaultSamplingRate=n;this.errorSamplingRate=t;this.loggingChannel=new
LoggingChannel(e)}sendRequestTimeout(e){return null}shouldSendRequest(e,n){return
true}transformRequest(e,n){function t(e,n){if(!e){return e}switch(typeof e)
{case"object":var o={};if(e.constructor===Array){o=$.map(e,
(e=>t(e,n)))}else{$.each(e,((e,i)=>{o[e]=t(i,n)}))}return o;case"string":return
e.length>n?e.slice(0,n-3)+"...":e;default:return e}}const o=5e3;if(n.body)
{n.body=t(n.body,o)}if($.get(n,"body.identity.caller.process.owner")){delete
n.body.identity.caller.process.owner}if($.get(n,"body.identity.device.id")){delete
n.body.identity.device.id}if($.get(n,"body.path.fileName")){var
i=n.body.path.fileName.split("\\");n.body.path.fileName=i.pop()}return
n}transformResponse(e,n,t){return t}logSendRequest(e,n,t){}getSamplingRates(e)
{return e.reduce(((n,t)=>{const o=this.getSamplingRate(t,e);if(o===null){switch(t.
$type){case"error":return $.extend(n,{error:this.errorSamplingRate});default:return
$.extend(n,{none:this.defaultSamplingRate})}}else if(o===0){return n}else{return
$.extend(n,o)}}),{})}getDiagnosticEvent(e,n){return null}logFilterEvents(e,n)
{$.each($.choose(e,(e=>this.getDiagnosticEvent(e,n))),
(e=>this.loggingChannel.logInfo(e)))}transformFinalizedEvent(e)
{return[e]}getPreFinalizedSamplingRate(e){return null}serviceUriForGeoId(e){return
$.serviceUriForGeoId(e)}scriptHostTimeout(){return
TimeSpan.fromSeconds(5).ticks()}sendRequest(e,n,t){if(this.shouldSendRequest(e,n))
{const o=this.transformRequest(e,n);const i=Promise.race([t(e,o),new
Promise(((n,t)=>{const o=this.sendRequestTimeout(e);if(o!=null)
{setTimeout((()=>{n({headers:
[],body:null,statusCode:504})}),o.milliseconds())}}))]).then((n=>this.transformResp
onse(e,o,n)));i.then((n=>this.logSendRequest(e,o,n))).catch((e=>this.loggingChannel
.logException(e)));return i}else{return Promise.resolve({headers:
[],body:null,statusCode:429})}}filterEvents(e,n,t,o){return new
Promise((i=>{function r(e){if(e.hasOwnProperty("$id")){return
n(e["$id"]).then((n=>$.extend(e,n))).catch((n=>$.extend(e,
{$error:n.message}))).then((e=>delete e.$id?e:e))}else{return
Promise.resolve(e)}}this.logFilterEvents(e,o);const s=e.reduce(((e,n)=>{const
t=this.getPreFinalizedSamplingRate(n);if(t!=null){return $.extend(e,t)}else{return
e}}),{});return i($.sequence(e.map((e=>{if(s[e.$type]!=null&&t<=s[e.$type]){return
r(e).then((e=>this.transformFinalizedEvent(e)))}else{return
Promise.resolve(e)}}))).then((e=>$.collect(e,(e=>e)))).then((e=>{const
n=this.getSamplingRates(e);if($.any(n,((e,n)=>t<=n))){return $.sequence($.map(e,
(e=>r(e)))).then((e=>$.collect(e,(e=>{try{return
this.transformFinalizedEvent(e)}catch(n){return $.extend(e,
{$error:n.message})}})))).then((e=>({events:e,samplingRates:n,random:t})))}else{ret
urn Promise.resolve(null)}})))}))}}var V1;!function(e){class n extends
ApiBase{constructor(e){super(e,.001)}serviceUri(e){return
super.serviceUriForGeoId(e)||"https://checkappexec.microsoft.com"}sendRequestTimeou
t(e){return e.indexOf("service")!=-1?
TimeSpan.fromSeconds(5):null}getSamplingRate(e){switch(e.$type)
{case"block":return{block:1};case"userAction":return{userAction:1};case"offline":re
turn{offline:1};case"unsupported":return{unsupported:.01};case"onAllowedZoneCheck":
if(this.isFileSupported(e["name"])){return{onAllowedZoneCheck:5e-4}}else{return
0}default:return null}}getDiagnosticEvent(e,n){let t=new
Windows.Foundation.Diagnostics.LoggingFields;t.addString("CorrelationId",
$.get(n,"correlationId",""));switch(e.$type)
{case"userAction":t.addString("Action",e["action"]);return{name:"AppRepUserAction",
fields:t};case"offline":return{name:"AppRepOfflineExperience",fields:t};default:ret
urn null}}logFilterEvents(e,n){}isFileSupported(e,n)
{switch(e.substr(e.lastIndexOf(".")+1).toLowerCase()){case"appref-
ms":case"appx":case"appxbundle":case"bat":case"chm":case"cmd":case"com":case"cpl":c
ase"dll":case"drv":case"exe":case"gadget":case"hta":case"iso":case"js":case"jse":ca
se"lnk":case"msc":case"msi":case"msp":case"msu":case"ocx":case"pif":case"ppkg":case
"printerexport":case"ps1":case"scf":case"scr":case"settingcontent-
ms":case"sys":case"url":case"vb":case"vbe":case"vbs":case"vhd":case"vhdx":case"vxd"
:case"website":case"wsf":return true;default:return false}}}e.Api=n}(V1||
(V1={}));var V2;!function(e){class n extends V1.Api{constructor(e)
{super(e)}logFilterEvents(e,n){$.each(e,(e=>{if(e.$type=="userAction")
{windows.smartScreen.events.logDecision(e["action"],"")}}))}logSendRequest(e,n,t)
{if(e.toLowerCase().indexOf("beforeexecute")!=-1&&t&&t.body){var
o=this.parseResponseBody(t);if(o.$type==="block")
{windows.smartScreen.events.logAppLookup(n.body.path.fileName,
$.get(n,"body.hash",""),$.get(n,"body.authenticode.hash",""),
$.get(n,"body.authenticode.hashAlgo",""),n.body.motw?
JSON.stringify(n.body.motw):"",$.get(n,"body.identity.caller.process.id",0),
$.get(n,"body.identity.caller.process.creationTime",0),
$.get(n,"body.identity.caller.process.owner",""),"",
$.get(n,"body.config.device.appReputation.level","")+
($.get(n,"body.config.device.appReputation.enforcedByPolicy",false)?"ByPolicy":""),
$.get(o,"responseCategory",""))}}}isFileSupported(e,n)
{switch(e.substr(e.lastIndexOf(".")+1).toLowerCase())
{case"appx":case"appxbundle":return false;default:return
super.isFileSupported(e,n)}}sendRequest(e,n,t){return
super.sendRequest(e,n,t)}parseResponseBody(e){return
JSON.parse(Base64.decodeToString(e.body))}}e.Api=n}(V2||(V2={}));var V3;!
function(e){class n extends V2.Api{constructor(e)
{super(e);e("Windows.Services.Store")}sendRequest(e,n,t)
{if(e.toLowerCase().indexOf("beforeexecute")!=-1){return super.sendRequest(e,n,
((e,n)=>{const o={headers:[],body:{$type:"unsupported"},statusCode:200};let i;const
r=new Promise(((e,n)=>{i=setTimeout((()=>e(o)),3e3)}));const s=(()=>{try{return
$.get(n,"body.config.device.appControl.level","")!="anywhere"?
Windows.Services.Store.StoreRequestHelper.sendRequestAsync(Windows.Services.Store.S
toreContext.getDefault(),23,JSON.stringify({data:JSON.stringify(n.body)})).then((e=
>{return e.httpStatusCode==Windows.Web.Http.HttpStatusCode.ok&&e.response?{headers:
[],body:
{$type:"recommend",arguments:e.response},statusCode:200}:o})):Promise.resolve(o)}ca
tch(e){return Promise.reject(e)}})();const
c=Promise.race([r,s]).then((e=>{clearTimeout(i);return e}),
(e=>{clearTimeout(i);return e}));const
u=$.get(n,"body.config.device.appReputation.level","")!="off"?
t(e,n):Promise.resolve(o);return u.then((e=>{if(e.statusCode!=200||e.body.
$type=="block"){return u}else{return c.then((e=>{if(e.body.$type=="recommend")
{return c}else{return u}}))}})).then(null,(e=>u))}))}else{return
super.sendRequest(e,n,t)}}displayRecommendation(e,n){return
Windows.Services.Store.StoreRequestHelper.sendRequestAsync(n,24,e).then((e=>{const
n=e.response?JSON.parse(e.response).status:null;return n&&n!
="success"?"cancel":"runonce"}))}parseResponseBody(e){return e.body}}e.Api=n}(V3||
(V3={}));

Anda mungkin juga menyukai