Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfteam committed Jul 10, 2022
1 parent 32871b4 commit 54ec343
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/application/url_page/url_page_bloc.dart
Expand Up @@ -14,7 +14,7 @@ part 'url_page_state.dart';

class UrlPageBloc extends Bloc<UrlPageEvent, UrlPageState> {
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';

Expand Down
8 changes: 3 additions & 5 deletions 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';
Expand Down Expand Up @@ -62,10 +61,9 @@ class DeviceInfoServiceImpl implements DeviceInfoService {
}

Future<void> _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',
Expand Down
34 changes: 33 additions & 1 deletion lib/presentation/map/map_page.dart
Expand Up @@ -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();
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion run_build_windows.sh
Expand Up @@ -5,4 +5,4 @@ echo 'Building windows app...'
flutter build windows

echo 'Creating windows installer...'
flutter pub run msix:create
flutter pub run msix:create --build-windows false

0 comments on commit 54ec343

Please sign in to comment.