-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy path_functions.php
More file actions
113 lines (98 loc) · 3.01 KB
/
_functions.php
File metadata and controls
113 lines (98 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
error_reporting(0);
date_default_timezone_set('Asia/Kolkata');
function api_res($status, $code, $message, $data)
{
header("Content-Type: application/json");
if($status == "success" || $status == "error")
{
if($status == "error"){ $data = array(); }
$out = array('status' => $status, 'code' => $code, 'message' => $message, 'data' => $data);
exit(print(json_encode($out)));
}
else
{
http_response_code(500);
exit('Fatal Error');
}
}
function device_id()
{
$rando = md5(rand(0, 9).rand(0, 9).time().rand(0, 9).rand(0, 9));
if(!file_exists('secure/_androidID'))
{
@file_put_contents('secure/_androidID', $rando);
}
else
{
$getDDId = @file_get_contents('secure/_androidID');
if(empty($getDDId))
{
@file_put_contents('secure/_androidID', $rando);
}
}
}
function secure_values($action, $data)
{
$protec = "";
$method = 'AES-128-CBC';
$ky = 'joincodecrafters';
if(file_exists('secure/_androidID'))
{
$getDevID = @file_get_contents('secure/_androidID');
if(!empty($getDevID))
{
$DEVICE_ID = $getDevID;
}
}
$iv = substr(sha1($ky.'coolapps'.$DEVICE_ID), 0, 16);
if($action == "encrypt")
{
$encrypted = openssl_encrypt($data, $method, $ky, OPENSSL_RAW_DATA, $iv);
if(!empty($encrypted))
{
$protec = bin2hex($encrypted);
}
}
else
{
$decrypted = openssl_decrypt(hex2bin($data), $method, $ky, OPENSSL_RAW_DATA, $iv);
if(!empty($decrypted))
{
$protec = $decrypted;
}
}
return $protec;
}
//--------------------------------------------------------------------------//
$DEVICE_ID = '';
device_id();
if(file_exists('secure/_androidID'))
{
$getDevID = @file_get_contents('secure/_androidID');
if(!empty($getDevID))
{
$DEVICE_ID = $getDevID;
}
}
if(file_exists('secure/_sessionData'))
{
$getUData = @file_get_contents('secure/_sessionData');
$decUData = secure_values('decrypt', $getUData);
//Tata Play Data
$TATA_DATA = @json_decode($decUData, true);
$TPAUTH = array('access_token' => $TATA_DATA['data']['accessToken'],
'refresh_token' => $TATA_DATA['data']['refreshToken'],
'subscriberID' => $TATA_DATA['data']['userDetails']['sid'],
'subscriberRMN' => $TATA_DATA['data']['userDetails']['rmn'],
'subscriberNAME' => $TATA_DATA['data']['userDetails']['sName'],
'profileID' => $TATA_DATA['data']['userProfile']['id'],
'deviceName' => $TATA_DATA['data']['deviceDetails']['deviceName'],
'entitlements' => $TATA_DATA['data']['userDetails']['entitlements']);
}
//---------------------------------------------------------------------------//
function genjwtpayload($epid)
{
return '{"action":"stream","epids":[{"epid":"Subscription","bid":"'.$epid.'"}]}';
}
?>