Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ We will be happy to accept your bugreports [in our bug-tracker](https://github.c
* **via [Releases page](https://github.com/openvk/mobile-android-legacy/releases/latest)**
* **via [NashStore](https://store.nashstore.ru/store/637cc36cfb3ed38835524503)** _(for Russian phones kinda 😂)_
* **via [Trashbox](https://trashbox.ru/topics/164477/openvk-legacy)**
* **via [4PDA](https://4pda.to/forum/index.php?showtopic=1057695)**

## Building
We recommend using [Android Studio 3.1.2](https://developer.android.com/studio/archive) and Java 7 for perfect support of libraries developed for Android 2.1 Eclair and above.
Expand Down
5 changes: 3 additions & 2 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ _Работает на OpenVK API._
* **через F-Droid**
* [f-droid.org](https://f-droid.org/packages/uk.openvk.android.legacy/)
* [izzysoft.de](https://apt.izzysoft.de/fdroid/index/apk/uk.openvk.android.legacy)
* [tinelix.ru](https://fdroid.tinelix.ru)
* [tinelix.ru](https://repo.tinelix.ru)
* **через [Telegram-канал](https://t.me/+nPLHBZqAsFlhYmIy)**
* **через [страницу релизов](https://github.com/openvk/mobile-android-legacy/releases/latest)**
* **через [NashStore](https://store.nashstore.ru/store/637cc36cfb3ed38835524503)** _(как бы для российских телефонов 😂)_
* **через [NashStore](https://store.nashstore.ru/store/637cc36cfb3ed38835524503)** _(а почему бы и нет?)_
* **через [Trashbox](https://trashbox.ru/topics/164477/openvk-legacy)**
* **через [4PDA](https://4pda.to/forum/index.php?showtopic=1057695)**

## Сборка
Мы советуем использовать [Android Studio 3.1.2](https://developer.android.com/studio/archive) вместе с Java 7 для идеальной поддержки библиотек, разработанные для Android 2.1 Eclair и выше.
Expand Down
129 changes: 63 additions & 66 deletions app/app.iml

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ android {
minSdkVersion 7
//noinspection GradleDependency,OldTargetApi
targetSdkVersion 29
versionCode 240
versionName "1.2.240-u"
versionCode 242
versionName "1.2.242-u"
}
buildTypes {
release {
Expand All @@ -99,16 +99,16 @@ android {
minSdkVersion 7
//noinspection OldTargetApi
targetSdkVersion 29
versionCode 240
versionName "1.2.240-d"
versionCode 242
versionName "1.2.242-d"
signingConfig signingConfigs.debug
}
releaseConfig {
minSdkVersion 7
applicationId 'uk.openvk.android.legacy'
targetSdkVersion 29
versionCode 240
versionName '1.2.240'
versionCode 242
versionName '1.2.242'
if (file('.signing/app-release.prop').exists()) {
signingConfig signingConfigs.release
}
Expand All @@ -119,8 +119,8 @@ android {
minSdkVersion 7
//noinspection OldTargetApi
targetSdkVersion 29
versionCode 240
versionName "1.2.240-f"
versionCode 242
versionName "1.2.242-f"
if (file('.signing/app-fdroid.prop').exists()) {
signingConfig signingConfigs.fdroid
}
Expand All @@ -142,8 +142,8 @@ dependencies {
compile 'com.android.support:support-v4:24.0.0'
//noinspection GradleDependency,GradleCompatible
compile 'com.android.support:appcompat-v7:24.0.0'
//noinspection GradleDependency
compile 'com.takisoft.fix:preference-v7:24.0.0.1'
//noinspection GradleCompatible,GradleDependency
compile 'com.android.support:preference-v7:24.0.0'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile project(':modules:actionbar')
compile project(':modules:popupmenu')
Expand Down
12 changes: 2 additions & 10 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
android:theme="@style/BaseStyleNoTitle"
android:largeHeap="true"
tools:ignore="UnusedAttribute"
android:usesCleartextTraffic="true">
android:usesCleartextTraffic="true"
android:installLocation="auto">

<activity android:name=".core.activities.MainActivity"
android:label="@string/app_name"
Expand Down Expand Up @@ -306,15 +307,6 @@
android:resizeableActivity="false"
/>

<activity
android:name=".core.activities.settings.ExperimentalFeaturesActivity"
android:label="@string/experimental_features"
android:theme="@style/BaseStyle"
android:exported="true"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|mcc|mnc|uiMode"
android:resizeableActivity="false"
/>

<activity android:name=".core.activities.QuickSearchActivity"
android:label="@string/search_global"
android:theme="@style/BaseStyle.NoActionBar.NoShadow"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,44 @@ protected void attachBaseContext(Context newBase) {

private void setView() {
ImageView logo = findViewById(R.id.logo);

/* OpenVK Easter Egg Types in "About Application" activity
*
* 0 - not a easter egg
* 2 - adrod 13 installer, ovksome people or freakbarinov
*/

final int[] easterEggType = {0};

logo.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
if(logo_longclicks == 2) {
Intent intent = new Intent(getApplicationContext(), DebugMenuActivity.class);
startActivity(intent);
switch (easterEggType[0]) {
default:
Intent intent = new Intent(getApplicationContext(), DebugMenuActivity.class);
startActivity(intent);
break;
case 2:
findViewById(R.id.easter_egg_page).setVisibility(View.VISIBLE);
findViewById(R.id.about_app_page).setVisibility(View.GONE);
if(Build.VERSION.SDK_INT == 33) {
findViewById(R.id.about_app_page).setVisibility(View.GONE);
} else if(Build.VERSION.SDK_INT < 11) {
((ImageView) findViewById(R.id.easter_egg_imageview))
.setImageDrawable(
getResources().getDrawable(R.drawable.ee_freakbarinov)
);
} else {
((ImageView) findViewById(R.id.easter_egg_imageview))
.setImageDrawable(
getResources().getDrawable(R.drawable.ee_ovksome_people)
);
}
break;
}
logo_longclicks = 0;
easterEggType[0]++;
} else {
logo_longclicks++;
}
Expand All @@ -141,7 +172,6 @@ public boolean onLongClick(View v) {
TextView app_links = findViewById(R.id.app_links_text);
TextView app_license_label = findViewById(R.id.app_license_text);
TextView app_disclaimer_label = findViewById(R.id.app_disclaimer_text);
OvkApplication app = ((OvkApplication) getApplicationContext());

app_title.setText(getResources().getString(R.string.full_app_name));
app_version_label.setText(getResources().getString(R.string.app_version_text,
Expand Down Expand Up @@ -243,8 +273,13 @@ public void onClick(DialogInterface dialog, int which) {

@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == android.R.id.home) {
onBackPressed();
if(findViewById(R.id.easter_egg_page).getVisibility() == View.GONE) {
if (item.getItemId() == android.R.id.home) {
onBackPressed();
}
} else {
findViewById(R.id.easter_egg_page).setVisibility(View.GONE);
findViewById(R.id.about_app_page).setVisibility(View.VISIBLE);
}
return super.onOptionsItemSelected(item);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import android.widget.TextView;
import android.widget.Toast;

import org.json.JSONException;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
Expand Down Expand Up @@ -74,7 +76,7 @@ public class AuthActivity extends NetworkAuthActivity {
private Account account;
private JSONParser jsonParser = new JSONParser();
private int twofactor_fail = -1;
private Authorization auth;
public Authorization auth;
private ArrayList<InstancesListItem> instances_list;

@Override
Expand Down Expand Up @@ -413,13 +415,30 @@ public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
twofactor_dlg.setCancelable(false);
if (!AuthActivity.this.isFinishing()) twofactor_dlg.show();
} else if (message == HandlerMessages.AUTHORIZED) {
auth = new Authorization(response);
if(connectionDialog.isShowing()) {
connectionDialog.setProgressText(getResources().getString(R.string.creating_account));
try {
auth = new Authorization(data.getString("response"));
if(auth.getErrorMessage() != null) {
Log.d(OvkApplication.APP_TAG, "Getting auth error...");
if (auth.getErrorMessage().equals("need_validation")) {
receiveState(HandlerMessages.TWOFACTOR_CODE_REQUIRED, data);
} else {
receiveState(HandlerMessages.INTERNAL_ERROR, data);
}
return;
}
if (connectionDialog.isShowing()) {
connectionDialog.setProgressText(getResources().getString(R.string.creating_account));
}
account = new Account(this);
ovk_api.wrapper.setAccessToken(auth.getAccessToken());
account.getProfileInfo(ovk_api.wrapper);
} catch (Exception e) {
e.printStackTrace();
alertDialog.build(new AlertDialog.Builder(this).setNeutralButton(R.string.ok, null),
getResources().getString(R.string.auth_error_title),
getResources().getString(R.string.auth_error, getReason(message)), null);
alertDialog.show();
}
account = new Account(this);
ovk_api.wrapper.setAccessToken(auth.getAccessToken());
account.getProfileInfo(ovk_api.wrapper);
} else if(message == HandlerMessages.ACCOUNT_PROFILE_INFO) {
String server = ((EditTextAction) findViewById(R.id.instance_name)).getText();
String username = ((EditText) findViewById(R.id.auth_login)).getText().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ private void createAttachmentsAdapter() {
private void setUiListeners() {
findViewById(R.id.newpost_btn_photo).setOnClickListener(
new View.OnClickListener() {
@SuppressLint("IntentReset")
@Override
public void onClick(View v) {
Intent intent =
Expand Down
Loading
Loading