Skip to content

Commit 9be9ab1

Browse files
committed
101.3
1 parent 6c7d89d commit 9be9ab1

File tree

15 files changed

+169
-136
lines changed

15 files changed

+169
-136
lines changed

CustomTimestamps/build.gradle.kts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
version = "1.0.5"
1+
version = "1.0.6"
22
description = "Custom timestamps format everywhere."
3+
4+
aliucord.changelog.set("""
5+
Updated {updated marginTop}
6+
======================
7+
8+
* updated to **101.3**
9+
""".trimIndent())

CustomTimestamps/src/main/java/io/github/juby210/acplugins/CustomTimestamps.kt

+49-56
Original file line numberDiff line numberDiff line change
@@ -31,74 +31,67 @@ import java.util.*
3131
@Suppress("unused")
3232
@SuppressLint("SimpleDateFormat")
3333
class CustomTimestamps : Plugin() {
34-
init {
35-
settingsTab = SettingsTab(PluginSettings::class.java).withArgs(settings)
36-
}
34+
init {
35+
settingsTab = SettingsTab(PluginSettings::class.java).withArgs(settings)
36+
}
3737

38-
class PluginSettings(val settings: SettingsAPI) : SettingsPage() {
39-
override fun onViewBound(view: View) {
40-
super.onViewBound(view)
38+
class PluginSettings(val settings: SettingsAPI) : SettingsPage() {
39+
override fun onViewBound(view: View) {
40+
super.onViewBound(view)
4141

42-
setActionBarTitle("CustomTimestamps")
43-
setPadding(0)
42+
setActionBarTitle("CustomTimestamps")
43+
setPadding(0)
4444

45-
val context = view.context
46-
val format = settings.getString("format", defaultFormat)
45+
val context = view.context
46+
val format = settings.getString("format", defaultFormat)
4747

48-
val guide = TextView(context, null, 0, R.h.UiKit_Settings_Item_SubText).apply {
49-
setPreview(format, this)
50-
movementMethod = LinkMovementMethod.getInstance()
51-
}
52-
linearLayout.addView(TextInput(context).apply {
53-
val padding = DimenUtils.getDefaultPadding()
54-
layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)
55-
.apply { setMargins(padding, padding, padding, 0) }
56-
hint = "Custom Timestamp Format"
57-
editText.apply editText@ {
58-
if (this == null) return@editText
59-
maxLines = 1
60-
setText(format)
61-
addTextChangedListener(object : TextWatcher {
62-
override fun afterTextChanged(s: Editable) = s.toString().let {
63-
settings.setString("format", it)
64-
setPreview(it, guide)
48+
val guide = TextView(context, null, 0, R.i.UiKit_Settings_Item_SubText).apply {
49+
setPreview(format, this)
50+
movementMethod = LinkMovementMethod.getInstance()
6551
}
52+
linearLayout.addView(TextInput(context, "Custom Timestamp Format", format, object : TextWatcher {
53+
override fun afterTextChanged(s: Editable) = s.toString().let {
54+
settings.setString("format", it)
55+
setPreview(it, guide)
56+
}
6657

67-
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
68-
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
69-
})
58+
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
59+
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
60+
}).apply {
61+
val padding = DimenUtils.defaultPadding
62+
layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)
63+
.apply { setMargins(padding, padding, padding, 0) }
64+
})
65+
linearLayout.addView(guide)
7066
}
71-
})
72-
linearLayout.addView(guide)
73-
}
7467

75-
fun setPreview(formatStr: String, view: TextView) {
76-
view.text = SpannableStringBuilder("Formatting guide\n\nPreview: ").apply {
77-
append(format(formatStr, System.currentTimeMillis()))
78-
setSpan(URLSpan("https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html"), 0, 16, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
79-
}
68+
private fun setPreview(formatStr: String, view: TextView) {
69+
view.text = SpannableStringBuilder("Formatting guide\n\nPreview: ").apply {
70+
append(format(formatStr, System.currentTimeMillis()))
71+
setSpan(URLSpan("https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html"), 0, 16, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
72+
}
73+
}
8074
}
81-
}
8275

83-
override fun start(context: Context?) {
84-
patcher.patch(
85-
TimeUtils::class.java.getDeclaredMethod("toReadableTimeString", Context::class.java, Long::class.javaPrimitiveType, Clock::class.java),
86-
Hook { it.result = format(settings.getString("format", defaultFormat), it.args[1] as Long) }
87-
)
88-
}
76+
override fun start(context: Context?) {
77+
patcher.patch(
78+
TimeUtils::class.java.getDeclaredMethod("toReadableTimeString", Context::class.java, Long::class.javaPrimitiveType, Clock::class.java),
79+
Hook { it.result = format(settings.getString("format", defaultFormat), it.args[1] as Long) }
80+
)
81+
}
8982

90-
override fun stop(context: Context?) = patcher.unpatchAll()
83+
override fun stop(context: Context?) = patcher.unpatchAll()
9184

92-
companion object {
93-
const val defaultFormat = "dd.MM.yyyy, HH:mm:ss"
85+
companion object {
86+
const val defaultFormat = "dd.MM.yyyy, HH:mm:ss"
9487

95-
fun format(format: String?, time: Long): String {
96-
return try {
97-
SimpleDateFormat(format).format(Date(time))
98-
} catch (e: Throwable) {
99-
Main.logger.info("Invalid format for CustomTimestamps, using default format")
100-
SimpleDateFormat(defaultFormat).format(Date(time))
101-
}
88+
fun format(format: String?, time: Long): String {
89+
return try {
90+
SimpleDateFormat(format).format(Date(time))
91+
} catch (e: Throwable) {
92+
Main.logger.info("Invalid format for CustomTimestamps, using default format")
93+
SimpleDateFormat(defaultFormat).format(Date(time))
94+
}
95+
}
10296
}
103-
}
10497
}

PronounDB/build.gradle.kts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
version = "1.0.9"
1+
version = "1.0.10"
22
description = "PronounDB plugin for Aliucord - Shows other's people pronouns in chat, so your chances of mis-gendering them is low. Service by pronoundb.org."
3+
4+
aliucord.changelog.set("""
5+
Updated {updated marginTop}
6+
======================
7+
8+
* updated to **101.3**
9+
""".trimIndent())

PronounDB/src/main/java/io/github/juby210/acplugins/PronounDB.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
@AliucordPlugin
3939
@SuppressLint("SetTextI18n")
4040
@SuppressWarnings("unused")
41-
public class PronounDB extends Plugin {
41+
public final class PronounDB extends Plugin {
4242
public PronounDB() {
4343
settingsTab = new SettingsTab(PluginSettings.class).withArgs(settings);
4444
}
@@ -68,7 +68,7 @@ private void injectMessages() throws Throwable {
6868
var header = (ConstraintLayout) itemTimestamp.getParent();
6969
TextView pronounsView = header.findViewById(viewId);
7070
if (pronounsView == null) {
71-
pronounsView = new TextView(header.getContext(), null, 0, R.h.UiKit_TextView);
71+
pronounsView = new TextView(header.getContext(), null, 0, R.i.UiKit_TextView);
7272
pronounsView.setId(viewId);
7373
pronounsView.setTextSize(12);
7474
pronounsView.setTextColor(ColorCompat.getThemedColor(header.getContext(), R.b.colorTextMuted));
@@ -136,7 +136,7 @@ public void addPronounsToUserSheet(WidgetUserSheetBinding binding, Long userId)
136136

137137
TextView pronounsView = layout.findViewById(viewId);
138138
if (pronounsView == null) {
139-
pronounsView = new TextView(layout.getContext(), null, 0, R.h.UserProfile_Section_Header);
139+
pronounsView = new TextView(layout.getContext(), null, 0, R.i.UserProfile_Section_Header);
140140
pronounsView.setId(viewId);
141141
pronounsView.setTypeface(ResourcesCompat.getFont(layout.getContext(), com.aliucord.Constants.Fonts.whitney_semibold));
142142
pronounsView.setPadding(DimenUtils.dpToPx(16), 0, 0, 0);

PronounDB/src/main/java/io/github/juby210/acplugins/pronoundb/PluginSettings.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void onViewBound(View view) {
4040
var context = view.getContext();
4141
var layout = getLinearLayout();
4242

43-
var appearanceHeader = new TextView(context, null, 0, R.h.UiKit_Settings_Item_Header);
43+
var appearanceHeader = new TextView(context, null, 0, R.i.UiKit_Settings_Item_Header);
4444
appearanceHeader.setTypeface(ResourcesCompat.getFont(context, Constants.Fonts.whitney_semibold));
4545
appearanceHeader.setText("Pronouns appearance");
4646
layout.addView(appearanceHeader);

RemoveZoomLimit/build.gradle.kts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
version = "1.0.6"
1+
version = "1.0.7"
22
description = "Removes maximum zoom limit."
3+
4+
aliucord.changelog.set("""
5+
Updated {updated marginTop}
6+
======================
7+
8+
* updated to **101.3**
9+
""".trimIndent())

RemoveZoomLimit/src/main/java/io/github/juby210/acplugins/RemoveZoomLimit.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import androidx.annotation.NonNull;
1616
import androidx.annotation.Nullable;
1717

18-
import com.airbnb.lottie.parser.AnimatableValueParser;
1918
import com.aliucord.Utils;
2019
import com.aliucord.annotations.AliucordPlugin;
2120
import com.aliucord.entities.Plugin;
@@ -92,9 +91,12 @@ public void removeMaxRes() {
9291
if (settings.getBool("removeMaxRes", false)) {
9392
// Remove max resolution limit in image loader
9493
// Gets method by param types because the method is in heavily obfuscated class
95-
for (var m : AnimatableValueParser.class.getDeclaredMethods()) {
94+
var f = c.f.j.d.f.class;
95+
var e = c.f.j.d.e.class;
96+
var i = int.class;
97+
for (var m : c.c.a.a0.d.class.getDeclaredMethods()) {
9698
var params = m.getParameterTypes();
97-
if (params.length == 4 && params[0] == c.f.j.d.f.class && params[1] == c.f.j.d.e.class && params[3] == int.class) {
99+
if (params.length == 4 && params[0] == f && params[1] == e && params[3] == i) {
98100
Utils.log("[RemoveZoomLimit] Found obfuscated method to limit resolution: " + m.getName());
99101
maxResUnpatch = patcher.patch(m, InsteadHook.returnConstant(1));
100102
break;

SquareAvatars/build.gradle.kts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
version = "0.0.12"
1+
version = "0.0.13"
22
description = "Display square avatars instead of circles."
3+
4+
aliucord.changelog.set("""
5+
Updated {updated marginTop}
6+
======================
7+
8+
* updated to **101.3**
9+
""".trimIndent())

SquareAvatars/src/main/java/io/github/juby210/acplugins/SquareAvatars.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import android.content.Context;
99
import android.util.AttributeSet;
1010

11-
import com.airbnb.lottie.parser.AnimatableValueParser;
1211
import com.aliucord.Constants;
1312
import com.aliucord.Logger;
1413
import com.aliucord.annotations.AliucordPlugin;
@@ -32,9 +31,11 @@ public void start(Context ctx) {
3231

3332
// com.facebook.drawee.generic.GenericDraweeHierarchyInflater updateBuilder
3433
// https://github.com/facebook/fresco/blob/master/drawee/src/main/java/com/facebook/drawee/generic/GenericDraweeHierarchyInflater.java#L98
35-
for (Method m : AnimatableValueParser.class.getDeclaredMethods()) {
34+
var attrSet = AttributeSet.class;
35+
var ctxClass = Context.class;
36+
for (Method m : c.c.a.a0.d.class.getDeclaredMethods()) {
3637
var params = m.getParameterTypes();
37-
if (params.length == 3 && params[2] == AttributeSet.class && params[1] == Context.class) {
38+
if (params.length == 3 && params[2] == attrSet && params[1] == ctxClass) {
3839
logger.debug("Found obfuscated updateBuilder method: " + m.getName());
3940
patcher.patch(m, new Hook(param -> {
4041
var attrs = (AttributeSet) param.args[2];

UserDetails/build.gradle.kts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
version = "1.1.1"
1+
version = "1.1.2"
22
description = "Displays when user created account, joined to server and when sent last message in selected server / dm."
3+
4+
aliucord.changelog.set("""
5+
Updated {updated marginTop}
6+
======================
7+
8+
* updated to **101.3**
9+
""".trimIndent())

UserDetails/src/main/java/io/github/juby210/acplugins/UserDetails.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class UserDetails : Plugin() {
116116
val customStatus = binding.a.findViewById<View>(customStatusViewId)
117117
val layout = customStatus.parent as LinearLayout
118118
val context = layout.context
119-
val detailsView = layout.findViewById(viewId) ?: TextView(context, null, 0, R.h.UiKit_TextView_Semibold).apply {
119+
val detailsView = layout.findViewById(viewId) ?: TextView(context, null, 0, R.i.UiKit_TextView_Semibold).apply {
120120
id = viewId
121121
typeface = ResourcesCompat.getFont(context, Constants.Fonts.whitney_semibold)
122122
setTextColor(ColorCompat.getThemedColor(context, R.b.colorTextMuted))

ViewRaw/build.gradle.kts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
version = "1.0.6"
1+
version = "1.0.7"
22
description = "View & Copy raw message and markdown."
33

4-
aliucord {
5-
changelog.set("Updated {updated marginTop}\n======================\n\n* added ViewRaw icon back")
6-
}
4+
aliucord.changelog.set("""
5+
Updated {updated marginTop}
6+
======================
7+
8+
* updated to **101.3**
9+
""".trimIndent())

0 commit comments

Comments
 (0)