Commit d63cc5f9478a7c0467cc38b03ceffade86c0f1b9

Authored by Guillermo López
1 parent 7d5bbfeb60

Registry updated to latest version

Showing 4 changed files with 44 additions and 30 deletions

dist/coseme.js View file @ d63cc5f
... ... @@ -3362,10 +3362,10 @@
3362 3362  
3363 3363 tokenData: {
3364 3364  
3365   - "v": "2.11.378",
  3365 + "v": "2.11.431",
3366 3366 // should be tokenData[d] + - + tokenData[v] + - + port
3367   - "r": "Android-2.11.378-5222",
3368   - "u": "WhatsApp/2.11.378 Android/4.3 Device/GalaxyS3",
  3367 + "r": "Android-2.11.431-5222",
  3368 + "u": "WhatsApp/2.11.431 Android/4.3 Device/GalaxyS3",
3369 3369 "t": "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk1377032097395{phone}",
3370 3370 "d": "Android"
3371 3371 },
... ... @@ -5780,7 +5780,7 @@
5780 5780 var signature = atob(
5781 5781 'MIIDMjCCAvCgAwIBAgIETCU2pDALBgcqhkjOOAQDBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFDASBgNVBAcTC1NhbnRhIENsYXJhMRYwFAYDVQQKEw1XaGF0c0FwcCBJbmMuMRQwEgYDVQQLEwtFbmdpbmVlcmluZzEUMBIGA1UEAxMLQnJpYW4gQWN0b24wHhcNMTAwNjI1MjMwNzE2WhcNNDQwMjE1MjMwNzE2WjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEUMBIGA1UEBxMLU2FudGEgQ2xhcmExFjAUBgNVBAoTDVdoYXRzQXBwIEluYy4xFDASBgNVBAsTC0VuZ2luZWVyaW5nMRQwEgYDVQQDEwtCcmlhbiBBY3RvbjCCAbgwggEsBgcqhkjOOAQBMIIBHwKBgQD9f1OBHXUSKVLfSpwu7OTn9hG3UjzvRADDHj+AtlEmaUVdQCJR+1k9jVj6v8X1ujD2y5tVbNeBO4AdNG/yZmC3a5lQpaSfn+gEexAiwk+7qdf+t8Yb+DtX58aophUPBPuD9tPFHsMCNVQTWhaRMvZ1864rYdcq7/IiAxmd0UgBxwIVAJdgUI8VIwvMspK5gqLrhAvwWBz1AoGBAPfhoIXWmz3ey7yrXDa4V7l5lK+7+jrqgvlXTAs9B4JnUVlXjrrUWU/mcQcQgYC0SRZxI+hMKBYTt88JMozIpuE8FnqLVHyNKOCjrh4rs6Z1kW6jfwv6ITVi8ftiegEkO8yk8b6oUZCJqIPf4VrlnwaSi2ZegHtVJWQBTDv+z0kqA4GFAAKBgQDRGYtLgWh7zyRtQainJfCpiaUbzjJuhMgo4fVWZIvXHaSHBU1t5w//S0lDK2hiqkj8KpMWGywVov9eZxZy37V26dEqr/c2m5qZ0E+ynSu7sqUD7kGx/zeIcGT0H+KAVgkGNQCo5Uc0koLRWYHNtYoIvt5R3X6YZylbPftF/8ayWTALBgcqhkjOOAQDBQADLwAwLAIUAKYCp0d6z4QQdyN74JDfQ2WCyi8CFDUM4CaNB+ceVXdKtOrNTQcc0e+t'
5782 5782 );
5783   - var classesMd5 = atob('oCtjlSonS+4H16h9HW6nNA==');
  5783 + var classesMd5 = atob('6AFrxlvRhUKoSxdMjnYATg==');
5784 5784 var key2 = atob('/UIGKU1FVQa+ATM2A0za7G2KI9S/CwPYjgAbc67v7ep42eO/WeTLx1lb1cHwxpsEgF4+PmYpLd2YpGUdX/A2JQitsHzDwgcdBpUf7psX1BU=');
5785 5785 var data = CryptoJS.enc.Latin1.parse(signature + classesMd5 + phone);
5786 5786  
5787 5787  
5788 5788  
5789 5789  
5790 5790  
... ... @@ -5801,26 +5801,33 @@
5801 5801 }
5802 5802  
5803 5803 function getRealDeviceId(aSeed) {
5804   - var seed = aSeed || (Math.random() * 1e16).toString(36).substring(2,10);
5805   - var id = CryptoJS.SHA1(seed).toString(CryptoJS.enc.Latin1).substring(0,20);
  5804 + var seed = aSeed || (Math.random() * 1e16).toString(36).substring(2, 10);
  5805 + var id = CryptoJS.SHA1(seed).toString(CryptoJS.enc.Latin1).substring(0, 20);
5806 5806 return {
5807 5807 seed: seed,
5808 5808 id: id
5809 5809 };
5810 5810 }
5811 5811  
  5812 + function pad(n, width, z) {
  5813 + z = z || '0';
  5814 + n = n + '';
  5815 + return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
  5816 + }
  5817 +
5812 5818 return {
5813   - getCode: function(countryCode, phone, onready, onerror, deviceId) {
  5819 + getCode: function(countryCode, phone, onready, onerror, deviceId, mcc, mnc, locale) {
5814 5820 var params = Object.create(null);
5815 5821 params['cc'] = countryCode;
5816 5822 params['in'] = phone;
5817   - params['lc'] = 'US';
5818   - params['lg'] = 'en';
5819   - params['mcc'] = '000';
5820   - params['mnc'] = '000';
  5823 + params['lc'] = 'zz';
  5824 + params['lg'] = locale.split('-')[0] || 'en';
  5825 + params['sim_mcc'] = pad(mcc, 3);
  5826 + params['sim_mnc'] = pad(mnc, 3);
5821 5827 params['method'] = 'sms';
5822 5828 var seedAndId = getRealDeviceId(deviceId);
5823 5829 params['id'] = seedAndId.id;
  5830 + params['reason'] = 'self-send-jailbroken';
5824 5831  
5825 5832 // Get token
5826 5833 params['token'] = getToken(phone);
dist/coseme.min.js View file @ d63cc5f

No preview for this file type

src/common/config.js View file @ d63cc5f
... ... @@ -10,10 +10,10 @@
10 10  
11 11 tokenData: {
12 12  
13   - "v": "2.11.378",
  13 + "v": "2.11.431",
14 14 // should be tokenData[d] + - + tokenData[v] + - + port
15   - "r": "Android-2.11.378-5222",
16   - "u": "WhatsApp/2.11.378 Android/4.3 Device/GalaxyS3",
  15 + "r": "Android-2.11.431-5222",
  16 + "u": "WhatsApp/2.11.431 Android/4.3 Device/GalaxyS3",
17 17 "t": "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk1377032097395{phone}",
18 18 "d": "Android"
19 19 },
src/http/registration.js View file @ d63cc5f
... ... @@ -5,7 +5,7 @@
5 5 var signature = atob(
6 6 'MIIDMjCCAvCgAwIBAgIETCU2pDALBgcqhkjOOAQDBQAwfDELMAkGA1U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esMd5 = atob('oCtjlSonS+4H16h9HW6nNA==');
  8 + var classesMd5 = atob('6AFrxlvRhUKoSxdMjnYATg==');
9 9 var key2 = atob('/UIGKU1FVQa+ATM2A0za7G2KI9S/CwPYjgAbc67v7ep42eO/WeTLx1lb1cHwxpsEgF4+PmYpLd2YpGUdX/A2JQitsHzDwgcdBpUf7psX1BU=');
10 10 var data = CryptoJS.enc.Latin1.parse(signature + classesMd5 + phone);
11 11  
12 12  
13 13  
14 14  
15 15  
... ... @@ -26,26 +26,33 @@
26 26 }
27 27  
28 28 function getRealDeviceId(aSeed) {
29   - var seed = aSeed || (Math.random() * 1e16).toString(36).substring(2,10);
30   - var id = CryptoJS.SHA1(seed).toString(CryptoJS.enc.Latin1).substring(0,20);
  29 + var seed = aSeed || (Math.random() * 1e16).toString(36).substring(2, 10);
  30 + var id = CryptoJS.SHA1(seed).toString(CryptoJS.enc.Latin1).substring(0, 20);
31 31 return {
32 32 seed: seed,
33 33 id: id
34 34 };
35 35 }
36 36  
  37 + function pad(n, width, z) {
  38 + z = z || '0';
  39 + n = n + '';
  40 + return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
  41 + }
  42 +
37 43 return {
38   - getCode: function(countryCode, phone, onready, onerror, deviceId) {
  44 + getCode: function(countryCode, phone, onready, onerror, deviceId, mcc, mnc, locale) {
39 45 var params = Object.create(null);
40 46 params['cc'] = countryCode;
41 47 params['in'] = phone;
42   - params['lc'] = 'US';
43   - params['lg'] = 'en';
44   - params['mcc'] = '000';
45   - params['mnc'] = '000';
  48 + params['lc'] = 'zz';
  49 + params['lg'] = locale.split('-')[0] || 'en';
  50 + params['sim_mcc'] = pad(mcc, 3);
  51 + params['sim_mnc'] = pad(mnc, 3);
46 52 params['method'] = 'sms';
47 53 var seedAndId = getRealDeviceId(deviceId);
48 54 params['id'] = seedAndId.id;
  55 + params['reason'] = 'self-send-jailbroken';
49 56  
50 57 // Get token
51 58 params['token'] = getToken(phone);