Das Folgende ist der JS -Code, wenn Xiaomi nach der Analyse ihn kauft.
Die Codekopie lautet wie folgt:
HdControl ({"Stime": 1381645438, "Status": {"erlauben": false, "miphone": {"hdstart": false, "hdstop": false, "hdurl": "", "Dauer": null}} , "mibox": {"hdstart": false, "hdstop": false, "hdurl": "", "dauer": null}}})
Die Codekopie lautet wie folgt:
Funktion fornum (a) {
Rückgabe 10> a? "0"+a: a
}
Funktion Countdown (a, b) {
varc = newdate (b) .getTime ()/1e3,
d = ca,,
e = parsesint (d%60),
F = ParseInt (D/60%60), g = ParseInt (d/3600%24),
H = ParseInt (d/3600/24),
i = [e.tostring (),
f.tostring (),
g.tostring ()];
return0> = d? ["00 Stunden 00 Minuten 00 Sekunden",! 0]: h> 0? (Fenster._Timestern = H+"Tag"+Fornum (i [2])+"Zeit"+Fornum (i [1 ])+"Minute"+Fornum (i [0])+"Second", [H+"<spannung> Tag </span>"+fornum (i [2])+"<spannung> Zeit </span>" +fornum (i [1])+"<span> min </span>"+fornum (i [0])+"<span> Second </span>",! 1]) :( Fenster._Timestern = Fornum (i [2])+"Zeit"+Fornum (i [1])+"Minute"+Fornum (i [0])+"Second", [Fornum (i [2])+"<spannes> /span > "+fornum (i [1])+" <span> min </span> "+fornum (i [0])+" <span> Second </span> ",! 1])}
FunctionWebventtrigger (a, b) {
versuchen{
if (wir && wir.trigger)
Rückgabe "String"!
} catch (c) {}
Rückkehr! 1
}
functionisapp () {
versuchen{
Wenn (wir) zurückkehren! 0
} catch (a) {}
Rückkehr! 1
}
varquickbuy = {init: function () {
vara = this;
this.config = {},
this.config.hdurl = {miphone: "M3/840410d8656d74e5f334591bd8a408a726799aec13477d90b5e48dad36547351/4334f49a1ee391261005E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8E8AWS8AW9A1FREI D20AB3F58343496FD4983D/TIP_SALEDOVERALL.HTML ", MIBOX:" TV/B1CF7B57BFEAE1EBC37700694C123D894C668BF1F1F25D59311FD369 42b3B3A/130000000F18931fd369 42b3b3a/1300000000000000000259311fd369 42b3b3a/1300000000000000000000000000000000000 der B24E926C5A9B7676E57BE3D47959D6557545E8A339/TIP_SALEDOVERALL.HTML "
},
this.config.mode = "",
this.mode = {miphone :! 1, mibox :! 1},
this.modemodals = {miphone: "#modal_miphone", mibox: "#modal_mibox"},
this.modecookies = {miphone: "xm_hd_so_phone", mibox: "xm_hd_so_box"},
this.config.startdate =+newdate ("15.10.201312: 00: 00"),
this.maskload = $ ("#maskload"),
this.config.minsignime = 120,,
this.Results = null,
this.timer = null,
this.timeCount = math.floor (math.abs (10*math.random ()-5))+5;
varb =! 0;
für (varcinthis.mode)
$ .cookie (this.modecookies [c]) || (b =! 1), $. Cookie (this.modecookies [c]) && this.Saleout ();
B || ($. Cookie ("xm_diff_hd")? (this.config.servertime = this.localtime ()+parseInt ($. cookie ("xm_diff_hd"), 10), this.config.servertime> = parseInt (this .config.startDate/1e3,10)? ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::: LOUND ()): this.getData ())}, getData: function (a, b) {
varc = this, a = a || null;
B && (b = b),
$ .ajax ({{{
URL: "http://tc.hd.xiaomi.com/hdget",
Datentyp: "JSONP",
JSONPCallback: "Hdcontrol",
Zeitüberschreitung: 7E3,
Beforesend: function () {
C. maskload.css ("Anzeige", "Block")},
Fehler: function () {
C. maskload.css ("Anzeige", "keine"),
ALERT ("Der Server steht unter großem Druck, bitte aktualisieren Sie die Seite!")
},
Erfolg: Funktion (d) {
if (C. maskload.css ("Anzeige", "None"), "undefined" == Typofd)
returnlert ("Der Server steht unter großem Druck, bitte aktualisieren Sie die Seite!").
void0;
if (c.results = d, a || (C.Config.Servertime = C.Results.Stime),! $. Cookie ("xm_diff_hd") {
vare = parseInt (C.Config.Servertime-C.LocalTime (), 10);
$ .cookie ("xm_diff_hd", e, {
Weg:"/",
Domain: ". xiaomi.com",
Läuft ab: 1
})
}
if (a) {
c.initialdata ();
für (VARFINC.MODE)
if (c.config [f] .hdstart ===! 1 && c.config [f] .hdstop ===! 0) {
varg = c.Modecookies [f];
$ .cookie (g, 1, {path: "/", domain: ". xiaomi.com", läuft: 1}),
C.Saleout ()
} elseb && b.call ())
}
a || c.launch ()
}})},
initialdata: function () {
this.config.allow = this.results.status.allow,
this.config.mibox = this.results.status.mibox,
this.config.miphone = this.results.status.miphone
},
Start: function () {
this.timestart (),
this.countdown ()
},
TIMESTART: function () {
vara = this,,
b = 1e3*a.config.servertime,
c = a.config.startdate,
D = C-1E3*60*A.Config.MinsignTime;
b> = d && c> b &&! isapp ()?
$ .cookie ("userId")?
($ ("#view_button"). CSS ("Sichtbarkeit", "versteckt"),
$ ("#bauf_btn_1") .html ('<class = "btn_buy" href = "http://bbs.xiaomi.cn/thread-8205768-1.html"> Aktivitätsdetails </a>'),
$ ("#bauf_btn_2").
},
Tologin: function () {
$ ("#view_button"). CSS ("Sichtbarkeit", "versteckt"),
$ ("#bauf_btn_1") .html ('<class = "btn_buy" href = "http://bbs.xiaomi.cn/thread-8205768-1.html"> Aktivitätsdetails </a>'),
$ ("#bauf_btn_2").
$ ("#bauf_btn_2"). Find (". Btn_02"). On ("Click", Funktion () {
WebEventTigger ("Login", null) || (window.location.href = "http://m.xiaomi.com/mshopapi/index.php/v1/authorize/Sso?client_id=180100031013&c Allback ="+Encodouricomponent (Fenster .
)},
Countdown: function () {
vara = this,,
B = NULL,
C = A.config.StartDate;
B = A.config.Servertime?
vard = c-1e3*60*A.config.minsignime,
e = setInterval (function () {
VARF = Countdown (b, c);
f [1]? (ClearInterval (e), $ ("#Countdown"). CSS ("Display", "None"), a.tobuy ()) :( 1E3*b! = d || isapp () | | ($. Cookie ("userId")? ($ ("#view_button"). CSS ("Sichtbarkeit", "versteckt"),
$ ("#bauf_btn_1") .html ('<class = "btn_buy" href = "http://bbs.xiaomi.cn/thread-8205768-1.html"> Aktivitätsdetails </a>'),
$ ("#bauf_btn_2").
$ ("#Countdown"). HTML (f [0])}, 1E3)},
tobuy: function () {
vara = this;
A.gobuy ();
varb = a.modemodals [a.config.mode];
$ (b) .find (". Close"). On ("Click", function () {
$ (b) .css ("Display", "keine"),
Fenster.ClearTimeout (A.Timer),
A.Timer = null})},
SALEOUT: function () {
vara = {miphone: "#bauf_btn_2", mibox: "#bauf_btn_1"},
b = {miphone: "http://t.hd.xiaomi.com/r/?_a=payment_check&_m=1", mibox: "http://m.xiaomi.com/index.html#ac=home&op=addcart&product_id = 2505 "},
C = {Miphone: "Pay Xiaomi Mobile 3", mibox: "pay xiaomi tv"};
für (vardintthis.mode)
$ .cookie (this.ModeCookies [d]) && ($ (a [d]) "</a>"),
$ (this.modemodals [d]). Ist (": sichtbar") && $ (this.modemodals [d]). Find (". Close"). Click ())},
Lokalzeit: function () {
vara = parseInt (+newdate/1e3,10);
returna
},
TopRocess: Funktion (a) {
varb = this,,
c = b.timer,
d = b.timeCount || 10, e = $ (B.Modemodals [a]). Find (". Re_Countdown"),
f = $ (B.Modemodals [a]). Find (". modal_btn"),
g = function () {0 == d? (f.html ('<aclass = "in_buy_btn" href = "javaScript:;"> Aktivität eingeben </a>'),
b.tobuygo (b.config.mode),
c && window.clearTimeout (c),
c = null) :( e.html ("("+d+")"),
D--,
b.timer = window.settimeout (function () {g ()}, 1e3))};
c && window.clearTimeout (c), g ()},
Gobuy: function () {
vara = this,,
B = {Miphone: "Kaufen Sie Xiaomi Mobile 3", Mibox: "Xiaomi tv"},
c = {miphone: "#bauf_btn_2", mibox: "#bauf_btn_1"};
für (vardina.mode)
$ .cookie (a.Modecookies [d]) || ($ (c [d]). +b [d]+"</a>"),
$ (c [d]). Ist (": versteckt") && $ (c [d]). CSS ("Anzeige", "Block");
$ ("#open_button"). find (". btn_buy_go"). on ("click", function () {a.mode [$ (this) .attr ("Datentyp")] =! 0;
varb = a.config.mode = $ (this) .attr ("Datentyp");
if ($. cookie ("userId")) a.getData (! 0, function () {
$ (a.modemodals [b]). CSS ("Display", "Block"),
$ (a.modemodals [b]). Find (". Close"). On ("Click", function () {
$ (a.modemodals [b]). CSS ("Anzeige", "keine"), window.clearTimeout (A.timer), A.Timer = null}), a.toprocess (b)});
sonst {if (WebEventTriigger ("Login", null)) return;
window.location.href="http://m.xiaomi.com/mshopapi/index.php/v1/authorize/sso?client_id=180100031013&callback="+encodeURIComponent(w indow.location.href)}})},
Tobuygo: Funktion (a) {
varb = this;
Fenster.ClearTimeout (b.timer),
b.timer = null,
$ (B.Modemodals [a]). find (". modal_btn"). find (". in_buy_btn"). on ("click", function (c) {c.preventDefault (), B.GetData (! 0,, Funktion(){
if ($ (B.Modemodals [a]). CSS ("Display", "Block"), b.config.allow) if (b.config [a] .hdurl) {
varc = "http://t.hd.xiaomi.com/s/"+b.config [a] .hdurl+"& _m = 1";
window.settimeout (function () {window.location.href = c}, 500)
}anders{
vard = "http://p.www.xiaomi.com/m/activities/open/"+b.config.hdurl [a];
window.settimeout (function () {window.location.href = d}, 500)
} elseif (
b.config [a] .hdstart ===! 1 && b.config [a] .hdstop ===! 0) {
vard = "http://p.www.xiaomi.com/m/activities/open/"+b.config.hdurl [a];
window.settimeout (function () {window.location.href = d}, 500)
} else $ (B.Modemodals [a]). find (". modal_btn").
B. Toprozess (a)
})})}};