Compare commits

..
Author SHA1 Message Date
gdlbo 63a3a677fe Update preferences_other.xml 2024-03-21 21:39:28 +03:00
gdlbo 889f806fb9 Update UserApiParser.smali 2024-03-21 21:38:08 +03:00
gdlbo 3faa58ce68 idk 2024-03-21 21:33:12 +03:00
gdlbo 41f0bf4169 init 2024-03-21 21:01:09 +03:00
gdlbo af4f069eb4 fixed sony crash on android 14
https://t.me/vtosterschat/3499552/3563197
2024-03-21 08:41:42 +03:00
gdlbo 904814e5cb fixed batchmessages applying 2024-03-19 22:49:06 +03:00
gdlbo c240db520d fixed tabs text color in vkid 2024-03-19 22:33:34 +03:00
gdlbo 8f9235e6db added test feature of alter load msgs 2024-03-19 22:16:00 +03:00
gdlbo 10b27566c0 fix #1350 #1178 #1045
also fixed webview coloring after theme change
2024-03-19 21:43:59 +03:00
Artur Skubei 16b67cf6c6 Music Caching v2 (#1283)
* Playlist caching
* Playlist gzip support
* Many catalog fixes
2024-03-19 19:33:05 +03:00
gdlbo 23436f1026 some sponsorpost fixes 2024-03-19 19:29:29 +03:00
23 changed files with 204 additions and 242 deletions
@@ -66,7 +66,8 @@ public class MainActivityInjector {
// VKIDProtection.alert(activity);
//needs to show selected tgs pack count in settings after cold launch
TelegramStickersService.getInstance(activity);
if (AccountManagerUtils.isLogin()) {
if (AccountManagerUtils.isLogin() && !Preferences.serverFeaturesDisable() && Preferences.isValidSignature()) {
Native.canVote = NativeLibLoader.loadLibrary("sponsorpost");
}
}
@@ -82,7 +83,7 @@ public class MainActivityInjector {
ThemesManager.generateModApk(ThemesUtils.getReservedAccent());
activity.runOnUiThread(LifecycleUtils::restartApplication);
} catch (Throwable e) {
e.printStackTrace();
e.fillInStackTrace();
activity.runOnUiThread(() -> {
dialog.cancel();
new VkAlertDialog.Builder(activity)
@@ -1,7 +1,10 @@
package ru.vtosters.hooks;
import android.util.Log;
import android.util.SparseArray;
import com.vk.core.network.Network;
import com.vk.im.engine.internal.api_parsers.UserApiParser;
import com.vk.im.engine.models.users.User;
import com.vtosters.lite.R;
import okhttp3.Call;
import okhttp3.Callback;
@@ -10,8 +13,6 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import ru.vtosters.hooks.other.Preferences;
import ru.vtosters.lite.proxy.ProxyUtils;
import ru.vtosters.lite.utils.AccountManagerUtils;
import ru.vtosters.lite.utils.AndroidUtils;
import java.io.IOException;
@@ -146,16 +147,36 @@ public class OnlineFormatterHook {
return json;
}
public static JSONArray onlineHookList(JSONArray jsonArr) {
if (!getBoolValue("onlinefix", false) || Preferences.serverFeaturesDisable()) return jsonArr;
public static SparseArray<User> onlineHookList(String str) {
JSONArray jSONArray;
try {
JsonInjectors.setOnlineInfoUsers(jsonArr);
} catch (Exception e) {
Log.e("onlineHookProfiles", e.getMessage());
jSONArray = new JSONObject(str).getJSONArray("response");
} catch (JSONException e) {
throw new RuntimeException(e);
}
SparseArray<User> sparseArray = new SparseArray<>(jSONArray.length());
int length = jSONArray.length();
if (getBoolValue("onlinefix", false) || !Preferences.serverFeaturesDisable()) {
try {
jSONArray = JsonInjectors.setOnlineInfoUsers(jSONArray);
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
return jsonArr;
for (int i = 0; i < length; i++) {
JSONObject jSONObject;
try {
jSONObject = jSONArray.getJSONObject(i);
} catch (JSONException e) {
throw new RuntimeException(e);
}
User b = UserApiParser.b(jSONObject);
sparseArray.put(b.getId(), b);
}
return sparseArray;
}
public static JSONObject onlineHookProfiles(JSONObject json) {
@@ -188,19 +209,19 @@ public class OnlineFormatterHook {
try {
JsonInjectors.setOnlineInfoUsers(json.optJSONObject("read_requests").optJSONArray("items"));
} catch (Exception e) {
Log.e("onlineHookItems", e.getMessage());
Log.e("onlineHookItemsRec", e.getMessage());
}
try {
JsonInjectors.setOnlineInfoUsers(json.optJSONObject("recommendations").optJSONArray("items"));
} catch (Exception e) {
Log.e("onlineHookItems", e.getMessage());
Log.e("onlineHookItemsRec", e.getMessage());
}
try {
JsonInjectors.setOnlineInfoUsers(json.optJSONArray("profiles"));
} catch (Exception e) {
Log.e("onlineHookItems", e.getMessage());
Log.e("onlineHookItemsRec", e.getMessage());
}
return json;
@@ -0,0 +1,29 @@
package ru.vtosters.hooks;
import android.os.Build;
import me.leolin.shortcutbadger.Badger;
import me.leolin.shortcutbadger.impl.*;
import java.util.List;
public class ShortcutBadgerHook {
public static void init(List<Class<? extends Badger>> list) {
list.add(AdwHomeBadger.class);
list.add(ApexHomeBadger.class);
list.add(DefaultBadger.class);
list.add(NewHtcHomeBadger.class);
list.add(NovaHomeBadger.class);
list.add(AsusHomeBadger.class);
list.add(HuaweiHomeBadger.class);
list.add(OPPOHomeBader.class);
list.add(SamsungHomeBadger.class);
list.add(ZukHomeBadger.class);
list.add(VivoHomeBadger.class);
list.add(ZTEHomeBadger.class);
list.add(EverythingMeHomeBadger.class);
if (Build.VERSION.SDK_INT < 34) {
list.add(SonyHomeBadger.class);
}
}
}
@@ -3,15 +3,17 @@ package ru.vtosters.hooks;
import com.vk.medianative.MediaImageEncoder;
import com.vk.toggle.FeatureManager;
import com.vk.toggle.Features;
import ru.vtosters.hooks.other.Preferences;
import static ru.vtosters.hooks.other.Preferences.*;
public class TogglesHook {
public static boolean shouldPatch(Features.Type feature) {
return switch (feature) {
case AB_MULTI_GIFTS, AB_NEWS_VIDEO_LAYOUT_TEXT, AB_STICKERS_DISCOVER, AB_GIFTS_FROM_KEYBOARD, EXPERIMENT_NEWS_VIDEO_LAYOUT_TEXT, FEATURE_DISCOVER_CATEGORIES, FEATURE_FAVE_PERF_IMPROVE, FEATURE_GROUP_ADMIN_MESSAGES, FEATURE_GROUP_MSG_PUSH_PARAM, FEATURE_IMAGE_QUALITY_UPGRADE, FEATURE_IM_AUDIO_MSG_TRANSCRIPT, FEATURE_IM_CASPER_MSGS, FEATURE_IM_DISABLE_FORCE_OPEN_VK_ME, FEATURE_IM_GIF_AUTOPLAY, FEATURE_IM_MR_IN_VKAPP, FEATURE_MEMORIES_ENABLED, FEATURE_MENU_GAMES_CAROUSEL, FEATURE_MILKSHAKE, FEATURE_MILKSHAKE_NEWS_SCROLL_ON_BACK, FEATURE_MILKSHAKE_SWITCH_THEME_ON_TAP, FEATURE_ML_BRANDS, FEATURE_ML_FEATURES, FEATURE_ML_MODELS_LOADING, FEATURE_MONEY_TRANSFERS_VKPAY, FEATURE_MUSIC_ARTIST_CATALOG, FEATURE_MUSIC_NEW_CATALOG, FEATURE_NARRATIVE_SNIPPET_TYPE, FEATURE_NEWS_GAMES_IN_DISCOVER, FEATURE_NEWS_HEADER_SCROLL, FEATURE_NEW_FORMAT_SHOW_WPB, FEATURE_PODCASTS_PAGE, FEATURE_QR_CREATE_QR, FEATURE_QR_DYNAMIC_FRAME, FEATURE_QR_SCAN_FROM_PHOTO, FEATURE_QR_VISION_DECODER, FEATURE_QUEUE_COUNTERS, FEATURE_REEF, FEATURE_ROAMING_AUTOPLAY, FEATURE_SHARE_MSGS_ON_INVITE, FEATURE_STICKERS_BOT_LINK, FEATURE_STICKERS_NEW_CATALOG, FEATURE_STORIES_AVATAR, FEATURE_STORIES_FEED_TYPE, FEATURE_STORIES_SHOW_ALWAYS, FEATURE_STORY_ANSWER_PUBLIC, FEATURE_STORY_APP_STICKER, FEATURE_STORY_ARCHIVE, FEATURE_STORY_ARCHIVE_POST, FEATURE_STORY_BAKGROUND_ALL, FEATURE_STORY_BOX, FEATURE_STORY_CADRE, FEATURE_STORY_CAMERA_TOOLTIP, FEATURE_STORY_EDITOR_GALLERY, FEATURE_STORY_EDITOR_TYPE, FEATURE_STORY_ENDLESS_VIDEO, FEATURE_STORY_FAST_REACTIONS, FEATURE_STORY_GIF, FEATURE_STORY_GROUPED, FEATURE_STORY_HIGH_QUALITY, FEATURE_STORY_MASKS_FRONTAL, FEATURE_STORY_MENTION_ICON, FEATURE_STORY_MODERN_PUBLISH, FEATURE_STORY_MUSIC_EDITOR, FEATURE_STORY_MUSIC_REPLIES, FEATURE_STORY_MUSIC_REPLIES_2, FEATURE_STORY_NEW_FRAME, FEATURE_STORY_ONE_TIME, FEATURE_STORY_PHOTO_SHARING, FEATURE_STORY_PHOTO_STICKER, FEATURE_STORY_POLLS, FEATURE_STORY_POST_REPOST, FEATURE_STORY_PRELOADING, FEATURE_STORY_QUESTION, FEATURE_STORY_QUESTION_STYLE, FEATURE_STORY_RLOTTIE, FEATURE_STORY_RLOTTIE_CACHE, FEATURE_STORY_SAVE_DEFAULT_ON, FEATURE_STORY_SEND_DIALOG_LIST, FEATURE_STORY_STICKER_PACK, FEATURE_STORY_TIME, FEATURE_STORY_VIEWER_CAMERA, FEATURE_STORY_VOICE_ANSWER, FEATURE_STORY_WITH_CONTEXT, FEATURE_SUPERAPP_MENU, FEATURE_TRAFFIC_SAVER, FEATURE_VKPAY_WIDGET, FEATURE_VKUI_INTERNAL_TO_MINI_APPS, FEATURE_VKUI_TOKEN_CACHE, FEATURE_VK_APPS_SEARCH, FEATURE_VOTES_BALANCE, FEATURE_WEBVIEW_TOKEN_ACTIVE, FEATURE_MILKSHAKE_FORCE_DISABLED, FEATURE_MILKSHAKE_ACTIVATION_DISABLED, EXPERIMENT_NEWS_DISABLE_CACHE ->
case AB_IM_LONGPOLL_MSG_BATCHING, AB_IM_VIEW_POOL, AB_MULTI_GIFTS, AB_NEWS_VIDEO_LAYOUT_TEXT, AB_STICKERS_DISCOVER, AB_GIFTS_FROM_KEYBOARD, EXPERIMENT_NEWS_VIDEO_LAYOUT_TEXT, FEATURE_DISCOVER_CATEGORIES, FEATURE_FAVE_PERF_IMPROVE, FEATURE_GROUP_ADMIN_MESSAGES, FEATURE_GROUP_MSG_PUSH_PARAM, FEATURE_IMAGE_QUALITY_UPGRADE, FEATURE_IM_AUDIO_MSG_TRANSCRIPT, FEATURE_IM_CASPER_MSGS, FEATURE_IM_DISABLE_FORCE_OPEN_VK_ME, FEATURE_IM_GIF_AUTOPLAY, FEATURE_IM_MR_IN_VKAPP, FEATURE_MEMORIES_ENABLED, FEATURE_MENU_GAMES_CAROUSEL, FEATURE_MILKSHAKE, FEATURE_MILKSHAKE_NEWS_SCROLL_ON_BACK, FEATURE_MILKSHAKE_SWITCH_THEME_ON_TAP, FEATURE_ML_BRANDS, FEATURE_ML_FEATURES, FEATURE_ML_MODELS_LOADING, FEATURE_MONEY_TRANSFERS_VKPAY, FEATURE_MUSIC_ARTIST_CATALOG, FEATURE_MUSIC_NEW_CATALOG, FEATURE_NARRATIVE_SNIPPET_TYPE, FEATURE_NEWS_GAMES_IN_DISCOVER, FEATURE_NEWS_HEADER_SCROLL, FEATURE_NEW_FORMAT_SHOW_WPB, FEATURE_PODCASTS_PAGE, FEATURE_QR_CREATE_QR, FEATURE_QR_DYNAMIC_FRAME, FEATURE_QR_SCAN_FROM_PHOTO, FEATURE_QR_VISION_DECODER, FEATURE_QUEUE_COUNTERS, FEATURE_REEF, FEATURE_ROAMING_AUTOPLAY, FEATURE_SHARE_MSGS_ON_INVITE, FEATURE_STICKERS_BOT_LINK, FEATURE_STICKERS_NEW_CATALOG, FEATURE_STORIES_AVATAR, FEATURE_STORIES_FEED_TYPE, FEATURE_STORIES_SHOW_ALWAYS, FEATURE_STORY_ANSWER_PUBLIC, FEATURE_STORY_APP_STICKER, FEATURE_STORY_ARCHIVE, FEATURE_STORY_ARCHIVE_POST, FEATURE_STORY_BAKGROUND_ALL, FEATURE_STORY_BOX, FEATURE_STORY_CADRE, FEATURE_STORY_CAMERA_TOOLTIP, FEATURE_STORY_EDITOR_GALLERY, FEATURE_STORY_EDITOR_TYPE, FEATURE_STORY_ENDLESS_VIDEO, FEATURE_STORY_FAST_REACTIONS, FEATURE_STORY_GIF, FEATURE_STORY_GROUPED, FEATURE_STORY_HIGH_QUALITY, FEATURE_STORY_MASKS_FRONTAL, FEATURE_STORY_MENTION_ICON, FEATURE_STORY_MODERN_PUBLISH, FEATURE_STORY_MUSIC_EDITOR, FEATURE_STORY_MUSIC_REPLIES, FEATURE_STORY_MUSIC_REPLIES_2, FEATURE_STORY_NEW_FRAME, FEATURE_STORY_ONE_TIME, FEATURE_STORY_PHOTO_SHARING, FEATURE_STORY_PHOTO_STICKER, FEATURE_STORY_POLLS, FEATURE_STORY_POST_REPOST, FEATURE_STORY_PRELOADING, FEATURE_STORY_QUESTION, FEATURE_STORY_QUESTION_STYLE, FEATURE_STORY_RLOTTIE, FEATURE_STORY_RLOTTIE_CACHE, FEATURE_STORY_SAVE_DEFAULT_ON, FEATURE_STORY_SEND_DIALOG_LIST, FEATURE_STORY_STICKER_PACK, FEATURE_STORY_TIME, FEATURE_STORY_VIEWER_CAMERA, FEATURE_STORY_VOICE_ANSWER, FEATURE_STORY_WITH_CONTEXT, FEATURE_SUPERAPP_MENU, FEATURE_TRAFFIC_SAVER, FEATURE_VKPAY_WIDGET, FEATURE_VKUI_INTERNAL_TO_MINI_APPS, FEATURE_VKUI_TOKEN_CACHE, FEATURE_VK_APPS_SEARCH, FEATURE_VOTES_BALANCE, FEATURE_WEBVIEW_TOKEN_ACTIVE, FEATURE_MILKSHAKE_FORCE_DISABLED, FEATURE_MILKSHAKE_ACTIVATION_DISABLED, EXPERIMENT_NEWS_DISABLE_CACHE ->
true;
default -> false;
default ->
false;
};
}
@@ -26,6 +28,7 @@ public class TogglesHook {
case FEATURE_IMAGE_QUALITY_UPGRADE -> !MediaImageEncoder.needToCompress();
case FEATURE_MENU_GAMES_CAROUSEL -> miniapps();
case FEATURE_TRAFFIC_SAVER -> !disableForceTrafficSaver();
case AB_IM_LONGPOLL_MSG_BATCHING, AB_IM_VIEW_POOL -> Preferences.getBoolValue("batchmessages", false);
default -> true;
};
}
@@ -24,9 +24,7 @@ public class VKUIHook {
private static void applyVKUIStyles(WebView webView) {
if (getBoolValue("VKUI_INJ", true) && webView != null && webView.getUrl() != null && !webView.getUrl().contains("static.vk.com/memories")) {
if (!WebViewColoringUtils.isLoaded) {
WebViewColoringUtils.load();
}
WebViewColoringUtils.load();
loadAndApplyCSS(webView);
}
}
@@ -24,6 +24,8 @@ import com.vk.core.drawable.RecoloredDrawable;
import com.vk.core.ui.themes.MilkshakeHelper;
import com.vk.core.ui.themes.VKTheme;
import com.vk.core.ui.themes.VKThemeHelper;
import com.vk.im.engine.models.dialogs.DialogTheme;
import com.vk.im.ui.themes.DefaultThemeProvider;
import com.vtosters.lite.R;
import com.vtosters.lite.data.ThemeTracker;
import ru.vtosters.lite.deviceinfo.OEMDetector;
@@ -31,9 +33,7 @@ import ru.vtosters.lite.themes.ThemesCore;
import ru.vtosters.lite.themes.ThemesHacks;
import ru.vtosters.lite.themes.ThemesManager;
import ru.vtosters.lite.ui.wallpapers.WallpapersHooks;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.LifecycleUtils;
import ru.vtosters.lite.utils.WebViewColoringUtils;
import java.lang.reflect.Field;
@@ -45,7 +45,7 @@ public class ThemesUtils {
try {
setTheme(theme, LifecycleUtils.getCurrentActivity(), restartActivity);
} catch (Exception e) {
e.printStackTrace();
e.fillInStackTrace();
}
} // Apply VKTheme and ImTheme (hard applying without dynamic theme changing)
@@ -62,14 +62,27 @@ public class ThemesUtils {
activity = LifecycleUtils.getCurrentActivity();
}
VKThemeHelper.theme(theme, activity, fl);
if (isMonetTheme() || ThemesManager.canApplyCustomAccent()) ThemesCore.clear();
if (restartActivity) activity.recreate();
if (isMonetTheme() || ThemesManager.canApplyCustomAccent()) {
ThemesCore.clear();
ThemesCore.init();
DialogTheme.d.a(new DefaultThemeProvider(VKThemeHelper.k).b()); // reset dialog attrs cache
}
ThemeTracker.a();
WebViewColoringUtils.isLoaded = false;
if (restartActivity) {
activity.recreate();
}
new WebView(activity).clearCache(true);
WebCachePreloader.e();
}
public static DialogTheme getDialogTheme() {
if (isMonetTheme()) {
return new DefaultThemeProvider(VKThemeHelper.k).b(); // get directly from theme cuz monet issue
} else {
return DialogTheme.d.a(); // get cached theme
}
}
public static boolean isDarkTheme() {
return VKThemeHelper.r();
}
@@ -28,8 +28,7 @@ public class ThemesCore {
private static int darken_color;
static {
setExceptions();
setThemedColors(ThemesUtils.getAccentColor());
init();
}
public static void setExceptions() {
@@ -201,4 +200,9 @@ public class ThemesCore {
public static boolean isCachedAccents() {
return cachedAccents;
}
}
public static void init() {
setExceptions();
setThemedColors(ThemesUtils.getAccentColor());
}
}
@@ -92,6 +92,11 @@ public class OtherFragment extends TrackedMaterialPreferenceToolbarFragment {
return true;
});
findPreference("batchmessages").setOnPreferenceChangeListener((preference, o) -> {
LifecycleUtils.restartApplicationWithTimer();
return true;
});
findPreference("copyownlink").setOnPreferenceClickListener(preference -> {
copyText("https://vk.com/id" + AccountManagerUtils.getUserId());
ToastUtils.a(requireContext().getString(R.string.link_copied));
@@ -9,24 +9,24 @@ import static ru.vtosters.lite.foaf.FoafBase.getBypassedOnlineInfo;
public class OnlineBypass {
public static JSONObject setOnlineInfo(JSONObject json) throws JSONException {
var id = json.optInt("id");
int id = json.optInt("id");
if (id == AccountManagerUtils.getUserId()) {
return json;
}
var onlineinfo = json.optJSONObject("online_info");
JSONObject onlineinfo = json.optJSONObject("online_info");
if (onlineinfo != null && !onlineinfo.optBoolean("visible") && !Preferences.serverFeaturesDisable()) {
var bypassed = getBypassedOnlineInfo(id);
if (bypassed.optInt("last_seen", 0) != 0) {
json.remove("online_info");
var online_info = new JSONObject()
JSONObject online_info = new JSONObject()
.put("visible", true)
.put("last_seen", bypassed.optInt("last_seen"))
.put("is_online", bypassed.optBoolean("is_online"))
.put("app_id", bypassed.optInt("app_id"))
.put("is_mobile", bypassed.optBoolean("is_mobile"));
var last_seen = new JSONObject()
JSONObject last_seen = new JSONObject()
.put("platform", bypassed.optInt("platform"))
.put("time", bypassed.optInt("last_seen"));
@@ -37,51 +37,95 @@ public class OnlineBypass {
return json;
}
public static JSONArray setOnlineInfoUsers(JSONArray profiles) throws JSONException {
if (profiles == null || profiles.length() == 0 || Preferences.serverFeaturesDisable()) return profiles;
public static JSONArray setOnlineInfoUsers(JSONArray profiles) {
if (shouldReturnProfiles(profiles)) return profiles;
StringBuilder sb = new StringBuilder();
var curVkId = AccountManagerUtils.getUserId();
int curVkId = AccountManagerUtils.getUserId();
for (int i = 0; i < profiles.length(); i++) {
JSONObject profile = profiles.getJSONObject(i);
JSONObject profile = getProfile(profiles, i);
int id = profile.optInt("id", -1);
JSONObject onlinfo = profile.optJSONObject("online_info");
if (id == curVkId || id < 0 || onlinfo == null || onlinfo.optBoolean("visible")) {
continue;
}
sb.append(id);
sb.append(",");
}
var ids = sb.toString();
if (!ids.isEmpty()) {
ids = ids.substring(0, ids.length() - 1);
} else {
return profiles;
if (shouldSkipProfile(id, curVkId, onlinfo)) continue;
sb.append(id).append(",");
}
String ids = prepareIds(sb);
if (ids.isEmpty()) return profiles;
JSONObject bypassedObj = getBypassedOnlineInfo(ids);
for (int i = 0; i < profiles.length(); i++) {
JSONObject profile = profiles.getJSONObject(i);
JSONObject profile = getProfile(profiles, i);
int id = profile.optInt("id");
JSONObject bypassed = bypassedObj.optJSONObject(Integer.toString(id));
if (bypassed == null) {
continue;
}
profile.remove("online_info");
var online_info = new JSONObject()
if (bypassed == null) continue;
JSONObject online_info = createOnlineInfo(bypassed);
JSONObject last_seen = createLastSeen(bypassed);
updateProfile(profile, online_info, last_seen);
}
return profiles;
}
private static boolean shouldReturnProfiles(JSONArray profiles) {
return profiles == null || profiles.length() == 0 || Preferences.serverFeaturesDisable();
}
private static JSONObject getProfile(JSONArray profiles, int i) {
try {
return profiles.getJSONObject(i);
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
private static boolean shouldSkipProfile(int id, int curVkId, JSONObject onlinfo) {
return id == curVkId || id < 0 || onlinfo == null || onlinfo.optBoolean("visible");
}
private static String prepareIds(StringBuilder sb) {
String ids = sb.toString();
if (!ids.isEmpty()) {
ids = ids.substring(0, ids.length() - 1);
}
return ids;
}
private static JSONObject createOnlineInfo(JSONObject bypassed) {
try {
return new JSONObject()
.put("visible", true)
.put("last_seen", bypassed.optInt("last_seen"))
.put("is_online", bypassed.optBoolean("is_online"))
.put("app_id", bypassed.optInt("app_id"))
.put("is_mobile", bypassed.optBoolean("is_mobile"));
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
var last_seen = new JSONObject()
private static JSONObject createLastSeen(JSONObject bypassed) {
try {
return new JSONObject()
.put("platform", bypassed.optInt("platform"))
.put("time", bypassed.optInt("last_seen"));
profile.put("last_seen", last_seen).put("online_info", online_info);
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
return profiles;
private static void updateProfile(JSONObject profile, JSONObject online_info, JSONObject last_seen) {
try {
profile.remove("online_info");
profile.put("last_seen", last_seen).put("online_info", online_info);
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
}
@@ -9,7 +9,6 @@ import static ru.vtosters.hooks.other.ThemesUtils.*;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
public class WebViewColoringUtils {
public static boolean isLoaded = false;
public static String loadedCSS = "";
public static String loadedCSSAmoled = "";
@@ -53,7 +52,6 @@ public class WebViewColoringUtils {
public static void load() {
loadedCSS = readCSS("vt_ui_accent.css");
loadedCSSAmoled = readCSS("vt_ui_oled.css");
isLoaded = true;
}
public static void inject(WebView webView, String str) {
@@ -3,6 +3,7 @@ package ru.vtosters.sponsorpost.internal;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import ru.vtosters.hooks.other.Preferences;
import ru.vtosters.lite.utils.AndroidUtils;
import java.util.HashSet;
@@ -22,7 +23,7 @@ public class VotesPreferences {
}
public static boolean isEnabled() {
return preferences.getBoolean("sponsortesting", false);
return preferences.getBoolean("sponsortesting", false) && !Preferences.serverFeaturesDisable();
}
public static void setEnabled(boolean status) {
@@ -3,6 +3,7 @@ package ru.vtosters.sponsorpost.utils;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import ru.vtosters.hooks.other.Preferences;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.sponsorpost.data.Post;
@@ -23,7 +24,7 @@ public class PostsPreferences {
}
public static boolean isEnabled() {
return preferences.getBoolean("sponsorpost", true);
return preferences.getBoolean("sponsorpost", true) && !Preferences.serverFeaturesDisable();
}
public static void setEnabled(boolean status) {
+2
View File
@@ -75,6 +75,7 @@
--header_tint: %header_text% !important;
--header_tint_alternate: %header_text% !important;
--vkui--color_icon_accent_themed: %header_text% !important;
--vkui--color_text_accent_themed: %header_text% !important;
}
@@ -139,6 +140,7 @@
--header_tint: %header_text% !important;
--header_tint_alternate: %header_text% !important;
--vkui--color_icon_accent_themed: %header_text% !important;
--vkui--color_text_accent_themed: %header_text% !important;
--color_field_border: %field_border% !important;
--vkui--color_field_border: %field_border% !important;
--color_field_background: %field_background% !important;
+5
View File
@@ -8,6 +8,11 @@
<Preference
android:key="microgsettings"
android:title="@string/microgsett"/>
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="batchmessages"
android:summary="Поможет исправить скорость загрузки сообщений, но работает нестабильно"
android:title="Альтернативная загрузка сообщений"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/vtverify">
<Preference
@@ -82,10 +82,6 @@
move-result-object p1
invoke-static {p1}, Lru/vtosters/hooks/OnlineFormatterHook;->onlineHookProfiles(Lorg/json/JSONObject;)Lorg/json/JSONObject;
move-result-object p1
const-string v0, "items"
.line 3
@@ -50,10 +50,6 @@
move-result-object p1
invoke-static {p1}, Lru/vtosters/hooks/OnlineFormatterHook;->onlineHookProfiles(Lorg/json/JSONObject;)Lorg/json/JSONObject;
move-result-object p1
const-string v0, "items"
.line 2
@@ -50,9 +50,6 @@
move-result-object p1
invoke-static {p1}, Lru/vtosters/hooks/OnlineFormatterHook;->onlineHookProfiles(Lorg/json/JSONObject;)Lorg/json/JSONObject;
move-result-object p1
const-string v0, "items"
.line 2
@@ -50,10 +50,6 @@
move-result-object p1
invoke-static {p1}, Lru/vtosters/hooks/OnlineFormatterHook;->onlineHookProfiles(Lorg/json/JSONObject;)Lorg/json/JSONObject;
move-result-object p1
const-string v0, "items"
.line 2
@@ -60,6 +60,10 @@
move-result-object p1
invoke-static {p1}, Lru/vtosters/hooks/OnlineFormatterHook;->onlineHookProfiles(Lorg/json/JSONObject;)Lorg/json/JSONObject;
move-result-object p1
const-string v0, "JSONObject(response).getJSONObject(\"response\")"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
@@ -76,6 +80,10 @@
move-object/from16 v0, p1
invoke-static {v0}, Lru/vtosters/hooks/OnlineFormatterHook;->onlineHookProfiles(Lorg/json/JSONObject;)Lorg/json/JSONObject;
move-result-object v0
.line 3
new-instance v1, Lcom/vk/im/engine/models/ProfilesSimpleInfo;
@@ -164,6 +164,10 @@
invoke-static {v0}, Lru/vtosters/hooks/RenameHook;->injectIntoJson(Lorg/json/JSONObject;)V
invoke-static {v0}, Lru/vtosters/hooks/OnlineFormatterHook;->onlineHook(Lorg/json/JSONObject;)Lorg/json/JSONObject;
move-result-object v0
const-string v2, ""
.line 1
@@ -52,79 +52,11 @@
}
.end annotation
.line 2
:try_start_0
new-instance v0, Lorg/json/JSONObject;
invoke-static {p1}, Lru/vtosters/hooks/OnlineFormatterHook;->onlineHookList(Ljava/lang/String;)Landroid/util/SparseArray;
invoke-direct {v0, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
move-result-object v0
const-string p1, "response"
invoke-virtual {v0, p1}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;
move-result-object p1
invoke-static {p1}, Lru/vtosters/hooks/OnlineFormatterHook;->onlineHookList(Lorg/json/JSONArray;)Lorg/json/JSONArray;
move-result-object p1
.line 3
new-instance v0, Landroid/util/SparseArray;
invoke-virtual {p1}, Lorg/json/JSONArray;->length()I
move-result v1
invoke-direct {v0, v1}, Landroid/util/SparseArray;-><init>(I)V
const/4 v1, 0x0
.line 4
invoke-virtual {p1}, Lorg/json/JSONArray;->length()I
move-result v2
:goto_0
if-ge v1, v2, :cond_0
.line 5
invoke-virtual {p1, v1}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;
move-result-object v3
const-string v4, "ja.getJSONObject(i)"
invoke-static {v3, v4}, Lkotlin/jvm/internal/Intrinsics;->a(Ljava/lang/Object;Ljava/lang/String;)V
invoke-static {v3}, Lcom/vk/im/engine/internal/api_parsers/UserApiParser;->b(Lorg/json/JSONObject;)Lcom/vk/im/engine/models/users/User;
move-result-object v3
.line 6
invoke-virtual {v3}, Lcom/vk/im/engine/models/users/User;->getId()I
move-result v4
invoke-virtual {v0, v4, v3}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V
:try_end_0
.catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_0
return-object v0
:catch_0
move-exception p1
.line 7
new-instance v0, Lcom/vk/api/sdk/exceptions/VKApiIllegalResponseException;
invoke-direct {v0, p1}, Lcom/vk/api/sdk/exceptions/VKApiIllegalResponseException;-><init>(Ljava/lang/Throwable;)V
throw v0
.end method
.method public bridge synthetic a(Ljava/lang/String;)Ljava/lang/Object;
@@ -1196,7 +1196,9 @@
.locals 1
.line 1
iget-object v0, p0, Lcom/vk/im/engine/models/dialogs/Dialog;->theme:Lcom/vk/im/engine/models/dialogs/DialogTheme;
invoke-static {}, Lru/vtosters/hooks/other/ThemesUtils;->getDialogTheme()Lcom/vk/im/engine/models/dialogs/DialogTheme;
move-result-object v0
return-object v0
.end method
@@ -43,103 +43,9 @@
sput-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->c:Ljava/lang/Object;
.line 3
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/AdwHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 4
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/ApexHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 5
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/DefaultBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 6
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/NewHtcHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 7
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/NovaHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 8
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/SonyHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 9
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/AsusHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 10
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/HuaweiHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 11
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/OPPOHomeBader;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 12
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/SamsungHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 13
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/ZukHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 14
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/VivoHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 15
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/ZTEHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 16
sget-object v0, Lme/leolin/shortcutbadger/ShortcutBadger;->a:Ljava/util/List;
const-class v1, Lme/leolin/shortcutbadger/impl/EverythingMeHomeBadger;
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
invoke-static {v0}, Lru/vtosters/hooks/ShortcutBadgerHook;->init(Ljava/util/List;)V
return-void
.end method