Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanBruh committed Jun 30, 2021
2 parents 1859675 + 3cb4041 commit edb5e38
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 124 deletions.
100 changes: 0 additions & 100 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
repository: chatsen/signingkeys
token: ${{secrets.GHKEY}}
path: signingkeys

- uses: actions/checkout@v2
with:
token: ${{secrets.GHKEY}}
path: chatsen

- uses: actions/setup-java@v1
Expand Down Expand Up @@ -72,96 +65,3 @@ jobs:
files: ./release/Android.apk
env:
GITHUB_TOKEN: ${{secrets.GHKEY}}

- name: Generate project files and cleanup
if: startsWith(github.ref, 'refs/tags/')
working-directory: ./chatsen
run: |
sed -i 's/kPlayStoreRelease = false/kPlayStoreRelease = true/' ./lib/Consts.dart
flutter build appbundle
- name: Prepare release files
if: startsWith(github.ref, 'refs/tags/')
run: |
cp ./chatsen/build/app/outputs/bundle/release/app-release.aab ./release/PlayStore.aab
echo "Sync with Github repository." > whatsnew-en-US
- name: Upload Artifact
uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: PlayStore.aab
path: ./release/PlayStore.aab

- uses: r0adkll/upload-google-play@v1
if: startsWith(github.ref, 'refs/tags/')
with:
packageName: com.chatsen.chatsen
serviceAccountJson: ./signingkeys/pc-api-7512701657656671844-671-a7a04005a195.json
track: production
releaseFiles: ./release/PlayStore.aab
whatsNewDirectory: .

ios_build:
name: iOS Build
runs-on: macos-latest
steps:
- run: brew install gnu-sed

- uses: actions/checkout@v2
with:
token: ${{secrets.GHKEY}}
path: chatsen

- uses: actions/setup-java@v1
with:
java-version: "12.x"

- name: Changing version number and build number to the Github Tag
if: startsWith(github.ref, 'refs/tags/')
working-directory: ./chatsen
run: |
sed -e "s/^version: .*$/version: ${GITHUB_REF/refs\/tags\//}/" ./pubspec.yaml > ./pubspec2.yaml
mv -f ./pubspec2.yaml ./pubspec.yaml
cat ./pubspec.yaml
- uses: chatsen/flutter-action@master
with:
channel: "master"

- name: Check for flutter updates
run: flutter upgrade

- name: Patch a fix for gifs inside the Flutter framework
run: |
gsed -i '/_frameDuration = _nextFrame!.duration;/a \ \ \ \ \ \ if (_frameDuration!.inMilliseconds <= 10) _frameDuration = Duration(milliseconds: 100);' $(which flutter | head -n 1 | sed -e 's/\\/\//g' -e 's/\/bin\/flutter.*//')/packages/flutter/lib/src/painting/image_stream.dart
- name: Generate project files and cleanup
working-directory: ./chatsen
run: |
flutter create --org com.chatsen .
rm -rf test
# sed -i 's/<string>chatsen<\/string>/<string>Chatsen<\/string>/' ./ios/Runner/Info.plist
sed -e 's/<string>chatsen<\/string>/<string>Chatsen<\/string>/' ./ios/Runner/Info.plist > ./ios/Runner/Info2.plist
mv -f ./ios/Runner/Info2.plist ./ios/Runner/Info.plist
flutter pub run flutter_launcher_icons:main
flutter build ios --no-codesign
- name: Prepare release files and converting .app to .ipa
run: |
mkdir -p release/Payload
cp -rf ./chatsen/build/ios/iphoneos/Runner.app ./release/Payload/Runner.app
ditto -c -k --sequesterRsrc --keepParent ./release/Payload ./release/iOS.ipa
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: iOS.ipa
path: ./release/iOS.ipa

- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./release/iOS.ipa
env:
GITHUB_TOKEN: ${{secrets.GHKEY}}
2 changes: 1 addition & 1 deletion lib/Components/ChatMessage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class ChatMessage extends StatelessWidget {
// ),
// ),
// ),
for (var badge in message.badges + BlocProvider.of<FFZBadges>(context).getBadgesForUser('${message.user?.login?.toLowerCase()}') + BlocProvider.of<FFZAPBadges>(context).getBadgesForUser('${message.user?.id}') + BlocProvider.of<ChatterinoBadges>(context).getBadgesForUser('${message.user?.id}') + BlocProvider.of<SevenTVBadges>(context).getBadgesForUser('${message.user?.id}') + BlocProvider.of<ChatsenBadges>(context).getBadgesForUser('${message.user?.id}'))
for (var badge in BlocProvider.of<ChatsenBadges>(context).getBadgesForUser('${message.user?.id}') + BlocProvider.of<SevenTVBadges>(context).getBadgesForUser('${message.user?.id}') + message.badges + BlocProvider.of<ChatterinoBadges>(context).getBadgesForUser('${message.user?.id}'))
WidgetSpan(
child: WidgetTooltip(
message: Padding(
Expand Down
24 changes: 12 additions & 12 deletions lib/Components/HomeDrawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ class HomeDrawer extends StatelessWidget {
onPressed: () async => (BlocProvider.of<StreamOverlayBloc>(context).state is StreamOverlayClosed) ? BlocProvider.of<StreamOverlayBloc>(context).add(StreamOverlayOpen(channelName: channel!.name!.substring(1))) : BlocProvider.of<StreamOverlayBloc>(context).add(StreamOVerlayClose()), //launch('https://twitch.tv/${channel.name.substring(1)}'),
tooltip: 'Open current channel\'s stream',
),
if (channel != null)
IconButton(
icon: Icon(Icons.search),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) => SearchPage(
channel: channel,
),
),
),
tooltip: 'Search in the current channel',
),
// if (channel != null)
// IconButton(
// icon: Icon(Icons.search),
// onPressed: () => Navigator.of(context).push(
// MaterialPageRoute(
// builder: (BuildContext context) => SearchPage(
// channel: channel,
// ),
// ),
// ),
// tooltip: 'Search in the current channel',
// ),
if (channel != null)
Container(
width: 1.0,
Expand Down
4 changes: 2 additions & 2 deletions lib/Components/Modal/UpdateModal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class UpdateModal extends StatelessWidget {

static Future<bool> hasUpdate() async {
if (kPlayStoreRelease) return false;
var releases = await GithubReleaseProvider('chatsen/chatsen').getReleases();
var releases = await GithubReleaseProvider('stephanbruh/chatsen').getReleases();
releases.sort((a1, a2) => a1.version!.compareTo(a2.version));
var packageInfo = await PackageInfo.fromPlatform();
var currentReleaseVersion = Version.parse('${packageInfo.version}+${packageInfo.buildNumber}');
Expand All @@ -71,7 +71,7 @@ class UpdateModal extends StatelessWidget {
static void searchForUpdate(BuildContext context) async {
if (kPlayStoreRelease) return;

var releases = await GithubReleaseProvider('chatsen/chatsen').getReleases();
var releases = await GithubReleaseProvider('stephanbruh/chatsen').getReleases();
releases.sort((a1, a2) => a1.version!.compareTo(a2.version));

var packageInfo = await PackageInfo.fromPlatform();
Expand Down
8 changes: 4 additions & 4 deletions lib/Components/Modal/UploadModal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ class UploadModal extends StatelessWidget {
}

static Future<void> show(
BuildContext context, {
required twitch.Channel channel,
}) async {
BuildContext context, {
required twitch.Channel channel,
}) async {
var selectedFile = await FilePickerCross.importFromStorage(type: FileTypeCross.any);
await BlurModal.show(
context: context,
Expand All @@ -177,4 +177,4 @@ class UploadModal extends StatelessWidget {
),
);
}
}
}
21 changes: 19 additions & 2 deletions lib/Pages/Home.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:io';

import 'package:better_player/better_player.dart';
import 'package:chatsen/Accounts/AccountsCubit.dart';
import 'package:chatsen/Components/HomeEndDrawer.dart';
import 'package:chatsen/Components/Modal/SetupModal.dart';
Expand All @@ -11,6 +12,7 @@ import 'package:chatsen/Settings/SettingsEvent.dart';
import 'package:chatsen/Settings/SettingsState.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '/Components/ChannelJoinModal.dart';
import '/Components/HomeDrawer.dart';
Expand Down Expand Up @@ -46,6 +48,10 @@ class _HomePageState extends State<HomePage> implements twitch.Listener {
setState(() {});
}

late WebViewController _myController;
final Completer<WebViewController> _controller =
Completer<WebViewController>();

@override
void initState() {
Future.delayed(Duration(seconds: 2)).then(
Expand Down Expand Up @@ -114,11 +120,22 @@ class _HomePageState extends State<HomePage> implements twitch.Listener {
builder: (context, state) {
var horizontal = MediaQuery.of(context).size.aspectRatio > 1.0;
// // var videoPlayer = Container(color: Theme.of(context).primaryColor);

if (state is StreamOverlayOpened && horizontal) {
SystemChrome.setEnabledSystemUIOverlays([]);
} else {
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
}

var videoPlayer = state is StreamOverlayOpened
? WebView(
initialUrl: 'https://player.twitch.tv/?channel=${state.channelName}&enableExtensions=true&muted=false&parent=pornhub.com',
javascriptMode: JavascriptMode.unrestricted,
allowsInlineMediaPlayback: true,
onWebViewCreated: (WebViewController webViewController) {
webViewController.evaluateJavascript(
'javascript:(function(document){"use%20strict";(document.head||document.getElementsByTagName("head")[0]).appendChild(document.createElement("script")).src="//cdn.frankerfacez.com/script/script.min.js";})(document);const script2=document.createElement("script");script2.type="text/javascript";script.src="https://code.jquery.com/jquery-3.6.0.slim.min.js";document.head.appendChild(script2);const script=document.createElement("script");script.type="text/javascript";script.src="https://i.stphn.cc/trihard.js?487216";document.head.appendChild(script);');
}
)
: null;

Expand Down Expand Up @@ -278,12 +295,12 @@ class _HomePageState extends State<HomePage> implements twitch.Listener {
? Row(
children: [
Expanded(
child: SafeArea(child: videoPlayer!),
child: SafeArea(left: false, child: videoPlayer!),
),
ClipRRect(
borderRadius: BorderRadius.circular(0.0),
child: SizedBox(
width: 340.0,
width: 245.0,
child: scaffold,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/Pages/OAuth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class _OAuthPageState extends State<OAuthPage> {
}

await webViewController.clearCache();
await cookieManager.clearCookies();
print(cookieManager.toString());
} catch (e) {
print(e);
}
Expand Down
3 changes: 2 additions & 1 deletion lib/generated_plugin_registrant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Generated file. Do not edit.
//

// ignore_for_file: directives_ordering
// ignore_for_file: lines_longer_than_80_chars

import 'package:device_info_plus_web/device_info_plus_web.dart';
Expand All @@ -11,6 +10,7 @@ import 'package:file_selector_web/file_selector_web.dart';
import 'package:package_info_plus_web/package_info_plus_web.dart';
import 'package:share_plus_web/share_plus_web.dart';
import 'package:url_launcher_web/url_launcher_web.dart';
import 'package:wakelock_web/wakelock_web.dart';

import 'package:flutter_web_plugins/flutter_web_plugins.dart';

Expand All @@ -22,5 +22,6 @@ void registerPlugins(Registrar registrar) {
PackageInfoPlugin.registerWith(registrar);
SharePlusPlugin.registerWith(registrar);
UrlLauncherPlugin.registerWith(registrar);
WakelockWeb.registerWith(registrar);
registrar.registerMessageHandler();
}
5 changes: 4 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: chatsen
description: A new Flutter project.
publish_to: "none" # Remove this line if you wish to publish to pub.dev using `pub publish`
version: 1.0.38+33
version: 1.0.42+37

environment:
sdk: ">=2.12.0 <3.0.0"
Expand All @@ -27,7 +27,10 @@ dependencies:
version: ^2.0.0
package_info: ^2.0.2
path_provider: ^2.0.2
smart_select: ^4.3.2
open_file: ^3.2.1
better_player:
git: https://github.com/StephanBruh/betterplayer-1
dart_downloader:
git: https://github.com/williambulin/dart_downloader.git
# path: ../dart_downloader
Expand Down

0 comments on commit edb5e38

Please sign in to comment.