Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update 17.0.0 #679

Merged
merged 9 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
# set env variables
- name: set variables
run: |
echo "APK_URL=https://www.dropbox.com/scl/fi/eq9rvvhqsx7yiv5cnfhf7/twitch-16.9.1.apk\?rlkey=7q5pvwwjvl6nh5durgx74gp6d\&st=nmhes0u1\&dl=1" >> $GITHUB_ENV
echo "APK_URL=https://www.dropbox.com/scl/fi/jc7uhpvb2xa5094lcv0gr/twitch-17.0.0.apk\?rlkey=4wkiikz6wfbvvh9kiywvmivfb\&st=1fzwygd9\&dl=1" >> $GITHUB_ENV

# get keystore.kjs from secret
- name: create keystore.kjs from secret
Expand Down Expand Up @@ -98,4 +98,4 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bttv.apk
asset_name: bttv-${{ steps.version_tag.outputs.version_tag }}.apk
asset_content_type: application/vnd.android.package-archive
asset_content_type: application/vnd.android.package-archive
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

# master
- rebase to v17.0.0

# 0.41.0-beta
- rebase to v16.9.1

Expand Down
5 changes: 0 additions & 5 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ sed -i "s/android:text=\"BTTV .*\"/android:text=\"BTTV ${VERSION}\"/" $1/res/lay

cd $1

# Move classes2 to classes9
echo "Moving classes8 to classes9"
mv smali_classes8/com smali_classes9
mv smali_classes8/tv smali_classes9

APK_PATH=./dist/twitch.apk

# Build using APKTool
Expand Down
4 changes: 2 additions & 2 deletions buildsource
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TMP_DIR=app/build/.bttv_tmp
CONSUMER_APK=consumer/build/outputs/apk/release/consumer-release-unsigned.apk
DEX_FILE="$TMP_DIR/classes.dex"

FINAL_TARGET="../$TARGETDIR/smali_classes8"
FINAL_TARGET="../$TARGETDIR/smali_classes9"
RES_DIR="app/src/main/res"
RES_TARGET="../$TARGETDIR/res"
LIB_DIR="$TMP_DIR/lib"
Expand All @@ -54,7 +54,7 @@ rm -rf "$FINAL_TARGET/com"
mv "$TMP_DIR/bttv" "$FINAL_TARGET/."
mv "$TMP_DIR/com" "$FINAL_TARGET/."

rsync -ar --ignore-existing "$TMP_DIR/androidx/" "../$TARGETDIR/smali_classes8/androidx/"
rsync -ar --ignore-existing "$TMP_DIR/androidx/" "../$TARGETDIR/smali_classes9/androidx/"

# copy res
ls "$RES_DIR" -1 | grep -v values | xargs -i cp -R "$RES_DIR/{}" "$RES_TARGET"
Expand Down
15 changes: 4 additions & 11 deletions disassemble
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ dist
lib
assets/bttv_contributors.json
smali*/androidx
smali_classes8/bttv
smali_classes8/com
smali_classes9/bttv
smali_classes9/com
EOF
find ../../mod/app/src/main/res -type f | sed "s/..\/..\/mod\/app\/src\/main\///" >> .gitignore &&
echo "" >> .gitignore
Expand Down Expand Up @@ -145,15 +145,8 @@ sed -i "s/apkFileName: tv.twitch.android.app.apk/apkFileName: twitch.apk/" .tmp/
sed -i "s/apkFileName: base.apk/apkFileName: twitch.apk/" .tmp/base/apktool.yml

# fix full dex-files
mkdir .tmp/base/smali_classes8

# mkdir .tmp/base/smali_classes8/tv
# mkdir -p .tmp/base/smali_classes8/tv/twitch/android

# mv .tmp/base/smali_classes2/com/github .tmp/base/smali_classes8/com/github
# mv .tmp/base/smali_classes5/tv/twitch/android/network .tmp/base/smali_classes8/tv/twitch/android/network
# mv .tmp/base/smali_classes4/jp .tmp/base/smali_classes8/jp
# mv .tmp/base/smali_classes7/tv/gql .tmp/base/smali_classes8/tv/gql
mkdir .tmp/base/smali_classes9
# mv .tmp/base/smali_classes8/androidx .tmp/base/smali_classes9/.

#
# Create reference for diffs
Expand Down
2 changes: 1 addition & 1 deletion mod/app/src/main/java/bttv/Tokenizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import tv.twitch.android.shared.chat.pub.model.messages.MessageToken;
import tv.twitch.android.shared.chat.pub.model.messages.MessageToken.TextToken;
import tv.twitch.android.shared.chat.pub.model.messages.MessageToken.EmoticonToken;
import tv.twitch.android.shared.chat.pub.ChatMessageInterface;
import tv.twitch.android.shared.chat.pub.messages.ui.ChatMessageInterface;
import tv.twitch.android.shared.chat.ChatMessageDelegate;
import tv.twitch.chat.AutoModFlags;
import tv.twitch.chat.ChatEmoticonToken;
Expand Down
2 changes: 1 addition & 1 deletion mod/app/src/main/java/bttv/api/Blacklist.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import android.util.Log;

import tv.twitch.android.shared.chat.pub.ChatMessageInterface;
import tv.twitch.android.shared.chat.pub.messages.ui.ChatMessageInterface;
import tv.twitch.android.shared.chat.ChatMessageDelegate;

public class Blacklist {
Expand Down
2 changes: 1 addition & 1 deletion mod/app/src/main/java/bttv/api/Highlight.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import kotlin.jvm.functions.Function1;
import android.content.Context;
import tv.twitch.android.shared.chat.pub.ChatMessageInterface;
import tv.twitch.android.shared.chat.pub.messages.ui.ChatMessageInterface;

public class Highlight {
public static Integer replaceNum(ChatMessageInterface chatMessageInterface, boolean z, boolean z2, Function1<Context, Integer> function, int i, Object iClickableUsernameSpanListener, Object twitchUrlSpanClickListener, Object webViewSource, String str, boolean z3, Object chatFiltersSettings, Integer num) {
Expand Down
2 changes: 1 addition & 1 deletion mod/app/src/main/java/bttv/highlight/Highlight.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import bttv.ResUtil;
import bttv.settings.Settings;
import tv.twitch.android.shared.chat.ChatMessageDelegate;
import tv.twitch.android.shared.chat.pub.ChatMessageInterface;
import tv.twitch.android.shared.chat.pub.messages.ui.ChatMessageInterface;

public class Highlight extends StringSetUI {
private static Highlight INSTANCE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import tv.twitch.android.models.chat.MessageBadge;
import tv.twitch.android.shared.chat.pub.model.messages.MessageToken;
import tv.twitch.android.shared.chat.pub.ChatMessageInterface;
import tv.twitch.android.shared.chat.pub.messages.ui.ChatMessageInterface;
import tv.twitch.chat.ChatMessageInfo;

public class ChatMessageDelegate implements ChatMessageInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import tv.twitch.android.shared.chat.pub.model.ChatMessageTokenizerWrapper;
import tv.twitch.android.provider.experiments.ExperimentHelper;
import tv.twitch.android.sdk.SDKServicesController;
import tv.twitch.android.shared.chat.pub.ChatMessageInterface;
import tv.twitch.android.shared.chat.pub.messages.ui.ChatMessageInterface;
import tv.twitch.android.shared.chat.ChatMessageParser;

public class ChommentModelDelegate implements ChatMessageInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is a stub, so javac does not throw errors,
* it is not used in the patches.
*/
package tv.twitch.android.shared.chat.pub;
package tv.twitch.android.shared.chat.pub.messages.ui;

public interface ChatMessageInterface {
java.util.List<tv.twitch.android.models.chat.MessageBadge> getBadges();
Expand Down
2 changes: 1 addition & 1 deletion patches/AndroidManifest.xml.patch
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ diff --git a/AndroidManifest.xml b/AndroidManifest.xml
- <uses-permission android:name="tv.twitch.android.app.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"/>
+ <permission android:name="tv.twitch.bttvandroid.app.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" android:protectionLevel="signature"/>
+ <uses-permission android:name="tv.twitch.bttvandroid.app.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"/>
<application android:allowBackup="false" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:enabled="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:largeHeap="true" android:name="tv.twitch.android.app.consumer.TwitchApplication" android:networkSecurityConfig="@xml/default_security_config" android:requestLegacyExternalStorage="false" android:supportsRtl="true" android:theme="@style/Theme.TwitchApp">
<application android:allowBackup="false" android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:enabled="true" android:extractNativeLibs="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:largeHeap="true" android:name="tv.twitch.android.app.consumer.TwitchApplication" android:networkSecurityConfig="@xml/default_security_config" android:requestLegacyExternalStorage="false" android:supportsRtl="true" android:theme="@style/Theme.TwitchApp">
<profileable android:shell="true"/>
<meta-data android:name="WindowManagerPreference:FreeformWindowSize" android:value="phone"/>
@@ -178,15 +190,15 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/smali_classes5/tv/twitch/android/feature/viewer/main/navigation/ToolbarPresenter.smali b/smali_classes5/tv/twitch/android/feature/viewer/main/navigation/ToolbarPresenter.smali
--- a/smali_classes5/tv/twitch/android/feature/viewer/main/navigation/ToolbarPresenter.smali
+++ b/smali_classes5/tv/twitch/android/feature/viewer/main/navigation/ToolbarPresenter.smali
@@ -2563,6 +2563,10 @@
.line 419
@@ -2607,6 +2607,10 @@
.line 427
invoke-direct {p0, p1}, Ltv/twitch/android/feature/viewer/main/navigation/ToolbarPresenter;->updateSearchVisibilityForCreatorMode(Landroid/view/Menu;)V

+ # BTTV
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
diff --git a/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageFactory.smali b/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageFactory.smali
--- a/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageFactory.smali
+++ b/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMessageFactory.smali
@@ -1101,6 +1101,21 @@
@@ -1093,6 +1093,21 @@

invoke-static {v14, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V

+ # BTTV
+ # Add bttv emotes
+ # expects:
+ # v14: tv.twitch.android.shared.chat.pub.ChatMessageInterface;
+ invoke-static {v14}, Lbttv/Tokenizer;->retokenizeLiveChatMessage(Ltv/twitch/android/shared/chat/pub/ChatMessageInterface;)V
+ invoke-static {v14}, Lbttv/Tokenizer;->retokenizeLiveChatMessage(Ltv/twitch/android/shared/chat/pub/messages/ui/ChatMessageInterface;)V
+
+ # dont add if contians word on blocklist
+ invoke-static {v14}, Lbttv/api/Blacklist;->isBlocked(Ltv/twitch/android/shared/chat/pub/ChatMessageInterface;)Z
+ invoke-static {v14}, Lbttv/api/Blacklist;->isBlocked(Ltv/twitch/android/shared/chat/pub/messages/ui/ChatMessageInterface;)Z
+ move-result v0
+ if-eqz v0, :skipnullreturn
+ const/4 v0, 0x0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ diff --git a/smali_classes6/tv/twitch/android/shared/chat/messagefactory/ChatMes
:cond_3
+
+ # BTTV
+ invoke-static/range {p2 .. p13}, Lbttv/api/Highlight;->replaceNum(Ltv/twitch/android/shared/chat/pub/ChatMessageInterface;ZZLkotlin/jvm/functions/Function1;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;ZLjava/lang/Object;Ljava/lang/Integer;)Ljava/lang/Integer;
+ invoke-static/range {p2 .. p13}, Lbttv/api/Highlight;->replaceNum(Ltv/twitch/android/shared/chat/pub/messages/ui/ChatMessageInterface;ZZLkotlin/jvm/functions/Function1;ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;ZLjava/lang/Object;Ljava/lang/Integer;)Ljava/lang/Integer;
+ move-result-object p13
+ # /BTTV
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ diff --git a/smali_classes7/tv/twitch/android/util/EmoteUrlUtil.smali b/smali_cl
const-string v0, "id"

invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
@@ -714,6 +723,14 @@
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
@@ -715,6 +724,14 @@

if-eqz p2, :cond_0
+
+ # BTTV
+ invoke-static {p1}, Lbttv/emote/EmoteUrlUtil;->getEmoteUrl(Ljava/lang/String;)Ljava/lang/String;
+ move-result-object v1
+ if-eqz v1, :dont_return
+ return-object v1
+ :dont_return
+ # /BTTV
+
.line 74
invoke-virtual {p2}, Ljava/lang/Float;->floatValue()F

2 changes: 1 addition & 1 deletion patches/res.values.ids.xml.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/res/values/ids.xml b/res/values/ids.xml
--- a/res/values/ids.xml
+++ b/res/values/ids.xml
@@ -4545,4 +4545,8 @@
@@ -4556,4 +4556,8 @@
<item type="id" name="wrapper_states" />
<item type="id" name="ximg" />
<item type="id" name="year_published" />
Expand Down
Loading
Loading