Skip to content

Commit

Permalink
Update to v12.0.1 (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
FoseFx authored Nov 24, 2021
1 parent f82dd12 commit 3dd3008
Show file tree
Hide file tree
Showing 57 changed files with 298 additions and 292 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: download base
run: wget https://www.dropbox.com/s/01ql8gzm5zblto1/twitch-11.9.0.apk\?\dl=1 -O twitch.apk
run: wget https://www.dropbox.com/s/nbqmvm45jqx9sqa/twitch-12.0.1.apk\?\dl=1 -O twitch.apk
- name: create keystore.kjs from secret
run: echo "${{ secrets.KEYSTORE }}" | base64 -d > keystore.jks
- name: run build
Expand Down
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 v12.0.1

# v0.15.1-beta
- fix a split-chat related bug

Expand Down
1 change: 0 additions & 1 deletion disassemble
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ sed -i "s/apkFileName: base.apk/apkFileName: twitch.apk/" .tmp/base/apktool.yml

# fix full dex-files
mkdir .tmp/base/smali_classes8
mv .tmp/base/smali_classes3/jp .tmp/base/smali_classes8/.
mkdir -p .tmp/base/smali_classes8/tv/twitch/android
mv .tmp/base/smali_classes6/tv/twitch/android/player .tmp/base/smali_classes8/tv/twitch/android/player

Expand Down
12 changes: 9 additions & 3 deletions mod/app/src/main/java/bttv/Autocomplete.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import bttv.emote.Emote;
import bttv.emote.Emotes;
import tv.twitch.android.shared.emotes.models.EmoteSet;
import tv.twitch.android.models.emotes.EmoteModelAssetType;
import tv.twitch.android.models.emotes.EmoteModelType;
import tv.twitch.android.models.emotes.EmoteSet;
import tv.twitch.android.models.emotes.EmoteModel;

public class Autocomplete {
Expand All @@ -28,7 +28,13 @@ public static void addOurEmotes(List<EmoteSet> list) {
Emote e = Emotes.getEmote(channelId, code);
if (e == null)
continue; // should not happen
generics.add(new EmoteModel.Generic("BTTV-" + e.id, e.code, e.getAssetType()));
generics.add(
new EmoteModel.Generic(
"BTTV-" + e.id,
e.code,
e.getAssetType(),
EmoteModelType.OTHER)
);
}
EmoteSet set = new EmoteSet.GenericEmoteSet("bttv_emote_set_id", generics);
list.add(set);
Expand Down
14 changes: 11 additions & 3 deletions mod/app/src/main/java/bttv/ChommentModelDelegateWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import kotlin.jvm.internal.BTTVDefaultConstructorMarker;
import tv.twitch.android.models.chat.MessageToken;
import tv.twitch.android.models.chomments.ChommentModel;
import tv.twitch.android.provider.experiments.ExperimentHelper;
import tv.twitch.android.sdk.SDKServicesController;
import tv.twitch.android.shared.chat.ChatConnectionManagerWrapper;
import tv.twitch.android.shared.chat.ChatMessageParser;
import tv.twitch.android.shared.chat.chomments.ChommentModelDelegate;

Expand All @@ -21,9 +23,15 @@ public class ChommentModelDelegateWrapper extends ChommentModelDelegate {
public ChommentModelDelegateWrapper(ChommentModel chommentModel,
SDKServicesController sdkServicesController,
ChatMessageParser chatMessageParser,
int i,
BTTVDefaultConstructorMarker BTTVDefaultConstructorMarker) {
super(chommentModel, sdkServicesController, chatMessageParser, i, BTTVDefaultConstructorMarker);
ExperimentHelper experimentHelper,
ChatConnectionManagerWrapper chatConnectionManagerWrapper) {
super(
chommentModel,
sdkServicesController,
chatMessageParser,
experimentHelper,
chatConnectionManagerWrapper
);
}

@Override
Expand Down
14 changes: 14 additions & 0 deletions mod/app/src/main/java/bttv/Tokenizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import tv.twitch.android.models.chat.MessageToken.TextToken;
import tv.twitch.android.models.chat.MessageToken;
import tv.twitch.android.models.chat.MessageToken.EmoticonToken;
import tv.twitch.android.provider.chat.ChatMessageInterface;
import tv.twitch.android.shared.chat.ChatMessageDelegate;
import tv.twitch.chat.AutoModFlags;
import tv.twitch.chat.ChatEmoticonToken;
import tv.twitch.chat.ChatMessageInfo;
Expand Down Expand Up @@ -82,6 +84,18 @@ public static Pair<List<MessageToken>, Boolean> tokenize(List<MessageToken> orig
return new Pair<>(newTokens, shouldHighlight);
}

public static void retokenizeLiveChatMessage(ChatMessageInterface chatMessageInterface) {
if (chatMessageInterface instanceof ChatMessageDelegate) {
ChatMessageDelegate delegate = (ChatMessageDelegate) chatMessageInterface;
retokenizeLiveChatMessage(delegate.mChatMessage);
} else {
Log.w(
"LBTTV",
"retokenizeLiveChatMessage: interface it not a ChatMessageDelegate it's a "
+ chatMessageInterface.getClass().getName());
}
}

public static void retokenizeLiveChatMessage(ChatMessageInfo info) {
Context ctx = Data.ctx;
int channel = Data.currentBroadcasterId;
Expand Down
2 changes: 1 addition & 1 deletion mod/app/src/main/java/bttv/api/Autocomplete.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.util.List;

import tv.twitch.android.shared.emotes.models.EmoteSet;
import tv.twitch.android.models.emotes.EmoteSet;

public class Autocomplete {
final static String TAG = "LBTTVAutocomplete";
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
@@ -1,6 +1,6 @@
package bttv.api;

import tv.twitch.android.shared.chat.ChatMessageInterface;
import tv.twitch.android.provider.chat.ChatMessageInterface;

public class Highlight {
public static Integer replaceNum(ChatMessageInterface chatMessageInterface, boolean z, boolean z2, int i, int i2, Object iClickableUsernameSpanListener, Object twitchUrlSpanClickListener, Object webViewSource, String str, boolean z3, Object chatFiltersSettings, Integer num) {
Expand Down
21 changes: 4 additions & 17 deletions mod/app/src/main/java/bttv/emote/EmoteCardUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import bttv.Res;
import bttv.ResUtil;
import io.reactivex.Single;
import tv.twitch.android.shared.chat.model.EmoteCardModel;
import tv.twitch.android.shared.chat.parser.EmoteCardModelParser;
import tv.twitch.android.provider.chat.model.EmoteCardModelResponse;
import tv.twitch.android.provider.chat.model.EmoteCardModel;
import tv.twitch.android.models.emotes.EmoteModelAssetType;


Expand Down Expand Up @@ -59,7 +59,7 @@ public String getEmoteDesc() {
}

// called in Ltv/twitch/android/shared/chat/api/EmoteCardApi.getEmoteCardModelResponse()
public static Single<EmoteCardModelParser.EmoteCardModelResponse> getEmoteResponseOrNull(String emoteId) {
public static Single<EmoteCardModelResponse> getEmoteResponseOrNull(String emoteId) {
if (!emoteId.startsWith("BTTV-")) {
return null;
}
Expand All @@ -69,21 +69,8 @@ public static Single<EmoteCardModelParser.EmoteCardModelResponse> getEmoteRespon
return null;
}
EmoteCardModel model = new BTTVEmoteCardModel(emoteId, emote.code);
EmoteCardModelParser.EmoteCardModelResponse resp = new EmoteCardModelParser.EmoteCardModelResponse.Success(
EmoteCardModelResponse resp = new EmoteCardModelResponse.Success(
model);
return Single.just(resp);
}

// called in Ltv/twitch/android/shared/chat/emotecard/EmoteCardUiModel.<init>
public static String maybeReplaceEmoteCardUiModelEmoteUrl(EmoteCardModel model, String originalUrl) {
if (model == null || model.emoteId == null) {
return originalUrl;
}
String bttvId = EmoteUrlUtil.extractBTTVId(model.emoteId);
if (bttvId != null) {
return EmoteUrlUtil.realIdToUrl(bttvId);
} else {
return originalUrl;
}
}
}
3 changes: 2 additions & 1 deletion mod/app/src/main/java/bttv/emote/EmotePicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import bttv.Data;
import bttv.Res;
import bttv.ResUtil;
import tv.twitch.android.models.emotes.EmoteModelType;
import tv.twitch.android.shared.emotes.emotepicker.EmotePickerPresenter.ClickedEmote;
import tv.twitch.android.shared.emotes.emotepicker.models.EmoteHeaderUiModel;
import tv.twitch.android.shared.emotes.emotepicker.models.EmoteImageDescriptor;
Expand Down Expand Up @@ -138,7 +139,7 @@ private static EmoteUiSet getUiSet(Res.strings headerRes, EmotePickerSection sec

private static EmoteUiModel emoteToModel(Emote emote) {
String id = "BTTV-" + emote.id;
EmoteModel model = new EmoteModel.Generic(id, emote.code, emote.getAssetType());
EmoteModel model = new EmoteModel.Generic(id, emote.code, emote.getAssetType(), EmoteModelType.OTHER);

EmoteMessageInput input = new EmoteMessageInput(emote.code, id, false);
ClickedEmote clickedEmote = new ClickedEmote.Unlocked(model, input, null, null, 12, null);
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 @@ -21,7 +21,7 @@
import bttv.settings.Settings;
import bttv.settings.UserPreferences;
import tv.twitch.android.shared.chat.ChatMessageDelegate;
import tv.twitch.android.shared.chat.ChatMessageInterface;
import tv.twitch.android.provider.chat.ChatMessageInterface;

public class Highlight {
private static final String TAG = "LBTTVHighlight";
Expand Down
4 changes: 2 additions & 2 deletions mod/app/src/main/java/bttv/updater/Updater.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import okhttp3.Callback;
import okhttp3.Response;
import okhttp3.ResponseBody;
import tv.twitch.android.app.core.navigation.PersistentBannerPresenter;
import tv.twitch.android.app.core.navigation.PersistentBannerPresenter.PersistentBannerPresenterListener;
import tv.twitch.android.feature.viewer.main.navigation.PersistentBannerPresenter;
import tv.twitch.android.feature.viewer.main.navigation.PersistentBannerPresenter.PersistentBannerPresenterListener;

public class Updater {
private static final String GH_API_HOST = "https://api.github.com";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class MessageRecyclerItem implements tv.twitch.android.core.adapters.RecyclerAdapterItem {
public static class ChatMessageViewHolder extends ViewHolder {
public ChatMessageViewHolder(@NonNull View itemView) {
public ChatMessageViewHolder(@NonNull View itemView, boolean bool) {
super(itemView);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package tv.twitch.android.api.parsers;

import kotlin.jvm.internal.BTTVDefaultConstructorMarker;
import tv.twitch.android.provider.chat.model.EmoteCardModel;

public class EmoteCardModelParser {

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tv.twitch.android.app.core.navigation;
package tv.twitch.android.feature.viewer.main.navigation;

public class PersistentBannerPresenter {
public interface PersistentBannerPresenterListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public String getToken() {
return "";
}

public Generic(String id, String token, EmoteModelAssetType assetType) {
public Generic(String id, String token, EmoteModelAssetType assetType, EmoteModelType type) {
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package tv.twitch.android.models.emotes;

public enum EmoteModelType {
OTHER(3);

EmoteModelType(int order) {

}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package tv.twitch.android.shared.emotes.models;
package tv.twitch.android.models.emotes;

import java.util.List;

import tv.twitch.android.models.emotes.EmoteModel;

public abstract class EmoteSet {
public abstract List<EmoteModel> getEmotes();
public abstract java.lang.String getSetId();
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;
package tv.twitch.android.provider.chat;

public interface ChatMessageInterface {
java.util.List<tv.twitch.android.models.chat.MessageBadge> getBadges();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tv.twitch.android.shared.chat.model;
package tv.twitch.android.provider.chat.model;

import tv.twitch.android.models.emotes.EmoteModelAssetType;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package tv.twitch.android.provider.chat.model;

import kotlin.jvm.internal.BTTVDefaultConstructorMarker;

public abstract class EmoteCardModelResponse {

public static final class Success extends EmoteCardModelResponse {
public Success(EmoteCardModel emoteCardModel) {
super(null);
}

public final EmoteCardModel getEmoteCardModel() {
return null;
}
}

private EmoteCardModelResponse() {
}

public EmoteCardModelResponse(BTTVDefaultConstructorMarker BTTVDefaultConstructorMarker) {
this();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package tv.twitch.android.provider.experiments;

public interface ExperimentHelper {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package tv.twitch.android.shared.chat;

public class ChatConnectionManagerWrapper {
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import tv.twitch.android.models.chat.MessageBadge;
import tv.twitch.android.models.chat.MessageToken;
import tv.twitch.android.provider.chat.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 @@ -10,17 +10,19 @@
import tv.twitch.android.models.chat.MessageBadge;
import tv.twitch.android.models.chat.MessageToken;
import tv.twitch.android.models.chomments.ChommentModel;
import tv.twitch.android.provider.experiments.ExperimentHelper;
import tv.twitch.android.sdk.SDKServicesController;
import tv.twitch.android.shared.chat.ChatMessageInterface;
import tv.twitch.android.provider.chat.ChatMessageInterface;
import tv.twitch.android.shared.chat.ChatConnectionManagerWrapper;
import tv.twitch.android.shared.chat.ChatMessageParser;

public class ChommentModelDelegate implements ChatMessageInterface {

public ChommentModelDelegate(ChommentModel chommentModel,
SDKServicesController sdkServicesController,
ChatMessageParser chatMessageParser,
int i,
BTTVDefaultConstructorMarker BTTVDefaultConstructorMarker) {
ExperimentHelper experimentHelper,
ChatConnectionManagerWrapper chatConnectionManagerWrapper) {
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package tv.twitch.android.shared.chat.emotecard;

import tv.twitch.android.shared.chat.model.EmoteCardModel;
import tv.twitch.android.provider.chat.model.EmoteCardModel;

public abstract class EmoteCardUiModel {
public abstract String getEmoteUrl();
Expand Down

This file was deleted.

Loading

0 comments on commit 3dd3008

Please sign in to comment.