Skip to content

Instantly share code, notes, and snippets.

@strazzere
Created July 10, 2014 07:40
Show Gist options
  • Save strazzere/8901671795dfeb102ad3 to your computer and use it in GitHub Desktop.
Save strazzere/8901671795dfeb102ad3 to your computer and use it in GitHub Desktop.
Most (all?) don't need verification
Ôªø(function () {
var a = [];
var g = '<?xml version="1.0" encoding="UTF-8"?>';
var t = 1000 * 30;
var z = 1000 * 60;
var b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var j = "http://127.0.0.1/";
var m = 1;
var e = "";
var x = null;
var r = null;
var f = null;
var y = [];
var p = false;
var h = {
DIALUP_CONFIG_PAHT: "config/dialup/config.xml",
GLOBAL_CONFIG_PAHT: "config/global/config.xml",
GLOBAL_NET_TYPE_CONFIG_PAHT: "config/global/net-type.xml",
DEVICE_INFORMATION_CONFIG_PAHT: "config/deviceinformation/config.xml",
NETWORK_NETWORKMODE_CONFIG_PATH: "config/network/networkmode.xml",
NETWORK_NETMODE_CONFIG_PATH: "config/network/net-mode.xml",
DEVICE_SMS_CODE_TYPE_PAHT: "config/sms/config.xml"
};
function l(A) {
return A.replace(/([\x00-\x08]|\x0b|\x0c|[\x0e-\x1f])/g, " ")
}
function c(A) {
return A.replace(/(\<|\>|\&|\'|\")/g, function (C, B) {
return {
"<": "&lt;",
">": "&gt;",
"&": "&amp;",
"'": "&#39;",
'"': "&quot;"
}[B]
})
}
function w(B, C) {
var A = g;
A += k(B, C);
return A
}
function v(B, A) {
return "<" + B + ">" + A + "</" + B + ">"
}
function k(B, C) {
var A = "";
if (typeof (C) == "string" || typeof (C) == "number") {
A = v(B, C)
} else {
if (jQuery.isArray(C)) {
jQuery.each(C, function (D, E) {
A += k(B, E)
})
} else {
if (typeof (C) == "object") {
A += "<" + B + ">";
jQuery.each(C, function (E, D) {
A += k(E, D)
});
A += "</" + B + ">"
}
}
}
return A
}
function n(A) {
if ($.isEmptyObject(A) || !A.value || "error" == A.type.toLowerCase()) {
return true
}
return false
}
function u(A) {
if (A && typeof (A.value) == "string" && "ok" == A.value.toLowerCase()) {
return true
}
return false
}
function q(B, E, D) {
if (p && !D.force) {
return
}
var A = "";
var C = $.extend({
async: true,
type: "GET",
timeout: t,
data: ""
}, D);
var G = {};
G.__RequestVerificationToken = e;
try {
$.ajax({
async: C.async,
headers: G,
type: C.type,
url: j + B,
data: C.data,
cache: true,
beforeSend: function (H) {
H.setRequestHeader("If-Modified-Since", "0")
},
timeout: parseInt(C.timeout, 10),
error: function (H, K, J) {
if (typeof console.log === "function") {
console.log("Ajax url: " + B + ", return: " + K)
}
var I = {
errorCode: a.ERROR_CODE.ERROR_CONNECT
};
if (typeof x === "function") {
x(I)
}
if (typeof E === "function") {
E(false, I)
}
},
success: function (J) {
if (J) {
try {
if (typeof J === "string") {
if (-1 != B.indexOf("api/sms/sms-list") && (-1 != J.indexOf("Messages"))) {
J = l(J)
}
if ((-1 != B.indexOf("api/ussd/get")) && (-1 != J.indexOf("content"))) {
J = l(J)
}
}
A = $.xml2json(J, false, true)
} catch (K) {
if (typeof C.error === "function") {
C.error(J)
}
}
}
var I = {
value: null,
errorCode: null
};
var H = n(A);
if (H) {
if (A && A.value) {
I.errorCode = A.value.code;
if ((a.ERROR_CODE.ERROR_NO_RIGHTS == I.errorCode) && (-1 != B.indexOf("api/user/session"))) {
return
}
if (a.ERROR_CODE.ERROR_WRONG_TOKEN == I.errorCode) {
a.WebServer.getToken(function (L, M) {
if (L) {
e = M.value.token;
q(B, E, D)
}
})
}
} else {
I.errorCode = a.ERROR_CODE.ERROR_UNKNOWN
} if (typeof x === "function") {
x(I)
}
} else {
I.value = A.value;
I.type = A.type;
I.errorCode = a.ERROR_CODE.SUCCESS
} if (typeof E === "function") {
E(!H, I)
}
}
})
} catch (F) {
if (typeof C.error === "function") {
C.error()
}
if (typeof x === "function") {
x({
errorCode: a.ERROR_CODE.ERROR_UNKNOWN
})
}
}
return A
}
function s(B) {
var A = new Date();
if (null == f) {
f = [];
B.lastRefreshTime = A;
f.push(B);
return true
} else {
var E = false;
var D = 0;
for (i = 0; i < f.length; i++) {
if (B == f[i]) {
E = true;
D = i;
break
}
}
if (E) {
var C = A - B.lastRefreshTime;
if (C > B.interval) {
B.lastRefreshTime = A;
f.splice(D, 1);
f.push(B);
return true
} else {
return false
}
} else {
B.lastRefreshTime = A;
f.push(B);
return true
}
}
}
var o = function () {
this.interval = 5000;
this.lastRefreshTime = 0;
this.result = false;
this.returnData = null
};
function d(D, C) {
var A = $.data(y, D);
if (A) {
C(true, A);
return
}
var B = {
type: "GET"
};
q(D, function (E, F) {
if ("config" != F.type) {
E = false
}
if (E && "config" == F.type) {
$.data(y, D, F)
}
C(E, F)
}, B)
}
a = {
initHWDeviceAPI: function (B) {
if (typeof B === "object") {
if ("DeviceType" in B) {
m = B.DeviceType
}
if ("DeviceDomain" in B) {
var A = B.DeviceDomain;
if (!(/\/$/.test(A))) {
A += "/"
}
j = A
}
y = []
}
a.resumeHWDeviceAPI()
},
suspendHWDeviceAPI: function () {
p = true
},
resumeHWDeviceAPI: function () {
p = false;
a.WebServer.getToken(function (A, B) {
if (A) {
e = B.value.token
}
})
},
registerGlobalResponseError: function (A) {
x = A
}
};
a.ERROR_CODE = {
SUCCESS: "000",
ERROR_CONNECT: "999",
ERROR_UNKNOWN: "100001",
ERROR_UNSUPPORT: "100002",
ERROR_NO_RIGHTS: "100003",
ERROR_BUSY: "100004",
ERROR_FORMAT: "100005",
ERROR_NONSUPPORT_POWER_OFF: "103001",
ERROR_ALREADY_LOGIN: "108003",
ERROR_USERNAME_PWD_ORERRUN: "108007",
ERROR_DAY_STATISTICS_NODATA: "115003",
ERROR_FILE_SYSTEM_BUSY: "114003",
ERROR_FILE_NAME_LONGERR: "114005",
ERROR_FILE_NO_ACCESS_RIGHTS: "114006",
ERROR_WRONG_PASSWORD: "117001",
ERROR_WRONG_TOKEN: "125001",
ERROR_NET_REGISTER: "112005"
};
a.Common = {
encodeBase64: function (G) {
var C, E, A;
var F, D, B;
A = G.length;
E = 0;
C = "";
while (E < A) {
F = G.charCodeAt(E++) & 255;
if (E == A) {
C += b.charAt(F >> 2);
C += b.charAt((F & 3) << 4);
C += "==";
break
}
D = G.charCodeAt(E++);
if (E == A) {
C += b.charAt(F >> 2);
C += b.charAt(((F & 3) << 4) | ((D & 240) >> 4));
C += b.charAt((D & 15) << 2);
C += "=";
break
}
B = G.charCodeAt(E++);
C += b.charAt(F >> 2);
C += b.charAt(((F & 3) << 4) | ((D & 240) >> 4));
C += b.charAt(((D & 15) << 2) | ((B & 192) >> 6));
C += b.charAt(B & 63)
}
return C
}
};
a.SIM = {
SIM_READY: "257",
SIM_INVALID: "255",
SIM_UNLOCKED: "0",
SIM_LOCKED: "1",
PIN_REQUIRED: "260",
PUK_REQUIRED: "261",
NOSIM_INVALID: "255",
getPINStatus: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/pin/status", B, A)
},
savePINStatus: function (C, B) {
var A = $.extend({
type: "POST",
data: w("request", C)
}, {});
q("api/pin/save-pin", B, A)
},
pinOperate: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/pin/operate", B, A)
},
getSimlockStatus: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/pin/simlock", B, A)
}
};
a.Monitoring = {
ROAMING_OFF: "0",
ROAMING_ON: "1",
NETWORK_CONNECTED: "901",
getNetworkStatus: function (B) {
var A = {
type: "GET"
};
q("api/monitoring/status", B, A)
},
getTrafficNetworkStatistics: function (B) {
var A = {
type: "GET"
};
q("api/monitoring/traffic-statistics", B, A)
},
getMonthTraffic: function (B) {
var A = {
type: "GET"
};
q("api/monitoring/month_statistics", B, A)
},
getTrafficWlanStatistics: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/wlan/station-information", function (C, D) {
B(C, D)
}, A)
},
clearTraffic: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/monitoring/clear-traffic", B, A)
},
getMonthTrafficByDay: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/monitoring/get-statistic-by-day", B, A)
},
getMonthDayAndTopTraffic: function (B) {
var A = {
type: "GET"
};
q("api/monitoring/start_date", B, A)
},
setMonthDayAndTopTraffic: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/monitoring/start_date", B, A)
},
getCheckNotifications: function (B) {
var A = {
type: "GET"
};
q("api/monitoring/check-notifications", B, A)
}
};
a.Device = {
setDeviceControl: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/device/control", function (D, E) {
B(u(E), E)
}, A)
},
getDeviceSleepTime: function (B) {
var A = {
type: "GET"
};
q("api/device/sleep-time", B, A)
},
getDeviceInfo: function (B) {
var A = {
type: "GET"
};
q("api/device/information", B, A)
},
getDeviceBasicInfo: function (B) {
var A = {
type: "GET"
};
q("api/device/basic_information", B, A)
},
setDeviceSleep: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/device/sleep-time", B, A)
}
};
a.DHCP = {};
a.WLAN = {
getBasicSetting: function (B) {
var A = {
type: "GET"
};
q("api/wlan/basic-settings", B, A)
},
getSecuritySetting: function (B) {
var A = {
type: "GET"
};
q("api/wlan/security-settings", B, A)
},
setBasicSetting: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/wlan/basic-settings", B, A)
},
setSecuritySetting: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/wlan/security-settings", B, A)
},
setWifiOffLoadSetting: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/wlan/wifiaddprofile", B, A)
},
connectWifiOffLoad: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/wlan/wifidial", B, A)
},
getWifiOffLoadList: function (B) {
var A = {
type: "GET"
};
q("api/wlan/wifiscanresult", B, A)
},
getHostList: function (B) {
var A = {
type: "GET"
};
q("api/wlan/host-list", function (C, E) {
if (C) {
var D = E.value.Hosts.Host;
if (D && !$.isArray(D)) {
E.value.Hosts.Host = [];
E.value.Hosts.Host.push(D)
}
}
B(C, E)
}, A)
},
getMacFilter: function (B) {
var A = {
type: "GET"
};
q("api/wlan/mac-filter", B, A)
},
setMacFilter: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/wlan/mac-filter", B, A)
},
getWifiInformation: function (B) {
var A = {
type: "GET"
};
q("api/wlan/station-information", B, A)
},
getHandoverSetting: function (B) {
var A = {
type: "GET"
};
q("api/wlan/handover-setting", B, A)
},
setHandoverSetting: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/wlan/handover-setting", B, A)
},
getStaSimRelation: function (B) {
var A = {
type: "GET"
};
q("api/wlan/sta-sim-relation", B, A)
},
setWiFiScanState: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/wlan/wifiscan", B, A)
},
getWiFiScanState: function (B) {
var A = {
type: "GET"
};
q("api/wlan/wifiscan", B, A)
},
getWlanAutoCloseRemindState: function (B) {
var A = {
type: "GET"
};
q("api/wlan/wifi-time-remind", B, A)
},
setWlanAutoCloseRemindState: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/wlan/wifi-time-remind", B, A)
},
getWlanAutoCloseStatisticCount: function (B) {
var A = {
type: "GET"
};
q("api/wlan/wifi-time", B, A)
},
getWlanWifiFeatureSwitch: function (B) {
var A = {
type: "GET"
};
q("api/wlan/wifi-feature-switch", B, A)
},
getMultiMacfilterSettings: function (B) {
var A = {
type: "GET"
};
q("api/wlan/multi-macfilter-settings", function (C, D) {
if (C) {
var E = D.value.Ssids.Ssid;
if (E && !$.isArray(E)) {
D.value.Ssids.Ssid = [];
D.value.Ssids.Ssid.push(E)
}
}
B(C, D)
}, A)
},
setMultiMacfilterSettings: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/wlan/multi-macfilter-settings", B, A)
},
getWlanMultiBasicSettings: function (B) {
var A = {
type: "GET"
};
q("api/wlan/multi-basic-settings", function (C, D) {
if (C) {
var E = D.value.Ssids.Ssid;
if (E && !$.isArray(E)) {
D.value.Ssids.Ssid = [];
D.value.Ssids.Ssid.push(E)
}
}
B(C, D)
}, A)
},
setWlanMultiBasicSettings: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/wlan/multi-basic-settings", B, A)
},
getWlanMultiSwitchSettings: function (B) {
var A = {
type: "GET"
};
q("api/wlan/multi-switch-settings", B, A)
}
};
a.Security = {};
a.WebServer = {
getToken: function (B) {
var A = {
type: "GET"
};
q("api/webserver/token", B, A)
}
};
a.Dialup = {
DATA_SWITHCH_OFF: "0",
DATA_SWITHCH_ON: "1",
NETWORK_AUTO: "0",
NETWORK_MANUAL: "1",
getConnectionStatus: function (B) {
var A = {
type: "GET"
};
q("api/dialup/connection", B, A)
},
setConnectionStatus: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/dialup/connection", B, A)
},
getDialupMobileSwitch: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/dialup/mobile-dataswitch", function (C, D) {
B(C, D)
}, A)
},
setDialupMobileSwitch: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/dialup/mobile-dataswitch", B, A)
},
getDialupConnection: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/dialup/connection", function (C, D) {
B(C, D)
}, A)
},
setDialupConnection: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/dialup/connection", B, A)
},
getProfileInfomation: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/dialup/profiles", function (C, D) {
B(C, D)
}, A)
},
setProfileInfomation: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/dialup/profiles", B, A)
},
setDialInformation: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/dialup/dial", B, A)
},
getProfilesConfig: function (A) {
d(h.DIALUP_CONFIG_PAHT, function (B, C) {
if (B) {
A(true, C)
} else {
A(false)
}
})
}
};
a.UserManager = {
isLoginEnable: function (A) {
d(h.GLOBAL_CONFIG_PAHT, function (B, C) {
if (B) {
A("1" == C.value.login ? true : false)
} else {
A(false)
}
})
},
login: function (D, C) {
var A = $.extend({}, D);
A.Username = c(D.Username);
A.Password = a.Common.encodeBase64(D.Password);
var B = {
type: "POST",
data: w("request", A)
};
q("api/user/login", C, B)
},
logout: function (C) {
var A = g + "<request><Logout>1</Logout></request>";
var B = {
type: "POST",
data: A
};
q("api/user/logout", C, B)
},
getloginState: function (B) {
var A = {
type: "GET"
};
q("api/user/state-login", B, A)
},
modifyPassword: function (D, C) {
var A = $.extend({}, D);
A.CurrentPassword = a.Common.encodeBase64(D.CurrentPassword);
A.NewPassword = a.Common.encodeBase64(D.NewPassword);
var B = {
type: "POST",
data: w("request", A)
};
q("api/user/password", C, B)
},
sendHeartBeat: function (C) {
var A = g + "<request><keep>1</keep></request>";
var B = {
type: "POST",
data: A
};
q("api/user/session", C, B)
},
getPasswordRemind: function (B) {
var A = {
type: "GET"
};
q("api/user/remind", B)
},
setPasswordRemind: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/user/remind", B, A)
}
};
a.Language = {};
a.OnlineUpdate = {
checkNewVersion: function (B) {
var A = {
type: "POST"
};
q("api/online-update/check-new-version", B, A)
},
checkUpdateStatus: function (B) {
var A = {
type: "GET"
};
q("api/online-update/status", B, A)
},
displayNewVersionFoundInfo: function (B) {
var A = {
type: "GET"
};
q("api/online-update/url-list", B, A)
},
ackNewversion: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/online-update/ack-newversion", B, A)
},
cancelDownloading: function (B) {
var A = {
type: "POST"
};
q("api/online-update/cancel-downloading", B, A)
}
};
a.USSD = {};
a.Net = {
NETWORK_MODE_AUTO: "00",
NETWORK_MODE_GSM: "01",
NETWORK_MODE_WCDMA: "02",
NETWORK_MODE_LTE: "03",
NETWORK_MODE_CDMA_1X: "04",
NETWORK_MODE_TD_SCDMA: "05",
NETWORK_MODE_Wimax: "06",
NETWORK_MODE_CDMA_EVDO: "07",
NETWORK_MODE_NOTHING: "99",
NETWORK_MODE_AUTO_EX: "0",
NETWORK_MODE_GSM_PRE: "3",
NETWORK_MODE_WCDMA_PRE: "4",
NETWORK_MODE_LTE_ONLY: "5",
getNetCurrent: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/net/current-plmn", function (C, D) {
B(C, D)
}, A)
},
getNetModeEX: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/net/network", function (C, D) {
B(C, D)
}, A)
},
setNetModeEX: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/net/network", B, A)
},
getNetMode: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/net/net-mode", function (C, D) {
B(C, D)
}, A)
},
setNetMode: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/net/net-mode", B, A)
},
getNetModeList: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/net/net-mode-list", function (D, E) {
if (D) {
var C = E.value.AccessList.Access;
if (C && !$.isArray(C)) {
E.value.AccessList.Access = [];
E.value.AccessList.Access.push(C)
}
}
B(D, E)
}, A)
},
getRegister: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/net/register", function (C, D) {
B(C, D)
}, A)
},
setRegister: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/net/register", B, A)
},
getPlmnlist: function (B) {
var A = {
type: "GET",
timeout: z * 2
};
q("api/net/plmn-list", function (C, D) {
if (C) {
var E = D.value.Networks.Network;
if (E && !$.isArray(E)) {
D.value.Networks.Network = [];
D.value.Networks.Network.push(E)
}
}
B(C, D)
}, A)
},
getNetworkNetworkMode: function (A) {
d(h.NETWORK_NETWORKMODE_CONFIG_PATH, function (B, C) {
if (B) {
A(true, C);
var D = C.value.NetworkModes.Mode;
if (D && !$.isArray(D)) {
C.value.NetworkModes.Mode = [];
C.value.NetworkModes.Mode.push(D)
}
} else {
A(false)
}
})
},
getNetworkNetMode: function (A) {
d(h.NETWORK_NETMODE_CONFIG_PATH, function (B, C) {
if (B) {
A(true, C)
} else {
A(false)
}
})
}
};
a.SMS = {
getSMSCount: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/sms/sms-count", B, A)
},
getSMSList: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/sms/sms-list", B, A)
},
setReadSMS: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/sms/set-read", B, A)
},
deleteSMS: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/sms/delete-sms", B, A)
},
sendSMS: function (C, B) {
C.Content = c(C.Content);
var A = {
type: "POST",
data: w("request", C)
};
q("api/sms/send-sms", B, A)
},
getSMSSendStatus: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/sms/send-status", B, A)
},
getSMSConvertType: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/sms/splitinfo-sms", B, A)
},
getSMSCharLanguage: function (A) {
d(h.DEVICE_SMS_CODE_TYPE_PAHT, function (B, C) {
if (B) {
A(true, C)
} else {
A(false)
}
})
}
};
a.SDCard = {
checkSdCard: function (B) {
var A = {
type: "GET"
};
q("api/sdcard/sdcard", B, A)
},
getSdCardCapacity: function (B) {
var A = {
type: "GET"
};
q("api/sdcard/sdcapacity", B, A)
},
getFolderlist: function (D, C, B) {
D.CurrentPath = c(D.CurrentPath);
var A = {
type: "POST",
timeout: z,
force: true,
data: w("request", D)
};
q("api/sdcard/sdfile", function (E, G) {
if (E) {
var F = G.value.FileList.File;
if (F && !$.isArray(F)) {
G.value.FileList.File = [];
G.value.FileList.File.push(F)
}
}
C(E, G)
}, A)
},
deleteFileList: function (C, B) {
C.CurrentPath = c(C.CurrentPath);
C.DeleteFileList = c(C.DeleteFileList);
var A = {
type: "POST",
data: w("request", C)
};
q("api/sdcard/deletefile", B, A)
},
setSdCardModeToWebShare: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/sdcard/sdcard", B, A)
}
};
a.HostInfo = {
setHostInfo: function (F) {
var A = new Date();
var E = function (M) {
if (isNaN(M)) {
return 0
}
return M > 9 ? M : "0" + M
};
var K = A.getFullYear();
var J = A.getMonth() + 1;
var L = A.getDate();
var G = A.getHours();
var D = A.getMinutes();
var B = A.getSeconds();
var C = K.toString() + E(J).toString() + E(L).toString() + E(G).toString() + E(D).toString() + E(B).toString();
var H = {
Time: C,
Platform: navigator.platform,
PlatforVer: navigator.userAgent,
Navigator: navigator.appVersion,
NavigatorVer: navigator.userAgent
};
var I = {
type: "POST",
data: w("request", H)
};
q("api/host/info", F, I)
}
};
a.FileTransfer = {};
a.Redirection = {};
a.Global = {
setStorageItem: function (C, B) {
var A = {
type: "POST",
data: g + "<config>" + k("setting", C) + "</config>"
};
q("api/global/storage-setitem", B, A)
},
getStorageItem: function (C, B) {
var A = {
type: "POST",
data: g + "<config>" + k("setting", C) + "</config>"
};
q("api/global/storage-getitem", function (D, F) {
if (D) {
var E = F.value.setting;
if (E && !$.isArray(E)) {
F.value.setting = [];
F.value.setting.push(E)
}
}
B(D, F)
}, A)
},
getModuleSwitch: function (B) {
var A = {
type: "GET"
};
q("api/global/module-switch", B, A)
},
isBatteryEnable: function (A) {
d(h.GLOBAL_CONFIG_PAHT, function (B, C) {
if (B) {
A("1" == C.value.battery_enabled ? true : false)
} else {
A(false)
}
})
},
isProfileAPNEnable: function (A) {
d(h.GLOBAL_CONFIG_PAHT, function (B, C) {
if (B) {
A("1" == C.value.autoapn_enabled ? true : false)
} else {
A(false)
}
})
},
getDeviceConfig: function (A) {
d(h.DEVICE_INFORMATION_CONFIG_PAHT, function (B, C) {
if (B) {
A(true, C)
} else {
A(false)
}
})
},
getGlobalNetType: function (A) {
d(h.GLOBAL_NET_TYPE_CONFIG_PAHT, function (B, C) {
if (B) {
A(true, C)
} else {
A(false)
}
})
}
};
a.IMSI = {};
a.OTA = {};
a.SNTP = {};
a.STK = {};
a.Phonebook = {};
a.Wimax = {
getWimaxStauts: function (B) {
var A = {
type: "GET"
};
q("api/wimax/status", B, A)
}
};
a.Vsim = {
getVsimStatus: function (B) {
var A = {
type: "GET"
};
q("api/vsim/operateswitch-vsim", B, A)
},
setVsimStatus: function (C, B) {
var A = {
type: "POST",
data: w("request", C)
};
q("api/vsim/operateswitch-vsim", B, A)
}
};
a.Cradle = {
getCradleStatus: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/cradle/status-info", B, A)
},
getCradleInfo: function (B) {
var A = $.extend({
type: "GET"
}, {});
q("api/cradle/basic-info", B, A)
},
setCradleInfo: function (D, C) {
var A = $.extend({}, D);
A.pppoeuser = c(D.pppoeuser);
A.pppoepwd = c(D.pppoepwd);
var B = {
type: "POST",
data: w("request", A)
};
q("api/cradle/basic-info", C, B)
}
};
this.HWDevice = a
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment