some important fixes
This commit is contained in:
@@ -23,7 +23,6 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment{
|
||||
private void prefs(){
|
||||
findPreference("vkme").setOnPreferenceClickListener(new MessagesFragment.restart());
|
||||
findPreference("vkme_notifs").setOnPreferenceClickListener(new MessagesFragment.restart());
|
||||
findPreference("isBGStickersEnabled").setOnPreferenceClickListener(new MessagesFragment.clearCache());
|
||||
findPreference("roundedmsgs").setOnPreferenceClickListener(new MessagesFragment.restart());
|
||||
findPreference("systememoji").setOnPreferenceClickListener(new MessagesFragment.restart());
|
||||
}
|
||||
|
||||
@@ -46,6 +46,10 @@ import com.vtosters.lite.api.ExtendedUserProfile;
|
||||
import com.vtosters.lite.auth.VKAccountManager;
|
||||
import com.vtosters.lite.im.ImEngineProvider;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
@@ -61,6 +65,8 @@ import ru.vtosters.lite.ui.dialogs.OTADialog;
|
||||
import ru.vtosters.lite.ui.dialogs.Start;
|
||||
|
||||
public class Globals{
|
||||
private static final int BUFFER_SIZE = 2048;
|
||||
|
||||
private static final List<Activity> activities = new ArrayList<>();
|
||||
|
||||
public static SharedPreferences getDefprefs(){
|
||||
@@ -81,6 +87,21 @@ public class Globals{
|
||||
// VKIDProtection.alert(activity);
|
||||
}
|
||||
|
||||
public static byte[] readFileFully(File file) throws IOException {
|
||||
return readFully(new FileInputStream(file));
|
||||
}
|
||||
|
||||
public static byte[] readFully(InputStream is) throws IOException {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
|
||||
byte[] buffer = new byte[BUFFER_SIZE];
|
||||
int len;
|
||||
while((len = is.read(buffer)) > 0)
|
||||
bos.write(buffer, 0, len);
|
||||
|
||||
return bos.toByteArray();
|
||||
}
|
||||
|
||||
public static void componentSwitcher(String component, Boolean enabled){
|
||||
var packageManager = Objects.requireNonNull(getContext()).getPackageManager();
|
||||
packageManager.setComponentEnabledSetting(new ComponentName(getPackageName(), getPackageName() + "." + component), enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
|
||||
|
||||
@@ -21,6 +21,7 @@ public class JsonInjectors{
|
||||
var link = "https://vk.com/vtosters_official";
|
||||
var text_color = "2D81E0";
|
||||
|
||||
// JSONObject jsonObj = new JSONObject("{\"action\":{\"target\":\"internal\",\"type\":\"open_url\",\"url\":\"" + link + "\"},\"title\":\"" + title + "\",\"icons\":[{\"url\":\"" + pic + "\",\"width\":20,\"height\":20},{\"url\":\"" + pic + "\",\"width\":40,\"height\":40},{\"url\":\"" + pic + "\",\"width\":60,\"height\":60},{\"url\":\"" + pic + "\",\"width\":80,\"height\":80}],\"text_color\":\"" + text_color + "\"}");
|
||||
return new JSONObject(decode("eyJhY3Rpb24iOnsidGFyZ2V0IjoiaW50ZXJuYWwiLCJ0eXBlIjoib3Blbl91cmwiLCJ1cmwiOiI=") + link + decode("In0sInRpdGxlIjoi") + title + decode("IiwiaWNvbnMiOlt7InVybCI6Ig==") + pic + decode("Iiwid2lkdGgiOjIwLCJoZWlnaHQiOjIwfSx7InVybCI6Ig==") + pic + decode("Iiwid2lkdGgiOjQwLCJoZWlnaHQiOjQwfSx7InVybCI6Ig==") + pic + decode("Iiwid2lkdGgiOjYwLCJoZWlnaHQiOjYwfSx7InVybCI6Ig==") + pic + decode("Iiwid2lkdGgiOjgwLCJoZWlnaHQiOjgwfV0sInRleHRfY29sb3IiOiI=") + text_color + decode("In0="));
|
||||
}
|
||||
|
||||
|
||||
@@ -110,10 +110,6 @@ public class Preferences{
|
||||
return getBoolValue("friendsrecomm", false);
|
||||
}
|
||||
|
||||
public static boolean isBGStickersEnabled(){
|
||||
return getBoolValue("isBGStickersEnabled", true);
|
||||
}
|
||||
|
||||
public static boolean ads(){
|
||||
return getBoolValue("__dbg_no_ads", false);
|
||||
}
|
||||
@@ -223,8 +219,12 @@ public class Preferences{
|
||||
return getBoolValue("musicnewcatalog", true);
|
||||
}
|
||||
|
||||
public static boolean newvideolayout(){
|
||||
return getBoolValue("newvideolayout", true);
|
||||
public static boolean postsredesign(){
|
||||
return getBoolValue("postsredesign", true);
|
||||
}
|
||||
|
||||
public static boolean quic(){
|
||||
return getBoolValue("quic", true);
|
||||
}
|
||||
|
||||
public static boolean returnnorifs(){
|
||||
|
||||
@@ -8,7 +8,6 @@ import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
|
||||
import static ru.vtosters.lite.utils.Globals.getResources;
|
||||
import static ru.vtosters.lite.utils.Preferences.color_grishka;
|
||||
import static ru.vtosters.lite.utils.Preferences.isBGStickersEnabled;
|
||||
import static ru.vtosters.lite.utils.Preferences.navbar;
|
||||
import static ru.vtosters.lite.utils.Preferences.systemtheme;
|
||||
import static ru.vtosters.lite.utils.Preferences.vkme;
|
||||
@@ -339,13 +338,6 @@ public class Themes{
|
||||
return vksans() ? R.font.vk_sans_text_regular : R.font.roboto_regular;
|
||||
}
|
||||
|
||||
public static String getBackgroundStickers(){
|
||||
if(isBGStickersEnabled()){
|
||||
return "images_with_background";
|
||||
}
|
||||
return "images";
|
||||
}
|
||||
|
||||
public static int getNavigationHeight(int Default){
|
||||
int VKME = R.dimen.design_bottom_sheet_peek_height_min;
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Preferences.feedcache;
|
||||
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
|
||||
import static ru.vtosters.lite.utils.Preferences.milkshake;
|
||||
import static ru.vtosters.lite.utils.Preferences.musicnewcatalog;
|
||||
import static ru.vtosters.lite.utils.Preferences.newvideolayout;
|
||||
import static ru.vtosters.lite.utils.Preferences.postsredesign;
|
||||
import static ru.vtosters.lite.utils.Preferences.quic;
|
||||
import static ru.vtosters.lite.utils.Preferences.superapp;
|
||||
|
||||
import com.vk.toggle.FeatureManager;
|
||||
@@ -138,7 +140,14 @@ public class Toggles{
|
||||
case FEATURE_MUSIC_NEW_CATALOG:
|
||||
return musicnewcatalog();
|
||||
case AB_NEWS_VIDEO_LAYOUT_TEXT:
|
||||
return newvideolayout();
|
||||
case AB_IM_LP_ATTACHES:
|
||||
case FEATURE_COMPACT_REPOST:
|
||||
return postsredesign();
|
||||
case FEATURE_GQUIC_BETA_TEST:
|
||||
case FEATURE_GQUIC_INTEGRATION:
|
||||
return quic();
|
||||
case FEATURE_IMAGE_QUALITY_UPGRADE:
|
||||
return getBoolValue("compressPhotos", true);
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user