Compare commits

..
Author SHA1 Message Date
gdlbo 45f7cc4484 fixed friends recomms issue 2023-12-13 21:23:31 +03:00
gdlbo 886ddd60c1 fix community 2023-12-13 21:00:02 +03:00
gdlbo adc06426ac fixed issue with country and city in profiles 2023-12-13 20:44:17 +03:00
gdlbo 62aa568599 rewrite to java 2023-12-13 17:54:28 +03:00
gdlbo f2ac845797 Update FFMpeg.java 2023-10-14 16:05:51 +03:00
gdlbo a85e55a594 meta data pref 2023-10-12 22:45:43 +03:00
gdlbo e2775db4e5 fixed english translation 2023-10-12 20:19:17 +03:00
gdlbo 589e8928a0 Bitrate upgrade (#1498)
libvkmedia.so armv7/arm64
2023-10-12 19:57:00 +03:00
gdlbo cd189b1dda fixed id3v2 meta 2023-10-10 23:15:11 +03:00
gdlbo 14c111a3e6 some music fixes 2023-10-10 22:53:16 +03:00
gdlbo b506c56346 fixed compiling issue 2023-10-07 03:13:24 +03:00
gdlbo bbbc94e510 added facebook graph disabler 2023-10-07 03:07:31 +03:00
gdlbo 8cb2c380e7 fixed adding "null" to track name 2023-10-06 12:44:55 +03:00
gdlbo b9879f9ed7 updated appcenter 2023-10-04 19:44:24 +03:00
gdlbo cf05e051e8 added summary for advanced online info 2023-10-04 13:47:47 +03:00
gdlbo 963c4d81ba upped ver 2023-10-04 13:37:20 +03:00
gdlbo 099c699702 added vkn online fix disabler 2023-10-04 13:37:07 +03:00
gdlbo 1117fc19d4 added force tablet mode 2023-10-02 16:28:08 +03:00
gdlbo 78dca26063 fix #1489 2023-10-02 14:52:52 +03:00
30 changed files with 631 additions and 2644 deletions
+2 -2
View File
@@ -91,8 +91,8 @@ task testClasses {
}
dependencies {
implementation 'com.microsoft.appcenter:appcenter-analytics:5.0.1'
implementation 'com.microsoft.appcenter:appcenter-crashes:5.0.1'
implementation 'com.microsoft.appcenter:appcenter-analytics:5.0.2'
implementation 'com.microsoft.appcenter:appcenter-crashes:5.0.2'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
implementation 'net.sourceforge.streamsupport:streamsupport-minifuture:1.7.4'
implementation 'com.google.guava:guava:23.3-android'
@@ -0,0 +1,505 @@
package com.vtosters.lite.api.execute;
import android.annotation.SuppressLint;
import android.graphics.RectF;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
import com.vk.api.base.utils.ApiUtils;
import com.vk.core.network.Network;
import com.vk.core.util.AppContextHolder;
import com.vk.core.util.Screen;
import com.vk.dto.common.data.VKList;
import com.vk.dto.gift.GiftItem;
import com.vk.dto.group.Group;
import com.vk.dto.newsfeed.entries.ProfilesRecommendations;
import com.vk.dto.photo.Photo;
import com.vk.dto.user.UserProfile;
import com.vk.dto.user.deactivation.UserDeactivation;
import com.vtosters.lite.api.ExtendedUserProfile;
import com.vtosters.lite.auth.VKAccountManager;
import com.vtosters.lite.utils.Utils;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import ru.vtosters.hooks.OnlineFormatterHook;
import ru.vtosters.hooks.RenameHook;
import ru.vtosters.hooks.ssfs.ProfileHook;
import ru.vtosters.lite.di.singleton.VtOkHttpClient;
import ru.vtosters.lite.proxy.ProxyUtils;
import ru.vtosters.lite.utils.AccountManagerUtils;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
public class GetFullUserProfile extends GetFullProfile<ExtendedUserProfile> {
private static final OkHttpClient mClient = VtOkHttpClient.getInstance();
public GetFullUserProfile(int i, String str, String str2) {
super(i, "execute.getFullProfileNewNew");
i = i == 0 ? VKAccountManager.d().D0() : i;
b("user_id", i);
b("func_v", 23); // 11
this.F = i;
if (!TextUtils.isEmpty(str2)) {
c("source", str2);
}
b("photo_sizes", 1);
b("skip_hidden", 1);
if (TextUtils.isEmpty(str)) {
return;
}
c("access_keys", str);
}
public JSONArray getCitiesNames(String ids) {
var request = new Request.a()
.b("https://" + ProxyUtils.getApi() + "/method/" + "database.getCitiesById"
+ "?v=5.119"
+ "&city_ids="
+ ids
+ "&access_token="
+ AccountManagerUtils.getUserToken())
.a(Headers.a("User-Agent", Network.l.c().a(), "Content-Type", "application/x-www-form-urlencoded; charset=utf-8")).a();
try {
return new JSONObject(mClient.a(request).execute().a().g()).getJSONArray("response");
} catch (JSONException | IOException e) {
Log.d(this.getClass().getSimpleName(), e.toString());
}
return new JSONArray();
}
public JSONArray getCountriesNames(String ids) {
var request = new Request.a()
.b("https://" + ProxyUtils.getApi() + "/method/" + "database.getCountriesById"
+ "?v=5.119"
+ "&country_ids="
+ ids
+ "&access_token="
+ AccountManagerUtils.getUserToken())
.a(Headers.a("User-Agent", Network.l.c().a(), "Content-Type", "application/x-www-form-urlencoded; charset=utf-8")).a();
try {
return new JSONObject(mClient.a(request).execute().a().g()).getJSONArray("response");
} catch (JSONException | IOException e) {
Log.d(this.getClass().getSimpleName(), e.toString());
}
return new JSONArray();
}
protected ExtendedUserProfile o() {
return new ExtendedUserProfile();
}
@SuppressLint("ResourceType")
public void a(ExtendedUserProfile extendedUserProfile, JSONObject jSONObject) throws JSONException {
char c;
RenameHook.injectIntoJson(jSONObject);
JSONObject onlineHook = OnlineFormatterHook.onlineHook(jSONObject);
UserProfile userProfile = extendedUserProfile.a;
int i = onlineHook.getInt("id");
this.F = i;
userProfile.b = i;
ProfileHook.fetchInfo(extendedUserProfile, onlineHook);
extendedUserProfile.a.c = onlineHook.getString("first_name");
extendedUserProfile.a.e = onlineHook.getString("last_name");
extendedUserProfile.a.d = extendedUserProfile.a.c + " " + extendedUserProfile.a.e;
extendedUserProfile.a.f = onlineHook.getString(Screen.a() > 1.0f ? "photo_medium_rec" : "photo_rec");
extendedUserProfile.a.h = onlineHook.getInt("friend_status") == 3;
extendedUserProfile.j = onlineHook.optString("photo_max", onlineHook.getString("photo_medium_rec"));
extendedUserProfile.m = onlineHook.optString("activity", "");
extendedUserProfile.a.g = onlineHook.getInt("sex") == 1;
extendedUserProfile.a.E = UserProfile.d(jSONObject);
if (onlineHook.has("crop_photo")) {
extendedUserProfile.k = new Photo(onlineHook.getJSONObject("crop_photo").getJSONObject("photo"));
JSONObject jSONObject2 = onlineHook.getJSONObject("crop_photo").getJSONObject("rect");
JSONObject jSONObject3 = onlineHook.getJSONObject("crop_photo").getJSONObject("crop");
double d = jSONObject3.getDouble("x");
double d2 = jSONObject3.getDouble("x2");
double d3 = jSONObject3.getDouble("y");
double d4 = jSONObject3.getDouble("y2");
double d5 = jSONObject2.getDouble("x");
double d6 = jSONObject2.getDouble("x2");
double d7 = jSONObject2.getDouble("y");
double d8 = (d2 - d) / 100.0d;
double d9 = (d4 - d3) / 100.0d;
double d10 = (d / 100.0d) + ((d5 / 100.0d) * d8);
double d11 = (d3 / 100.0d) + ((d7 / 100.0d) * d9);
extendedUserProfile.l = new RectF((float) d10, (float) d11, (float) (d10 + (((d6 - d5) / 100.0d) * d8)), (float) (d11 + (((jSONObject2.getDouble("y2") - d7) / 100.0d) * d9)));
}
SparseArray<String> sparseArray = new SparseArray<>();
SparseArray<String> sparseArray2 = new SparseArray<>();
if (onlineHook.has("cities") && onlineHook.getJSONArray("cities").length() > 0) {
List<String> cityNames = new ArrayList<>();
JSONArray cities = onlineHook.getJSONArray("cities");
for (int i21 = 0; i21 < cities.length(); i21++) {
cityNames.add(cities.getString(i21));
}
JSONArray citiesNamesJSONArray = getCitiesNames(String.join(", ", cityNames));
Log.d(this.getClass().getSimpleName(), citiesNamesJSONArray.toString());
for (int i22 = 0; i22 < citiesNamesJSONArray.length(); i22++) {
JSONObject cityJSONObject = citiesNamesJSONArray.getJSONObject(i22);
int cityid = cityJSONObject.getInt("id");
String cityTitle = cityJSONObject.getString("title");
sparseArray.put(cityid, cityTitle);
}
extendedUserProfile.i0 = sparseArray.get(cities.getInt(0));
}
if (onlineHook.has("countries") && onlineHook.getJSONArray("countries").length() > 0) {
JSONArray countries = onlineHook.getJSONArray("countries");
List<String> countryList = new ArrayList<>();
for (int i23 = 0; i23 < countries.length(); i23++) {
countryList.add(countries.getString(i23));
}
JSONArray countryInfo = getCountriesNames(String.join(", ", countryList));
Log.d(this.getClass().getSimpleName(), countryInfo.toString());
for (int i24 = 0; i24 < countryInfo.length(); i24++) {
JSONObject country = countryInfo.getJSONObject(i24);
int countryid = country.getInt("id");
String countryTitle = country.getString("title");
sparseArray2.put(countryid, countryTitle);
}
extendedUserProfile.j0 = sparseArray2.get(countries.getInt(0));
}
extendedUserProfile.U = onlineHook.getInt("can_write_private_message") == 1;
extendedUserProfile.X = onlineHook.getInt("can_post") == 1;
extendedUserProfile.Y = onlineHook.optInt("can_suggest") == 1;
extendedUserProfile.V = onlineHook.optInt("can_see_all_posts") == 1;
extendedUserProfile.f0 = onlineHook.optInt("can_see_archived_posts") == 1;
extendedUserProfile.a0 = "all".equals(onlineHook.optString("wall_default"));
extendedUserProfile.W = onlineHook.optBoolean("can_call", false);
extendedUserProfile.Z = onlineHook.optInt("blacklisted_by_me") == 1;
if (onlineHook.optInt("blacklisted") == 1) {
extendedUserProfile.Y0 = new ExtendedUserProfile.c();
}
extendedUserProfile.u = onlineHook.optInt("relation");
if (onlineHook.has("relation_partner")) {
extendedUserProfile.v = onlineHook.getJSONObject("relation_partner").getInt("id");
extendedUserProfile.w = onlineHook.getJSONObject("relation_partner").getString("first_name") + " " + onlineHook.getJSONObject("relation_partner").getString("last_name");
}
if (onlineHook.has("bdate")) {
String string = onlineHook.getString("bdate");
extendedUserProfile.a.I = string;
String[] split = string.split("\\.");
extendedUserProfile.s = Integer.parseInt(split[0]);
extendedUserProfile.t = Integer.parseInt(split[1]);
if (split.length > 2) {
extendedUserProfile.r = Integer.parseInt(split[2]);
}
}
extendedUserProfile.d = onlineHook.optString("first_name_dat", extendedUserProfile.a.c);
extendedUserProfile.b = onlineHook.optString("first_name_gen", extendedUserProfile.a.c);
extendedUserProfile.c = onlineHook.optString("first_name_ins", extendedUserProfile.a.c);
extendedUserProfile.h = onlineHook.optString("first_name_acc", extendedUserProfile.a.c);
extendedUserProfile.g = onlineHook.optString("last_name_dat", extendedUserProfile.a.e);
extendedUserProfile.e = onlineHook.optString("last_name_gen", extendedUserProfile.a.e);
extendedUserProfile.f = onlineHook.optString("last_name_ins", extendedUserProfile.a.e);
String optString = onlineHook.optString("last_name_acc", extendedUserProfile.a.e);
extendedUserProfile.i = optString;
if (onlineHook.has("mobile_phone") && !onlineHook.getString("mobile_phone").isEmpty()) {
extendedUserProfile.l0 = onlineHook.getString("mobile_phone");
}
if (onlineHook.has("home_phone") && !onlineHook.getString("home_phone").isEmpty()) {
extendedUserProfile.m0 = onlineHook.getString("home_phone");
}
if (onlineHook.has("skype")) {
extendedUserProfile.n0 = onlineHook.getString("skype");
}
if (onlineHook.has("twitter")) {
extendedUserProfile.o0 = onlineHook.getString("twitter");
}
if (onlineHook.has("livejournal")) {
extendedUserProfile.r0 = onlineHook.getString("livejournal");
}
if (onlineHook.has("facebook") && onlineHook.optLong("facebook", -1L) != -1) {
extendedUserProfile.q0 = onlineHook.getLong("facebook");
extendedUserProfile.p0 = onlineHook.getString("facebook_name");
}
if (onlineHook.has("instagram")) {
extendedUserProfile.u0 = onlineHook.getString("instagram");
}
extendedUserProfile.R0 = onlineHook.getInt("friend_status");
JSONArray optJSONArray = onlineHook.optJSONArray("schools");
extendedUserProfile.v0 = new ArrayList<>();
ArrayList arrayList = null;
if (optJSONArray != null) {
for (int i4 = 0; i4 < optJSONArray.length(); i4++) {
ExtendedUserProfile.f fVar = new ExtendedUserProfile.f();
JSONObject jSONObject6 = optJSONArray.getJSONObject(i4);
fVar.c = sparseArray.get(jSONObject6.optInt(optString));
fVar.a = jSONObject6.optString("name", "???");
fVar.g = jSONObject6.optInt("year_from");
fVar.f = jSONObject6.optInt("year_to");
fVar.h = jSONObject6.optInt("year_graduated");
fVar.b = jSONObject6.optString("class", null);
fVar.d = jSONObject6.optString("speciality", null);
fVar.e = jSONObject6.optString("type_str", AppContextHolder.a.getResources().getString(2131889117));
extendedUserProfile.v0.add(fVar);
}
}
extendedUserProfile.w0 = new ArrayList<>();
JSONArray optJSONArray2 = onlineHook.optJSONArray("universities");
if (optJSONArray2 != null) {
for (int i5 = 0; i5 < optJSONArray2.length(); i5++) {
ExtendedUserProfile.g gVar = new ExtendedUserProfile.g();
JSONObject jSONObject7 = optJSONArray2.getJSONObject(i5);
gVar.a = jSONObject7.getString("name").trim();
if (jSONObject7.has("faculty_name")) {
gVar.b = jSONObject7.getString("faculty_name").trim();
}
if (jSONObject7.has("chair_name")) {
gVar.c = jSONObject7.getString("chair_name").trim();
}
gVar.d = jSONObject7.optInt("graduation");
extendedUserProfile.w0.add(gVar);
}
}
if (onlineHook.has("interests") && onlineHook.getString("interests").length() > 0) {
extendedUserProfile.y0 = onlineHook.getString("interests");
}
if (onlineHook.has("movies") && onlineHook.getString("movies").length() > 0) {
extendedUserProfile.A0 = onlineHook.getString("movies");
}
if (onlineHook.has("music") && onlineHook.getString("music").length() > 0) {
extendedUserProfile.z0 = onlineHook.getString("music");
}
if (onlineHook.has("tv") && onlineHook.getString("tv").length() > 0) {
extendedUserProfile.B0 = onlineHook.getString("tv");
}
if (onlineHook.has("books") && onlineHook.getString("books").length() > 0) {
extendedUserProfile.C0 = onlineHook.getString("books");
}
if (onlineHook.has("games") && onlineHook.getString("games").length() > 0) {
extendedUserProfile.D0 = onlineHook.getString("games");
}
if (onlineHook.has("about") && onlineHook.getString("about").length() > 0) {
extendedUserProfile.F0 = onlineHook.getString("about");
}
if (onlineHook.has("quotes") && onlineHook.getString("quotes").length() > 0) {
extendedUserProfile.E0 = onlineHook.getString("quotes");
}
if (onlineHook.has("activities") && onlineHook.getString("activities").length() > 0) {
extendedUserProfile.x0 = onlineHook.getString("activities");
}
if (onlineHook.has("home_town") && onlineHook.getString("home_town").length() > 0) {
extendedUserProfile.g0 = onlineHook.getString("home_town");
}
if (onlineHook.has("site") && onlineHook.getString("site").length() > 0) {
extendedUserProfile.M = onlineHook.getString("site");
}
extendedUserProfile.a.Q.b(onlineHook);
JSONObject optJSONObject = onlineHook.optJSONObject("personal");
if (optJSONObject != null) {
JSONArray optJSONArray3 = optJSONObject.optJSONArray("langs");
if (optJSONArray3 != null) {
ArrayList arrayList2 = new ArrayList<>();
for (int i6 = 0; i6 < optJSONArray3.length(); i6++) {
arrayList2.add(optJSONArray3.getString(i6));
}
extendedUserProfile.G0 = TextUtils.join(", ", arrayList2);
}
extendedUserProfile.J0 = optJSONObject.optInt("political");
extendedUserProfile.H0 = optJSONObject.optString("religion");
extendedUserProfile.K0 = optJSONObject.optInt("life_main");
extendedUserProfile.L0 = optJSONObject.optInt("people_main");
extendedUserProfile.I0 = optJSONObject.optString("inspired_by");
extendedUserProfile.M0 = optJSONObject.optInt("smoking");
extendedUserProfile.N0 = optJSONObject.optInt("alcohol");
}
SparseArray sparseArray3 = new SparseArray();
JSONArray optJSONArray4 = onlineHook.optJSONArray("relatives_profiles");
if (optJSONArray4 != null) {
for (int i7 = 0; i7 < optJSONArray4.length(); i7++) {
UserProfile userProfile2 = new UserProfile(optJSONArray4.getJSONObject(i7));
sparseArray3.put(userProfile2.b, userProfile2);
}
}
JSONArray optJSONArray5 = onlineHook.optJSONArray("relatives");
if (optJSONArray5 != null) {
ArrayList arrayList3 = null;
ArrayList arrayList4 = null;
ArrayList arrayList5 = null;
ArrayList arrayList6 = null;
for (int i8 = 0; i8 < optJSONArray5.length(); i8++) {
JSONObject jSONObject8 = optJSONArray5.getJSONObject(i8);
int i9 = jSONObject8.getInt("id");
if (ApiUtils.a(sparseArray3, i9)) {
String valueOf = jSONObject8.getString("type");
switch (valueOf.hashCode()) {
case -995424086 -> {
if (valueOf.equals("parent")) {
c = 4;
break;
}
c = 65535;
}
case -268316490 -> {
if (valueOf.equals("grandparent")) {
c = 1;
break;
}
c = 65535;
}
case 94631196 -> {
if (valueOf.equals("child")) {
c = 2;
break;
}
c = 65535;
}
case 395180944 -> {
if (valueOf.equals("grandchild")) {
c = 0;
break;
}
c = 65535;
}
case 2083595970 -> {
if (valueOf.equals("sibling")) {
c = 3;
break;
}
c = 65535;
}
default -> c = 65535;
}
switch (c) {
case 0 -> arrayList6 = Utils.a(arrayList6, sparseArray3.get(i9));
case 1 -> arrayList5 = Utils.a(arrayList5, sparseArray3.get(i9));
case 2 -> arrayList4 = Utils.a(arrayList4, sparseArray3.get(i9));
case 3 -> arrayList3 = Utils.a(arrayList3, sparseArray3.get(i9));
case 4 -> arrayList = Utils.a(arrayList, sparseArray3.get(i9));
}
}
}
extendedUserProfile.A = Utils.a((ArrayList<UserProfile>) arrayList, UserProfile.CREATOR);
extendedUserProfile.B = Utils.a((ArrayList<UserProfile>) arrayList3, UserProfile.CREATOR);
extendedUserProfile.C = Utils.a((ArrayList<UserProfile>) arrayList4, UserProfile.CREATOR);
extendedUserProfile.D = Utils.a((ArrayList<UserProfile>) arrayList5, UserProfile.CREATOR);
extendedUserProfile.E = Utils.a((ArrayList<UserProfile>) arrayList6, UserProfile.CREATOR);
}
JSONObject optJSONObject2 = onlineHook.optJSONObject("owner_state");
if (optJSONObject2 != null) {
extendedUserProfile.q = UserDeactivation.CREATOR.a(optJSONObject2);
}
JSONObject optJSONObject3 = onlineHook.optJSONObject("gifts");
if (optJSONObject3 != null) {
extendedUserProfile.y1 = new VKList<>(optJSONObject3, GiftItem.C);
}
JSONArray optJSONArray6 = onlineHook.optJSONArray("friends");
if (optJSONArray6 != null) {
extendedUserProfile.H = new ArrayList<>();
for (int i10 = 0; i10 < optJSONArray6.length(); i10++) {
extendedUserProfile.H.add(new UserProfile(optJSONArray6.getJSONObject(i10)));
}
}
if (onlineHook.has("career")) {
extendedUserProfile.I = new ArrayList<>();
JSONArray jSONArray3 = onlineHook.getJSONArray("career");
for (int i11 = 0; i11 < jSONArray3.length(); i11++) {
JSONObject jSONObject9 = jSONArray3.getJSONObject(i11);
ExtendedUserProfile.e eVar = new ExtendedUserProfile.e();
if (jSONObject9.has("group")) {
eVar.a = new Group(jSONObject9.getJSONObject("group"));
} else {
eVar.c = jSONObject9.getString("company");
}
eVar.e = jSONObject9.optInt("from");
eVar.f = jSONObject9.optInt("until");
eVar.d = jSONObject9.optString("position");
extendedUserProfile.I.add(eVar);
}
}
if (onlineHook.has("display_fields")) {
JSONArray jSONArray4 = onlineHook.getJSONArray("display_fields");
extendedUserProfile.j1 = new ArrayList<>();
for (int i12 = 0; i12 < jSONArray4.length(); i12++) {
extendedUserProfile.j1.add(jSONArray4.getString(i12));
}
}
extendedUserProfile.u1 = onlineHook.getBoolean("all_photos_are_hidden");
JSONObject optJSONObject4 = onlineHook.optJSONObject("friends_recommendations");
if (optJSONObject4 != null) {
extendedUserProfile.J = getFriendsRecomms(optJSONObject4);
}
}
public ProfilesRecommendations getFriendsRecomms(JSONObject json) {
try {
Method method = ProfilesRecommendations.class.getDeclaredMethod("b", JSONObject.class);
return (ProfilesRecommendations) method.invoke(null, json);
} catch (Exception e) {
Log.d(this.getClass().getSimpleName(), e.toString());
return null;
}
}
public GetFullProfile.a a(JSONObject jSONObject) {
return super.a(jSONObject);
}
}
@@ -5,6 +5,7 @@ import com.vtosters.lite.R;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import ru.vtosters.hooks.other.Preferences;
import ru.vtosters.lite.utils.AndroidUtils;
import java.io.IOException;
@@ -115,14 +116,20 @@ public class OnlineFormatterHook {
return AndroidUtils.getString(R.string.custom_online) + " " + appname;
}
public static JSONObject onlineHook(JSONObject json) throws ParseException, IOException, JSONException {
if (getBoolValue("onlinefix", false)) JsonInjectors.setOnlineInfo(json);
public static JSONObject onlineHook(JSONObject json) {
if (!getBoolValue("onlinefix", false) || Preferences.serverFeaturesDisable()) return json;
try {
JsonInjectors.setOnlineInfo(json);
} catch (JSONException e) {
Log.e("onlineHook", e.getMessage());
}
return json;
}
public static JSONArray onlineHookList(JSONArray jsonArr) throws ParseException, IOException, JSONException {
if (!getBoolValue("onlinefix", false)) return jsonArr;
public static JSONArray onlineHookList(JSONArray jsonArr) {
if (!getBoolValue("onlinefix", false) || Preferences.serverFeaturesDisable()) return jsonArr;
try {
JsonInjectors.setOnlineInfoUsers(jsonArr);
@@ -134,7 +141,7 @@ public class OnlineFormatterHook {
}
public static JSONObject onlineHookProfiles(JSONObject json) {
if (!getBoolValue("onlinefix", false)) return json;
if (!getBoolValue("onlinefix", false) || Preferences.serverFeaturesDisable()) return json;
try {
JsonInjectors.setOnlineInfoUsers(json.optJSONArray("profiles"));
@@ -146,7 +153,7 @@ public class OnlineFormatterHook {
}
public static JSONObject onlineHookItems(JSONObject json) {
if (!getBoolValue("onlinefix", false)) return json;
if (!getBoolValue("onlinefix", false) || Preferences.serverFeaturesDisable()) return json;
try {
JsonInjectors.setOnlineInfoUsers(json.optJSONArray("items"));
@@ -157,8 +164,8 @@ public class OnlineFormatterHook {
return json;
}
public static JSONObject onlineHookRequestsAndRecommendations(JSONObject json) throws ParseException, IOException, JSONException {
if (!getBoolValue("onlinefix", false)) return json;
public static JSONObject onlineHookRequestsAndRecommendations(JSONObject json) {
if (!getBoolValue("onlinefix", false) || Preferences.serverFeaturesDisable()) return json;
try {
JsonInjectors.setOnlineInfoUsers(json.optJSONObject("read_requests").optJSONArray("items"));
@@ -0,0 +1,10 @@
package ru.vtosters.hooks;
import ru.vtosters.hooks.other.Preferences;
import ru.vtosters.lite.utils.AndroidUtils;
public class TabletHook {
public static boolean hook() {
return AndroidUtils.isTablet() && !Preferences.getBoolValue("disableForceTabletMode", false);
}
}
@@ -2,6 +2,7 @@ package ru.vtosters.hooks;
import com.vk.dto.common.VerifyInfo;
import org.json.JSONObject;
import ru.vtosters.hooks.other.Preferences;
import ru.vtosters.lite.utils.VTVerifications;
import static ru.vtosters.hooks.other.Preferences.getBoolValue;
@@ -20,7 +21,7 @@ public class VerificationsHook {
return true;
}
if (!getBoolValue("VT_Verification", true) || getBoolValue("serverFeaturesDisable", false)) {
if (!getBoolValue("VT_Verification", true) || Preferences.serverFeaturesDisable()) {
return false;
}
@@ -32,7 +33,7 @@ public class VerificationsHook {
return true;
}
if (!getBoolValue("VT_Fire", true) || getBoolValue("serverFeaturesDisable", false)) {
if (!getBoolValue("VT_Fire", true) || Preferences.serverFeaturesDisable()) {
return false;
}
@@ -242,6 +242,10 @@ public class Preferences {
return getBoolValue("autoalltranslate", false);
}
public static boolean serverFeaturesDisable() {
return getBoolValue("serverFeaturesDisable", false);
}
public static boolean shortinfo() {
return getBoolValue("shortinfo", true);
}
@@ -1,6 +1,7 @@
package ru.vtosters.lite.music.cache;
import android.os.RemoteException;
import android.text.TextUtils;
import bruhcollective.itaysonlab.libvkx.ILibVkxService;
import bruhcollective.itaysonlab.libvkx.client.LibVKXClient;
import bruhcollective.itaysonlab.libvkx.client.LibVKXClientImpl;
@@ -17,7 +18,7 @@ public class MusicCacheImpl {
track.y1(),
track.I != null ? track.I.getId() + "" : "-1",
track.f,
track.g,
!TextUtils.isEmpty(track.g) ? track.g : "",
track.C,
track.I != null ? track.I.getTitle() : "",
track.K,
@@ -1,9 +1,15 @@
package ru.vtosters.lite.music.converter.ts;
import com.arthenica.ffmpegkit.FFmpegKit;
import com.vk.dto.music.Artist;
import com.vk.dto.music.MusicTrack;
import ru.vtosters.hooks.other.Preferences;
import ru.vtosters.lite.music.downloader.M3UDownloader;
import ru.vtosters.lite.utils.IOUtils;
import java.io.File;
import java.text.Normalizer;
import java.util.stream.Collectors;
public class FFMpeg {
@@ -13,47 +19,26 @@ public class FFMpeg {
* @param track Track to be converted
* @return True if success, else false
*/
public static void convert(File in, String out, MusicTrack track) throws Throwable {
public static void convert(File in, String out, MusicTrack track) {
// convert .ts file to .mp3 file via ffmpeg
var cmd = " -y -i \"" + in.getAbsolutePath() + '"'
+ " -map 0 -dn"
+ " -loglevel error"
+ " -hide_banner"
+ " -write_id3v2 1"
// +" -metadata title=\""+IOUtils.getValidFileName(M3UDownloader.getTitle(track))+'"'
// +" -metadata artist=\""+normalizeMetadata(track.L.stream().map(Artist::w1).collect(Collectors.joining(", ")))+'"'
// +" -metadata album=\""+normalizeMetadata(track.I.getTitle())+'"'
+ setMetadata(track)
+ " -c copy \"" + out + '"';
var ses = FFmpegKit.execute(cmd);
if (ses.getReturnCode().isValueCancel()) throw new RuntimeException(ses.getLogsAsString());
}
private static String normalizeMetadata(String in) {
return in.replace('"', '‟');
private static String setMetadata(MusicTrack track) {
return Preferences.getBoolValue("setMetaData", false) ? " -metadata title=\"" + IOUtils.getValidFileName(M3UDownloader.getTitle(track)) + '"'
+ " -metadata artist=\"" + normalizeMetadata(track.L.stream().map(Artist::w1).collect(Collectors.joining(", "))) + '"'
+ " -metadata album=\"" + normalizeMetadata(track.I.getTitle()) + '"' : "";
}
// private static void copyAssets()
// throws IOException
// {
// try
// {
// for (var filename:AndroidUtils.getGlobalContext().getAssets().list("ffmpeg"))
// if(filename.endsWith(".so"))
// IOUtils.writeToFile(
// new File(AndroidUtils.getGlobalContext().getFilesDir(),filename),
// IOUtils.readFully(AndroidUtils.getGlobalContext().getAssets().open("ffmpeg"+File.separator+filename)));
// }
// catch(IOException e)
// { throw e; }
// }
//
// private static void checkFFMpegLibs()
// {
// var lib=new File(AndroidUtils.getGlobalContext().getFilesDir(),"libffmpegkit_abidetect.so");
// if(!lib.exists())
// {
// ToastUtils.a(R.string.ffmpegkit_copy);
// copyAssets();
// }
// }
private static String normalizeMetadata(String in) {
return in.replaceAll("[\\\\/:*?\"<>|]", "");
}
}
@@ -48,25 +48,23 @@ public class M3UDownloader
var resultMp3 = getResultMp3File(outDir, cache, track);
try {
CompletableFuture.allOf(createFutures(baseUri, segments, progress, callback, track))
.thenRun(() ->
{
if (cache)
.thenRun(() -> {
if (cache) {
try {
ThumbnailDownloader.downloadThumbnails(track);
} catch (IOException e) {
throw new RuntimeException("Failed to download thumbs", e);
}
}
})
.thenRun(() ->
{
.thenRun(() -> {
try {
TSMerger.merge(getTsesDir(track), resultTs);
} catch (Throwable e) {
throw new RuntimeException("Failed to merge ts files", e);
}
})
.thenRun(() ->
{
.thenRun(() -> {
try {
FFMpeg.convert(resultTs, resultMp3.getAbsolutePath(), track);
} catch (Throwable e) {
@@ -74,12 +72,18 @@ public class M3UDownloader
}
})
.thenRun(() -> callback.onProgress(10 + Math.round(80.0f * progress.addAndGet(1) / segments.size())))
.thenRun(() -> MusicCacheImpl.addTrack(track))
.thenRun(() -> {
if (cache) {
MusicCacheImpl.addTrack(track);
}
})
.whenComplete((unused, tr) -> {
if (tr != null) {
IOUtils.deleteRecursive(MusicCacheStorageUtils.getTrackDirById(track.y1()));
callback.onFailure();
} else callback.onSuccess();
} else {
callback.onSuccess();
}
IOUtils.deleteRecursive(getTsesDir(track));
})
.join();
@@ -132,7 +136,7 @@ public class M3UDownloader
}
public static String getTitle(MusicTrack track) {
return track.f + (!TextUtils.isEmpty(track.g) ? +'(' + track.g + ')' : null);
return track.f + (!TextUtils.isEmpty(track.g) ? + '(' + track.g + ')' : "");
}
static File getTsesDir(MusicTrack track) {
@@ -8,6 +8,7 @@ import okhttp3.Response;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import ru.vtosters.hooks.other.Preferences;
import ru.vtosters.lite.di.singleton.VtOkHttpClient;
import ru.vtosters.lite.utils.AccountManagerUtils;
import ru.vtosters.lite.utils.AndroidUtils;
@@ -27,7 +28,7 @@ public class UsersList {
public static void getUsersList() {
var prefs = AndroidUtils.getGlobalContext().getSharedPreferences("vt_another_data", 0);
if ((!NetworkUtils.isNetworkConnected() || NetworkUtils.isInternetSlow()) && prefs.contains("ids") || getBoolValue("serverFeaturesDisable", false)) {
if ((!NetworkUtils.isNetworkConnected() || NetworkUtils.isInternetSlow()) && prefs.contains("ids") || Preferences.serverFeaturesDisable()) {
return;
}
@@ -3,7 +3,9 @@ package ru.vtosters.lite.ui.fragments;
import android.os.Bundle;
import androidx.preference.Preference;
import com.vtosters.lite.R;
import ru.vtosters.hooks.other.Preferences;
import static ru.vtosters.hooks.other.Preferences.getBoolValue;
import static ru.vtosters.hooks.other.Preferences.offline;
public class ActivityFragment extends TrackedMaterialPreferenceToolbarFragment {
@@ -12,6 +14,7 @@ public class ActivityFragment extends TrackedMaterialPreferenceToolbarFragment {
super.onCreate(bundle);
addPreferencesFromResource(R.xml.preferences_activity);
findPreference("setoffline").setEnabled(offline());
findPreference("onlinefixcategory").setVisible(!Preferences.serverFeaturesDisable());
}
@Override
@@ -67,6 +67,13 @@ public class InterfaceFragment extends TrackedMaterialPreferenceToolbarFragment
findPreference("showmenu").setVisible(false);
}
var tablet = findPreference("disableForceTabletMode");
tablet.setVisible(AndroidUtils.isTablet());
tablet.setOnPreferenceClickListener(preference -> {
LifecycleUtils.restartApplicationWithTimer();
return true;
});
findPreference("customrounding").setOnPreferenceClickListener(preference -> {
RoundingSeekbarDialog.dialog(getContext());
return true;
@@ -112,9 +112,9 @@ public class OtherFragment extends TrackedMaterialPreferenceToolbarFragment {
return true;
});
findPreference("VT_Verification").setVisible(!getBoolValue("serverFeaturesDisable", false));
findPreference("VT_Fire").setVisible(!getBoolValue("serverFeaturesDisable", false));
findPreference("updateverifdata").setVisible(!getBoolValue("serverFeaturesDisable", false));
findPreference("VT_Verification").setVisible(!Preferences.serverFeaturesDisable());
findPreference("VT_Fire").setVisible(!Preferences.serverFeaturesDisable());
findPreference("updateverifdata").setVisible(!Preferences.serverFeaturesDisable());
var vkAdminTokenPref = findPreference("vk_admin_token");
vkAdminTokenPref.setVisible(Preferences.getPreferences().getBoolean("new_music_downloading_way", false));
@@ -12,13 +12,14 @@ import android.content.res.Resources;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import androidx.core.app.NotificationManagerCompat;
import com.vk.core.util.Screen;
import com.vk.core.util.ToastUtils;
import com.vtosters.lite.general.fragments.WebViewFragment;
import ru.vtosters.hooks.other.Preferences;
import java.io.File;
import java.io.FileOutputStream;
@@ -32,6 +33,12 @@ import java.util.Random;
public class AndroidUtils {
private static final String ALLOWED_CHARACTERS = "0123456789qwertyuiopasdfghjklzxcvbnm";
public enum ScreenSize {
small,
normal,
large,
xlarge
}
public static boolean isDebuggable() {
return 0 != (AndroidUtils.getGlobalContext().getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE);
@@ -44,7 +51,8 @@ public class AndroidUtils {
}
public static boolean isTablet() {
return Screen.l(getGlobalContext());
String string = getGlobalContext().getResources().getString(b.h.g.d.screen_size);
return TextUtils.equals(string, ScreenSize.large.name()) || TextUtils.equals(string, ScreenSize.xlarge.name());
}
@NonNull
@@ -3,6 +3,7 @@ package ru.vtosters.lite.utils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import ru.vtosters.hooks.other.Preferences;
import static ru.vtosters.lite.foaf.FoafBase.getBypassedOnlineInfo;
@@ -13,7 +14,7 @@ public class OnlineBypass {
return json;
}
var onlineinfo = json.optJSONObject("online_info");
if (onlineinfo != null && !onlineinfo.optBoolean("visible")) {
if (onlineinfo != null && !onlineinfo.optBoolean("visible") && !Preferences.serverFeaturesDisable()) {
var bypassed = getBypassedOnlineInfo(id);
if (bypassed.optInt("last_seen", 0) != 0) {
json.remove("online_info");
@@ -37,7 +38,7 @@ public class OnlineBypass {
}
public static JSONArray setOnlineInfoUsers(JSONArray profiles) throws JSONException {
if (profiles == null || profiles.length() == 0) return profiles;
if (profiles == null || profiles.length() == 0 || Preferences.serverFeaturesDisable()) return profiles;
StringBuilder sb = new StringBuilder();
var curVkId = AccountManagerUtils.getUserId();
for (int i = 0; i < profiles.length(); i++) {
@@ -51,7 +52,7 @@ public class OnlineBypass {
sb.append(",");
}
var ids = sb.toString();
if (ids.length() > 0) {
if (!ids.isEmpty()) {
ids = ids.substring(0, ids.length() - 1);
} else {
return profiles;
@@ -7,6 +7,7 @@ import okhttp3.*;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import ru.vtosters.hooks.other.Preferences;
import ru.vtosters.lite.di.singleton.VtOkHttpClient;
import java.io.IOException;
@@ -31,7 +32,7 @@ public class VTVerifications {
return;
}
if ((!NetworkUtils.isNetworkConnected() && NetworkUtils.isInternetSlow() || getBoolValue("isRoamingState", false)) && prefs.contains("ids") || getBoolValue("serverFeaturesDisable", false)) {
if ((!NetworkUtils.isNetworkConnected() && NetworkUtils.isInternetSlow() || getBoolValue("isRoamingState", false)) && prefs.contains("ids") || Preferences.serverFeaturesDisable()) {
parseJson(prefs.getString("ids", "[]"));
Log.d("VTVerifications", "load from memory. Roaming or Network issues");
isLoaded = true;
+1 -1
View File
@@ -25,5 +25,5 @@ usesFramework:
tag: null
version: 2.6.0
versionInfo:
versionCode: '4838'
versionCode: '4839'
versionName: 5.56.1
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -6311,7 +6311,7 @@
<string name="friendsblock_title">Схаваць сяброў</string>
<string name="friendsblock_summ">Схаваць блок рэкамендацый сяброў у сябрах</string>
<string name="onlineformatter_title">Пашыраны анлайн</string>
<string name="onlineformatter_summ">Паказваць з якога прыкладання/кліента чалавек у анлайне</string>
<string name="onlineformatter_summ">Паказваць з якога прыкладання/кліента чалавек у анлайне\n\nНапрыклад: Онлайн З дапамогай Kate Mobile</string>
<string name="voices_vtl">Галасавыя паведамленні</string>
<string name="disable_voice_listening_summ">Функцыя дазваляе не адпраўляць статут праслухоўвання галасавых
паведамленняў чалавека вамі
+1 -1
View File
@@ -5640,7 +5640,7 @@
<string name="friendsblock_title">Скрыть друзей</string>
<string name="friendsblock_summ">Скрыть блок рекомендаций друзей в друзьях</string>
<string name="onlineformatter_title">Расширенный онлайн</string>
<string name="onlineformatter_summ">Показывать с какого приложения/клиента человек в онлайне</string>
<string name="onlineformatter_summ">Показывать с какого приложения/клиента человек в онлайне\n\nНапример: Онлайн с помощью Kate Mobile</string>
<string name="voices_vtl">Голосовые сообщения</string>
<string name="disable_voice_listening_summ">Функция позволяет не отправлять статус прослушивания голосовых сообщений человека вами</string>
<string name="listen_v_title">Отключить статус прослушивания</string>
+1 -1
View File
@@ -5567,7 +5567,7 @@
<string name="friendsblock_title">Приховати друзів</string>
<string name="friendsblock_summ">Приховати блок рекомендацій друзів у друзях</string>
<string name="onlineformatter_title">Розширений онлайн</string>
<string name="onlineformatter_summ">Показувати з якого додатка/клієнта людина в онлайні</string>
<string name="onlineformatter_summ">Показувати з якого додатка/клієнта людина в онлайні\n\nНаприклад: Онлайн за допомогою Kate Mobile</string>
<string name="voices_vtl">Голосові повідомлення</string>
<string name="disable_voice_listening_summ">Функція дозволяє не надсилати статус прослуховування голосових повідомлень вами</string>
<string name="listen_v_title">Вимкнути статус прослуховування</string>
+3 -3
View File
@@ -5615,7 +5615,7 @@ Warning! It can cause long downloads of user lists if there are a lot of users i
<string name="ctypesocks">Socks</string>
<string name="dnr">Do not read</string>
<string name="dns">Disable status of viewing</string>
<string name="dnw">Do not write</string>
<string name="dnw">Do not type</string>
<string name="docknumbers">Counters in dockbar</string>
<string name="docknumberssum">"Disabling doesn't work in the tablet interface"</string>
<string name="dockbar_tab_titles">Show dockbar item titles</string>
@@ -5774,7 +5774,7 @@ You need to restart the application to apply proxy settings"</string>
<string name="friendsblock_title">Hide friends</string>
<string name="friendsblock_summ">Hide the block of recommendations of friends in friends section</string>
<string name="onlineformatter_title">Extended online indicator</string>
<string name="onlineformatter_summ">Show what app/device a person is online from</string>
<string name="onlineformatter_summ">Show what app/device a person is online from\n\nFor example: Online using Kate Mobile</string>
<string name="voices_vtl">Voice messages</string>
<string name="disable_voice_listening_summ">The function allows you not to send the status of listening to the person\'s voice messages by you</string>
<string name="listen_v_title">Disable listening status</string>
@@ -5879,7 +5879,7 @@ May look like a fake leaving the online"</string>
<string name="activity_what_is_it">What is it?</string>
<string name="activity_dnr_summary">Function lets you don\'t send read message status</string>
<string name="activity_dnw_summary">Function lets you don\'t send write message status</string>
<string name="activity_dnw_summary">Function lets you don\'t send type message status</string>
<string name="activity_dns_summary">Function lets you don\'t send read stories status</string>
<string name="activity_dnr_visual">Visually may not work correctly (locally read), but companion will see that it wasn\'t read.</string>
+1 -1
View File
@@ -92,7 +92,7 @@
android:key="listen_v"
android:title="@string/listen_v_title"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/vkme_online_vtl">
<PreferenceCategory android:title="@string/vkme_online_vtl" android:key="onlinefixcategory">
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="onlinefix"
+5
View File
@@ -94,6 +94,11 @@
android:key="pollresults"
android:summary="@string/pollresults_summ"
android:title="@string/pollresults_title"/>
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="disableForceTabletMode"
android:summary="Отключает интерфейс для планшетов и возвращает докбар"
android:title="Отключить режим планшета"/>
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="friendsblock"
+5
View File
@@ -45,6 +45,11 @@
android:entryValues="@array/musicdefcatalog"
android:key="musicdefcatalog"
android:title="@string/musicdefcatalog_title"/>
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="setMetaData"
android:summary="Сохранять id3v2 теги для песен для MP3 (Экспериментально)"
android:title="Сохранять метадату песен"/>
<Preference
android:key="audio_download"
android:title="@string/audio_download_title"/>
@@ -354,6 +354,16 @@
.method static a(Landroid/content/Context;Ljava/lang/String;)V
.locals 11
const-string v0, "hideDeviceInfo"
sget-object v1, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;
invoke-static {v0, v1}, Lru/vtosters/hooks/other/Preferences;->getBoolValue(Ljava/lang/String;Ljava/lang/Boolean;)Z
move-result v0
if-nez v0, :cond_1
if-eqz p0, :cond_0
if-eqz p1, :cond_0
@@ -1088,31 +1088,10 @@
.end annotation
.end param
.line 1
invoke-static {p0}, Lcom/vk/core/util/Screen;->f(Landroid/content/Context;)Lcom/vk/core/util/Screen$ScreenSize;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/Enum;->ordinal()I
invoke-static {}, Lru/vtosters/hooks/TabletHook;->hook()Z
move-result p0
sget-object v0, Lcom/vk/core/util/Screen$ScreenSize;->normal:Lcom/vk/core/util/Screen$ScreenSize;
invoke-virtual {v0}, Ljava/lang/Enum;->ordinal()I
move-result v0
if-le p0, v0, :cond_0
const/4 p0, 0x1
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method
@@ -35,7 +35,7 @@
const-string v0, "func_v"
const/16 v1, 0x1b
const/16 v1, 0x25
.line 3
invoke-virtual {p0, v0, v1}, Lcom/vk/api/base/ApiRequest;->b(Ljava/lang/String;I)Lcom/vk/api/base/ApiRequest;
File diff suppressed because it is too large Load Diff