-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
244 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
buildscript { | ||
ext.kotlin_version = '1.3.50' | ||
ext.kotlin_version = '1.6.10' | ||
repositories { | ||
google() | ||
jcenter() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,46 @@ | ||
import 'dart:convert'; | ||
import 'dart:typed_data'; | ||
import 'package:des_plugin/des_plugin.dart'; | ||
|
||
class Api { | ||
static const search_base_url = "https://www.jiosaavn.com/api.php?__call=autocomplete.get&_format=json&_marker=0&cc=in&includeMetaTags=1&query="; | ||
static const song_details_base_url = "https://www.jiosaavn.com/api.php?__call=song.getDetails&cc=in&_marker=0%3F_marker%3D0&_format=json&pids="; | ||
static const album_details_base_url = "https://www.jiosaavn.com/api.php?__call=content.getAlbumDetails&_format=json&cc=in&_marker=0%3F_marker%3D0&albumid="; | ||
static const playlist_details_base_url = "https://www.jiosaavn.com/api.php?__call=playlist.getDetails&_format=json&cc=in&_marker=0%3F_marker%3D0&listid="; | ||
static const lyrics_base_url = "https://www.jiosaavn.com/api.php?__call=lyrics.getLyrics&ctx=web6dot0&api_version=4&_format=json&_marker=0%3F_marker%3D0&lyrics_id="; | ||
static const key = '38346591'; | ||
static Future<String> decrypt(String jsonData) async { | ||
return await DesPlugin.decrypt(key, jsonData); | ||
} | ||
static const search_base_url = | ||
"https://www.jiosaavn.com/api.php?__call=autocomplete.get&_format=json&_marker=0&cc=in&includeMetaTags=1&query="; | ||
static const song_details_base_url = | ||
"https://www.jiosaavn.com/api.php?__call=song.getDetails&cc=in&_marker=0%3F_marker%3D0&_format=json&pids="; | ||
static const album_details_base_url = | ||
"https://www.jiosaavn.com/api.php?__call=content.getAlbumDetails&_format=json&cc=in&_marker=0%3F_marker%3D0&albumid="; | ||
static const playlist_details_base_url = | ||
"https://www.jiosaavn.com/api.php?__call=playlist.getDetails&_format=json&cc=in&_marker=0%3F_marker%3D0&listid="; | ||
static const lyrics_base_url = | ||
"https://www.jiosaavn.com/api.php?__call=lyrics.getLyrics&ctx=web6dot0&api_version=4&_format=json&_marker=0%3F_marker%3D0&lyrics_id="; | ||
static const key = '38346591'; | ||
static Future<String> decrypt(String jsonData) async { | ||
print( | ||
"-======================================================================="); | ||
print(jsonData); | ||
print( | ||
"-======================================================================="); | ||
var list = new List<int>(); | ||
jsonData.runes.forEach((rune) { | ||
if (rune >= 0x10000) { | ||
rune -= 0x10000; | ||
int firstWord = (rune >> 10) + 0xD800; | ||
list.add(firstWord >> 8); | ||
list.add(firstWord & 0xFF); | ||
int secondWord = (rune & 0x3FF) + 0xDC00; | ||
list.add(secondWord >> 8); | ||
list.add(secondWord & 0xFF); | ||
} else { | ||
list.add(rune >> 8); | ||
list.add(rune & 0xFF); | ||
} | ||
}); | ||
Uint8List bytes = Uint8List.fromList(list); | ||
print( | ||
"-======================================================================="); | ||
print(jsonData); | ||
print( | ||
"-======================================================================="); | ||
return await DesPlugin.decrypt(key, jsonData); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.