Skip to content

Commit

Permalink
Removed AudioTags Package, after using this package app was flagged a…
Browse files Browse the repository at this point in the history
…s Trogen on VirusTotal #122
  • Loading branch information
anandnet committed Dec 31, 2023
1 parent bbd3c8b commit eaa9509
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 162 deletions.
47 changes: 24 additions & 23 deletions lib/services/downloader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'dart:async';
import 'dart:io';

import 'package:audio_service/audio_service.dart';
import 'package:audiotags/audiotags.dart';
//import 'package:audiotags/audiotags.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
//import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:harmonymusic/ui/screens/playlistnalbum_screen_controller.dart';
import 'package:hive/hive.dart';
Expand All @@ -15,8 +15,8 @@ import '/ui/screens/settings_screen_controller.dart';
import '/utils/helper.dart';
import '/models/media_Item_builder.dart';
import '/services/music_service.dart';
import '/ui/utils/home_library_controller.dart';
import '../models/thumbnail.dart' as th;
import '../ui/utils/home_library_controller.dart';
//import '../models/thumbnail.dart' as th;

class Downloader extends GetxService {
MediaItem? currentSong;
Expand Down Expand Up @@ -52,7 +52,7 @@ class Downloader extends GetxService {
if (!(await checkPermissionNDir())) return;

// for toggle between downloading request & cancelling
if(playlistQueue.containsKey(playlistId)){
if (playlistQueue.containsKey(playlistId)) {
songQueue.removeWhere((element) => songList.contains(element));
playlistQueue.remove(playlistId);
return;
Expand Down Expand Up @@ -174,24 +174,25 @@ class Downloader extends GetxService {
Get.find<LibrarySongsController>().librarySongsList.add(song);
printINFO("Downloaded successfully");
try {
final imageUrl = th.Thumbnail(song.artUri!.toString()).sizewith(540);
Tag tag = Tag(
title: song.title,
trackArtist: song.artist,
album: song.album,
albumArtist: song.artist,
genre: song.genre,
pictures: [
Picture(
bytes: (await NetworkAssetBundle(Uri.parse((imageUrl)))
.load(imageUrl))
.buffer
.asUint8List(),
mimeType: MimeType.none,
pictureType: PictureType.coverFront)
]);

await AudioTags.write(filePath, tag);
/// Removed AudioTags as using this package, app is flagged as TROJ_GEN.R002V01K623 by TrendMicro-HouseCall
// final imageUrl = th.Thumbnail(song.artUri!.toString()).sizewith(540);
// Tag tag = Tag(
// title: song.title,
// trackArtist: song.artist,
// album: song.album,
// albumArtist: song.artist,
// genre: song.genre,
// pictures: [
// Picture(
// bytes: (await NetworkAssetBundle(Uri.parse((imageUrl)))
// .load(imageUrl))
// .buffer
// .asUint8List(),
// mimeType: MimeType.none,
// pictureType: PictureType.coverFront)
// ]);

// await AudioTags.write(filePath, tag);
} catch (e) {
printERROR("$e");
}
Expand Down
4 changes: 0 additions & 4 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@

#include "generated_plugin_registrant.h"

#include <audiotags/audiotags_plugin.h>
#include <device_equalizer/device_equalizer_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) audiotags_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "AudiotagsPlugin");
audiotags_plugin_register_with_registrar(audiotags_registrar);
g_autoptr(FlPluginRegistrar) device_equalizer_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DeviceEqualizerPlugin");
device_equalizer_plugin_register_with_registrar(device_equalizer_registrar);
Expand Down
1 change: 0 additions & 1 deletion linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
audiotags
device_equalizer
url_launcher_linux
)
Expand Down
128 changes: 0 additions & 128 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.4.5"
archive:
dependency: transitive
description:
name: archive
sha256: "7e0d52067d05f2e0324268097ba723b71cb41ac8a6a2b24d1edf9c536b987b03"
url: "https://pub.dev"
source: hosted
version: "3.4.6"
args:
dependency: transitive
description:
name: args
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
url: "https://pub.dev"
source: hosted
version: "2.4.2"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -73,14 +57,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.1"
audiotags:
dependency: "direct main"
description:
name: audiotags
sha256: f153a109ce39b37c95f773b27948d1acdcdbe943e686871ef4af631bf11b3596
url: "https://pub.dev"
source: hosted
version: "1.3.0"
boolean_selector:
dependency: transitive
description:
Expand All @@ -89,14 +65,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
build_cli_annotations:
dependency: transitive
description:
name: build_cli_annotations
sha256: b59d2769769efd6c9ff6d4c4cede0be115a566afc591705c2040b707534b1172
url: "https://pub.dev"
source: hosted
version: "2.1.0"
cached_network_image:
dependency: "direct main"
description:
Expand Down Expand Up @@ -145,14 +113,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.17.2"
convert:
dependency: transitive
description:
name: convert
sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592"
url: "https://pub.dev"
source: hosted
version: "3.1.1"
cross_file:
dependency: transitive
description:
Expand Down Expand Up @@ -303,14 +263,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.17"
flutter_rust_bridge:
dependency: transitive
description:
name: flutter_rust_bridge
sha256: "2d31289a022f8b0a97e952d553686c50dff2ed5b58ac03628a13bc8cdf5f8ece"
url: "https://pub.dev"
source: hosted
version: "1.82.3"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -433,14 +385,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.0"
logging:
dependency: transitive
description:
name: logging
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -609,30 +553,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.6"
pointycastle:
dependency: transitive
description:
name: pointycastle
sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c"
url: "https://pub.dev"
source: hosted
version: "3.7.3"
pool:
dependency: transitive
description:
name: pool
sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a"
url: "https://pub.dev"
source: hosted
version: "1.5.1"
puppeteer:
dependency: transitive
description:
name: puppeteer
sha256: "59e723cc5b69537159a7c34efd645dc08a6a1ac4647d7d7823606802c0f93cdb"
url: "https://pub.dev"
source: hosted
version: "3.2.0"
rxdart:
dependency: transitive
description:
Expand Down Expand Up @@ -666,30 +586,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.3.1"
shelf:
dependency: transitive
description:
name: shelf
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
url: "https://pub.dev"
source: hosted
version: "1.4.1"
shelf_static:
dependency: transitive
description:
name: shelf_static
sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e
url: "https://pub.dev"
source: hosted
version: "1.1.2"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
shimmer:
dependency: "direct main"
description:
Expand Down Expand Up @@ -783,14 +679,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.0"
tuple:
dependency: transitive
description:
name: tuple
sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151
url: "https://pub.dev"
source: hosted
version: "2.0.2"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -887,14 +775,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
url: "https://pub.dev"
source: hosted
version: "2.4.0"
win32:
dependency: transitive
description:
Expand All @@ -919,14 +799,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.3.0"
yaml:
dependency: transitive
description:
name: yaml
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
url: "https://pub.dev"
source: hosted
version: "3.1.2"
youtube_explode_dart:
dependency: "direct main"
description:
Expand Down
10 changes: 4 additions & 6 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: harmonymusic
description: A app for music streaming.
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
publish_to: "none" # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
Expand All @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.7.0+11

environment:
sdk: '>=3.1.5 <4.0.0'
sdk: ">=3.1.5 <4.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
Expand All @@ -31,7 +31,6 @@ dependencies:
flutter:
sdk: flutter


# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
#cupertino_icons: ^1.0.2
Expand Down Expand Up @@ -62,9 +61,9 @@ dependencies:
url: https://github.com/anandnet/sdk_int.git
ref: master
file_picker: ^6.0.0
audiotags: ^1.3.0
#audiotags: ^1.3.0
google_fonts: ^6.1.0

dev_dependencies:
flutter_test:
sdk: flutter
Expand All @@ -81,7 +80,6 @@ dev_dependencies:

# The following section is specific to Flutter packages.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
Expand Down

0 comments on commit eaa9509

Please sign in to comment.