From 54ec34318a432a64b505b9586e75adc6f08f8459 Mon Sep 17 00:00:00 2001 From: Efrain Date: Sun, 10 Jul 2022 12:03:37 -0500 Subject: [PATCH] Minor changes --- lib/application/url_page/url_page_bloc.dart | 2 +- lib/infrastructure/device_info_service.dart | 8 ++--- lib/presentation/map/map_page.dart | 34 ++++++++++++++++++++- run_build_windows.sh | 2 +- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/lib/application/url_page/url_page_bloc.dart b/lib/application/url_page/url_page_bloc.dart index ff5e4e67d..d17f5abfe 100644 --- a/lib/application/url_page/url_page_bloc.dart +++ b/lib/application/url_page/url_page_bloc.dart @@ -14,7 +14,7 @@ part 'url_page_state.dart'; class UrlPageBloc extends Bloc { final wishSimulatorUrl = 'https://gi-wish-simulator.uzairashraf.dev'; - final officialMapUrl = 'https://webstatic-sea.mihoyo.com/app/ys-map-sea/index.html'; + final officialMapUrl = 'https://act.hoyolab.com/ys/app/interactive-map/index.html'; final unofficialMapUrl = 'https://genshin-impact-map.appsample.com'; final dailyCheckInUrl = 'https://webstatic-sea.mihoyo.com/ys/event/signin-sea/index.html?act_id=e202102251931481'; diff --git a/lib/infrastructure/device_info_service.dart b/lib/infrastructure/device_info_service.dart index b67b62871..4ab2ffc3d 100644 --- a/lib/infrastructure/device_info_service.dart +++ b/lib/infrastructure/device_info_service.dart @@ -1,7 +1,6 @@ import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; -import 'package:device_info_plus_windows/device_info_plus_windows.dart' as device_info_plus_windows; import 'package:flutter_user_agentx/flutter_user_agent.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:shiori/domain/services/device_info_service.dart'; @@ -62,10 +61,9 @@ class DeviceInfoServiceImpl implements DeviceInfoService { } Future _initForWindows() async { - final deviceInfo = device_info_plus_windows.DeviceInfoWindows(); - //TODO: DeviceInfoPlugin CRASHES ON WINDOWS - final info = await deviceInfo.windowsInfo(); - final model = info != null ? info.computerName : 'N/A'; + final deviceInfo = DeviceInfoPlugin(); + final info = await deviceInfo.windowsInfo; + final model = info.computerName; _deviceInfo = { 'Model': model, 'OsVersion': 'N/A', diff --git a/lib/presentation/map/map_page.dart b/lib/presentation/map/map_page.dart index bec0142f5..0a5a64e13 100644 --- a/lib/presentation/map/map_page.dart +++ b/lib/presentation/map/map_page.dart @@ -8,7 +8,7 @@ import 'package:shiori/presentation/shared/loading.dart'; const _script = ''' let wasRemoved = false; function removeAds(){ - //console.log("Removing ads.."); + console.log("Removing ads.."); let topNav = document.getElementById("topnav"); if (topNav) { topNav.remove(); @@ -44,10 +44,42 @@ const _script = ''' document.getElementsByClassName("mhy-hoyolab-app-header")[0].remove(); } } + + function removeAds2() { + const ad1 = document.getElementsByClassName('MapLayout_BottomAd'); + if (ad1.length > 0) + ad1[0].remove(); + + const ad2 = document.getElementsByClassName('MapLayout_BottomMobiAd'); + if (ad2.length > 0) + ad2[0].remove(); + + const appbars = document.getElementsByClassName('MuiAppBar-root'); + if (appbars.length > 0) + appbars[0].remove(); + + const buttons = document.getElementsByClassName('MuiTab-root'); + if (buttons.length > 0) { + buttons[2].remove(); + buttons[1].remove(); + } + + const extraButtons = document.getElementsByClassName('TopNav'); + if (extraButtons.length > 0) { + extraButtons[0].remove(); + extraButtons[1].remove(); + } + } + setTimeout(removeAds, 500); setTimeout(removeAds, 1000); setTimeout(removeAds, 2000); setTimeout(removeAds, 3500); + + setTimeout(removeAds2, 500); + setTimeout(removeAds2, 1000); + setTimeout(removeAds2, 2000); + setTimeout(removeAds2, 3500); '''; class MapPage extends StatelessWidget { diff --git a/run_build_windows.sh b/run_build_windows.sh index aa5745b47..93f612e81 100644 --- a/run_build_windows.sh +++ b/run_build_windows.sh @@ -5,4 +5,4 @@ echo 'Building windows app...' flutter build windows echo 'Creating windows installer...' -flutter pub run msix:create \ No newline at end of file +flutter pub run msix:create --build-windows false \ No newline at end of file