Skip to content

Commit

Permalink
Updated Deprecated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
xobe19 committed Mar 22, 2022
1 parent 0f3674b commit db778fd
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 137 deletions.
7 changes: 7 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,10 @@ dependencies {
implementation 'com.google.firebase:firebase-analytics'
implementation 'androidx.multidex:multidex:2.0.0'
}
android {
compileSdkVersion 31

defaultConfig {
minSdkVersion 19 // This over here
}
}
4 changes: 2 additions & 2 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
},
"oauth_client": [
{
"client_id": "3055511017-coq9vh47e632eolatqd9s8d1oo0ag4mn.apps.googleusercontent.com",
"client_id": "3055511017-vephb2ob5drqpnv24g9vu1jvss37s22c.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.xobe19.rythm",
"certificate_hash": "31d4a0a68db0b82d3395af2403653c1010fc51c5"
"certificate_hash": "d86039afb603532e229ca47245ad010a19f2498c"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
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()
Expand Down
52 changes: 43 additions & 9 deletions lib/api/api.dart
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);
}
}
62 changes: 46 additions & 16 deletions lib/models/currentPlaylist.dart
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
import 'dart:typed_data';

import 'package:audioplayer/audioplayer.dart';
import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:des_plugin/des_plugin.dart';
import '../api/api.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
import 'package:des_plugin/des_plugin.dart';
import 'package:flutter_des/flutter_des.dart';
import '../models/getSongsInPlaylist.dart';
import 'package:firebase_auth/firebase_auth.dart';
import '../models/doesSongExistinPlaylist.dart';
import 'package:locally/locally.dart';
import '../screens/songScreen.dart';
import '../screens/downloadSongScreen.dart';

const String key = '38346591';

class CurrentPlaylist extends ChangeNotifier {
var fromDownload;
var context;
var locally;
CurrentPlaylist(BuildContext ctx) {
this.context = ctx;
this.locally = Locally(context: context, pageRoute: MaterialPageRoute(builder: (BuildContext context) {
if(fromDownload==true) {
return DownloadSongScreen();
}
return SongScreen();
}), appIcon: 'mipmap/ic_launcher', payload: 'test', );
}
var fromDownload;
var context;
var locally;
CurrentPlaylist(BuildContext ctx) {
this.context = ctx;
this.locally = Locally(
context: context,
pageRoute: MaterialPageRoute(builder: (BuildContext context) {
if (fromDownload == true) {
return DownloadSongScreen();
}
return SongScreen();
}),
appIcon: 'mipmap/ic_launcher',
payload: 'test',
);
}
int downloadLength;
List snpsht;
String playlistId;
Expand Down Expand Up @@ -87,11 +95,33 @@ class CurrentPlaylist extends ChangeNotifier {
}

Future<String> getDecryptedUrl() async {
print(
"-=======================================================================");
print(this.jsonData['songs'][this.currentPlaying]['encrypted_media_url']);
print(
"-=======================================================================");

return DesPlugin.decrypt(key,
this.jsonData['songs'][this.currentPlaying]['encrypted_media_url']);
}

Future<String> getDecryptedUrlWithString(String enc) async {
return DesPlugin.decrypt(key, enc);
Future<String> getDecryptedUrlWithString(String source) async {
var list = new List<int>();
source.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);
return DesPlugin.decrypt(key, source);
}
}
Loading

0 comments on commit db778fd

Please sign in to comment.