Skip to content

Commit

Permalink
Updater (#20)
Browse files Browse the repository at this point in the history
* update workflow

* starts activity

* adds download

* bump version
  • Loading branch information
FoseFx authored Feb 18, 2021
1 parent 2a91831 commit 5c47d95
Show file tree
Hide file tree
Showing 42 changed files with 828 additions and 50 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: New Release
draft: true
prerelease: true
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: false
- run: echo "version_tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Upload Release Apk
id: upload-release-asset
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BTTV-android ![GitHub](https://img.shields.io/github/license/bttv-android/bttv?style=flat-square) ![bttv version](https://img.shields.io/badge/current%20version-v0.0.3-blue?style=flat-square) ![build on](https://img.shields.io/badge/build%20on-v10.1.0-blueviolet?style=flat-square)
# BTTV-android ![GitHub](https://img.shields.io/github/license/bttv-android/bttv?style=flat-square) ![bttv version](https://img.shields.io/badge/current%20version-v0.0.4-blue?style=flat-square) ![build on](https://img.shields.io/badge/build%20on-v10.1.0-blueviolet?style=flat-square)

A mod of the Twitch Android Mobile App adding BetterTTV and FrankerFaceZ emotes

Expand Down
115 changes: 111 additions & 4 deletions monke.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 471846e9e..bed8fbbfd 100644
index 471846e9e..a07099935 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" android:installLocation="auto" package="tv.twitch.android.app" platformBuildVersionCode="29" platformBuildVersionName="10">
+<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0031000010" android:versionName="0.0.3" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" android:installLocation="auto" package="tv.twitch.bttvandroid.app" platformBuildVersionCode="29" platformBuildVersionName="10">
+<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="0041000010" android:versionName="0.0.4-alpha" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" android:installLocation="auto" package="tv.twitch.bttvandroid.app" platformBuildVersionCode="29" platformBuildVersionName="10">
<uses-feature android:name="android.hardware.type.pc" android:required="false"/>
@@ -115,3 +115,3 @@
<service android:name="tv.twitch.android.shared.app.indexing.AppIndexingUpdateService" android:permission="android.permission.BIND_JOB_SERVICE"/>
Expand All @@ -26,6 +26,17 @@ index 471846e9e..bed8fbbfd 100644
- <provider android:authorities="tv.twitch.android.app.mlsInitializationProvider" android:enabled="true" android:exported="false" android:name="com.amazon.mls.config.internal.sushi.background.ProcessLifecycleTrackerInitialization"/>
+ <provider android:authorities="tv.twitch.bttvandroid.app.mlsInitializationProvider" android:enabled="true" android:exported="false" android:name="com.amazon.mls.config.internal.sushi.background.ProcessLifecycleTrackerInitialization"/>
<service android:name="com.amazon.mls.config.internal.sushi.uploader.BackupUploaderService" android:permission="android.permission.BIND_JOB_SERVICE"/>
@@ -207,2 +207,10 @@
<meta-data android:name="com.android.vending.derived.apk.id" android:value="1"/>
+ <activity android:name="bttv.UpdaterActivity" />
+ <provider
+ android:name="androidx.core.content.FileProvider"
+ android:authorities="tv.twitch.bttv-android.app.provider"
+ android:exported="false"
+ android:grantUriPermissions="true" >
+ <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"></meta-data>
+ </provider>
</application>
diff --git a/res/drawable-v23/background_splash.xml b/res/drawable-v23/background_splash.xml
index 80b85907f..bb48b5a86 100644
--- a/res/drawable-v23/background_splash.xml
Expand Down Expand Up @@ -98,13 +109,66 @@ nbcXiRg3yUYW<;ZmtZv7kv)^Z!o#0g||L%IYdeh6DH_84BH!prw
literal 0
HcmV?d00001

diff --git a/res/layout/bttv_updater_activity.xml b/res/layout/bttv_updater_activity.xml
new file mode 100644
index 000000000..631e667f1
--- /dev/null
+++ b/res/layout/bttv_updater_activity.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/bttv_updater_activity"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/bttv_updater_activity_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="20dp"
+ android:layout_marginLeft="20dp"
+ android:layout_marginTop="20dp"
+ android:layout_marginEnd="20dp"
+ android:layout_marginRight="20dp"
+ android:layout_marginBottom="5dp"
+ android:text="Downloading "
+ android:textSize="24sp"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/bttv_updater_activity_body"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_marginStart="20dp"
+ android:layout_marginLeft="20dp"
+ android:layout_marginEnd="20dp"
+ android:layout_marginRight="20dp"
+ android:layout_weight="1"
+ android:scrollbars="vertical"
+ android:text="TextView" />
+
+ <ProgressBar
+ android:id="@+id/bttv_updater_activity_pb"
+ style="?android:attr/progressBarStyleHorizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="20dp"
+ android:layout_marginLeft="20dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginEnd="20dp"
+ android:layout_marginRight="20dp"
+ android:layout_marginBottom="30dp" />
+</LinearLayout>
diff --git a/res/layout/settings_logout_footer.xml b/res/layout/settings_logout_footer.xml
index e5846b005..0605b7e80 100644
index e5846b005..b8f9e9559 100644
--- a/res/layout/settings_logout_footer.xml
+++ b/res/layout/settings_logout_footer.xml
@@ -4,2 +4,3 @@
<ImageView android:layout_gravity="center_horizontal" android:id="@id/app_settings_icon" android:padding="@dimen/default_margin" android:layout_width="@dimen/settings_footer_logo_size" android:layout_height="@dimen/settings_footer_logo_size" android:src="@drawable/ic_twitch_glitch_uv" />
+ <TextView android:textColor="@color/text_alt" android:gravity="center" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="BTTV v0.0.3" />
+ <TextView android:textColor="@color/text_alt" android:gravity="center" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="BTTV v0.0.4" />
<TextView android:textColor="@color/text_alt" android:gravity="center" android:id="@id/app_settings_version" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/version_label" />
diff --git a/res/mipmap-anydpi-v26/ic_launcher.xml b/res/mipmap-anydpi-v26/ic_launcher.xml
index 3b06a9d16..202eb42e8 100644
Expand Down Expand Up @@ -1869,6 +1933,30 @@ index ff0b9e965..10655be88 100644
<color name="youtube">#ffcd201f</color>
+ <color name="bttv_mega">#ff00fafa</color>
</resources>
diff --git a/res/values/ids.xml b/res/values/ids.xml
index 20cdbeb5b..2d81a8a0d 100644
--- a/res/values/ids.xml
+++ b/res/values/ids.xml
@@ -2645,2 +2645,6 @@
<item type="id" name="zero_corner_chip" />
+ <item type="id" name="bttv_updater_activity" />
+ <item type="id" name="bttv_updater_activity_title" />
+ <item type="id" name="bttv_updater_activity_body" />
+ <item type="id" name="bttv_updater_activity_pb" />
</resources>
diff --git a/res/values/public.xml b/res/values/public.xml
index 75f8ef1fc..d04243807 100644
--- a/res/values/public.xml
+++ b/res/values/public.xml
@@ -11694,2 +11694,7 @@
<public type="xml" name="splits0" id="0x7f160009" />
+ <public type="id" name="bttv_updater_activity" id="0x7f0bfffa" />
+ <public type="id" name="bttv_updater_activity_title" id="0x7f0bfffb" />
+ <public type="id" name="bttv_updater_activity_body" id="0x7f0bfffc" />
+ <public type="id" name="bttv_updater_activity_pb" id="0x7f0bfffd" />
+ <public type="layout" name="bttv_updater_activity" id="0x7f0efffa" />
</resources>
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 926e0ed2d..4390fd697 100644
--- a/res/values/strings.xml
Expand All @@ -1883,6 +1971,16 @@ index 926e0ed2d..4390fd697 100644
- <string name="login_landing_title">Welcome to Twitch</string>
+ <string name="login_landing_title">Welcome to\nBetter Twitch</string>
<string name="login_live_body">All your favorite streamers in one place</string>
diff --git a/res/xml/provider_paths.xml b/res/xml/provider_paths.xml
new file mode 100644
index 000000000..ceb5472f0
--- /dev/null
+++ b/res/xml/provider_paths.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<paths>
+ <cache-path name="internal_cache" path="" />
+</paths>
diff --git a/smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppComponent$SettingsActivitySubcomponentImpl.smali b/smali_classes10/tv/twitch/android/app/consumer/dagger/DaggerAppComponent$SettingsActivitySubcomponentImpl.smali
similarity index 99%
rename from smali_classes4/tv/twitch/android/app/consumer/dagger/DaggerAppComponent$SettingsActivitySubcomponentImpl.smali
Expand Down Expand Up @@ -1958,6 +2056,15 @@ index 917a89b6c..0bac8a8af 100644
+ invoke-static {v4}, Lbttv/SettingsFragmentBindingFactory;->setPageViewTrackerProvider(Ljavax/inject/Provider;)V
+
.line 4512
diff --git a/smali_classes4/tv/twitch/android/app/core/MainActivity.smali b/smali_classes4/tv/twitch/android/app/core/MainActivity.smali
index af30ac1ea..7a31259f4 100644
--- a/smali_classes4/tv/twitch/android/app/core/MainActivity.smali
+++ b/smali_classes4/tv/twitch/android/app/core/MainActivity.smali
@@ -1388,2 +1388,4 @@

+ invoke-static {p0, p1}, Lbttv/Updater;->checkForUpdates(Landroid/app/Activity;Ltv/twitch/android/app/core/navigation/PersistentBannerPresenter;)V
+
.line 339
diff --git a/smali_classes7/tv/twitch/android/models/settings/SettingsDestination.smali b/smali_classes7/tv/twitch/android/models/settings/SettingsDestination.smali
index df9936922..da6c74dcc 100644
--- a/smali_classes7/tv/twitch/android/models/settings/SettingsDestination.smali
Expand Down
34 changes: 34 additions & 0 deletions source/android/app/Activity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package android.app;

import java.io.File;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.View;

public class Activity extends Context {
public void startActivity(Intent intent) {

}

@Override
public SharedPreferences getSharedPreferences(String name, int mode) {
return null;
}

public Intent getIntent() {
return null;
}

public <T extends View> T findViewById(int id) {
return null;
}

@Override
public File getCacheDir() {
// TODO Auto-generated method stub
return null;
}

}
34 changes: 34 additions & 0 deletions source/android/app/AlertDialog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package android.app;

import android.content.Context;
import android.content.DialogInterface;

public class AlertDialog extends Dialog {
public static class Builder {
public Builder(Context context) {

}

public Builder setTitle(CharSequence s) {
return this;
}

public Builder setMessage(CharSequence s) {
return this;
}

public Builder setPositiveButton(CharSequence s, DialogInterface.OnClickListener listener) {
return this;
}

public Builder setNegativeButton(CharSequence s, DialogInterface.OnClickListener listener) {
return this;
}

public AlertDialog create() {
return null;
}

}

}
7 changes: 7 additions & 0 deletions source/android/app/Dialog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package android.app;

public class Dialog {
public void show() {

}
}
4 changes: 4 additions & 0 deletions source/android/content/Context.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package android.content;

import java.io.File;

public abstract class Context {
public abstract SharedPreferences getSharedPreferences(String name, int mode);

public abstract File getCacheDir();
}
6 changes: 6 additions & 0 deletions source/android/content/DialogInterface.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package android.content;

public interface DialogInterface {
public static interface OnClickListener {
}
}
29 changes: 29 additions & 0 deletions source/android/content/Intent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package android.content;

import android.net.Uri;

public class Intent {
public Intent(Context packageContext, Class<?> cls) {

}

public Intent(String s) {

}

public Intent putExtra(String name, String value) {
return this;
}

public String getStringExtra(String name) {
return "";
}

public Intent setDataAndType(Uri data, String type) {
return this;
}

public Intent setFlags(int flags) {
return this;
}
}
9 changes: 9 additions & 0 deletions source/android/net/Uri.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package android.net;

import java.io.File;

public class Uri {
public static Uri fromFile(File f) {
return null;
}
}
5 changes: 5 additions & 0 deletions source/android/os/Bundle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package android.os;

public class Bundle {

}
8 changes: 8 additions & 0 deletions source/android/widget/ProgressBar.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package android.widget;

import android.view.View;

public class ProgressBar extends View {
public synchronized void setProgress(int progress) {
}
}
9 changes: 9 additions & 0 deletions source/android/widget/TextView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package android.widget;

import android.view.View;

public class TextView extends View {

public final void setText(CharSequence text) {
}
}
7 changes: 7 additions & 0 deletions source/androidx/appcompat/app/AppCompatActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package androidx.appcompat.app;

public class AppCompatActivity extends androidx.fragment.app.FragmentActivity {
public void setContentView(int i) {

}
}
8 changes: 8 additions & 0 deletions source/androidx/core/content/FileProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package androidx.core.content;

public class FileProvider {
public static android.net.Uri getUriForFile(android.content.Context context, java.lang.String str,
java.io.File file) {
return null;
}
}
8 changes: 7 additions & 1 deletion source/androidx/fragment/app/FragmentActivity.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package androidx.fragment.app;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;

public class FragmentActivity {
public class FragmentActivity extends Activity {
public Context getApplicationContext() {
return null;
}

protected void onCreate(Bundle bundle) {

}
}
2 changes: 1 addition & 1 deletion source/bttv/ChannelEmoteData.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public ChannelEmoteData(List<Emote> channelEmotes, List<Emote> sharedEmotes) {
}

public static ChannelEmoteData fromJson(String json) {
Log.i("BTTVChannelEmoteData", json);
Log.i("LBTTVChannelEmoteData", json);
JSONObject reader = new JSONObject(json);
JSONArray channelEmotes = reader.getJSONArray("channelEmotes");
JSONArray sharedEmotes = reader.getJSONArray("sharedEmotes");
Expand Down
Loading

0 comments on commit 5c47d95

Please sign in to comment.