Skip to content

Commit

Permalink
Merge pull request #2 from suryaviyyapu/Beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
suryaviyyapu authored Feb 16, 2021
2 parents b97ae12 + 1341cdd commit 58bc62a
Show file tree
Hide file tree
Showing 44 changed files with 355 additions and 647 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/
release/

# Gradle files
.gradle/
Expand Down
29 changes: 15 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android {
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "0.1.2"
versionName "0.1.4"
resConfigs 'en'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -35,9 +35,9 @@ android {
}

dependencies {
implementation 'androidx.security:security-crypto:1.1.0-alpha02'
def room_version = "2.2.5"
def lifecycle_version = "2.2.0"
implementation 'androidx.security:security-crypto:1.1.0-alpha03'
def room_version = "2.2.6"
def lifecycle_version = "2.3.0"
def arch_version = "2.1.0"

//Room
Expand All @@ -47,7 +47,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

implementation 'commons-codec:commons-codec:20041127.091804'
Expand All @@ -59,7 +59,8 @@ dependencies {
//Updater
implementation 'com.github.javiersantos:AppUpdater:2.7'


//ROOM Backup
implementation 'com.github.salehyarahmadi:RoomDatabaseBackupAndRestore:v1.0.1'

//Pin Lock
implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'
Expand All @@ -68,15 +69,15 @@ dependencies {
implementation 'de.hdodenhof:circleimageview:3.1.0'


implementation 'com.google.android.material:material:1.2.0'
implementation 'androidx.navigation:navigation-fragment:2.3.0'
implementation 'androidx.navigation:navigation-ui:2.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.navigation:navigation-fragment:2.3.3'
implementation 'androidx.navigation:navigation-ui:2.3.3'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'

testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
// LiveData
Expand All @@ -91,10 +92,10 @@ dependencies {
implementation 'androidx.cardview:cardview:1.0.0'

//BIO
implementation 'androidx.biometric:biometric:1.0.1'
implementation 'androidx.biometric:biometric:1.1.0'

implementation 'androidx.core:core-ktx:1.5.0-alpha01'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"
implementation 'androidx.core:core-ktx:1.5.0-beta01'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

}
Expand Down
20 changes: 0 additions & 20 deletions app/release/output.json

This file was deleted.

19 changes: 6 additions & 13 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
android:name="android.hardware.fingerprint"
android:required="false" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />

<application
Expand All @@ -17,27 +18,19 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".SplashActivity"
android:name=".Splash"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ChangePassActivity" />
<activity android:name=".AboutActivity" />
<activity android:name=".ViewCreds" />
<activity android:name=".ChangePassword" />
<activity
android:name=".About"
android:label="Changelog" />
<activity android:name=".Authorize" />
<!-- <activity-->
<!-- android:name=".Add"-->
<!-- android:label="Add new data"-->
<!-- android:parentActivityName=".Home"-->
<!-- android:theme="@android:style/Theme.DeviceDefault.Light.Dialog" />-->
<!-- <activity-->
<!-- android:name=".Modify"-->
<!-- android:label="Modify password"-->
<!-- android:theme="@android:style/Theme.DeviceDefault.Light.Dialog" />-->
<activity
android:name=".Add"
android:label="Add data" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

public class AboutActivity extends AppCompatActivity {
public class About extends AppCompatActivity {
TextView ver;

String version;
String[] whatsnew = {
"Improved UI",
"Dark mode",
"Fingerprint Auth",
"Secure core mode v1.SCM",
"Random Password Generator v1.RPG",
"Add passwords from RPG using copy",
"Backup and restore credentials to storage",
"Minor UI changes",
"Minor Bug fixes and Improvements",
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.io.IOException;
import java.security.GeneralSecurityException;

public class ChangePassActivity extends AppCompatActivity {
public class ChangePassword extends AppCompatActivity {
public static final String EXTRA_TYPE_PASS = "com.cyberviy.ViyP.EXTRA_TYPE_PASS";
final String PREFS_NAME = "appEssentials";
String TYPE_PASS_1 = "PIN";
Expand Down
11 changes: 10 additions & 1 deletion app/src/main/java/com/cyberviy/ViyP/Help.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
Expand Down Expand Up @@ -45,7 +46,7 @@ public void githubLink(View view) {
}

public void whats_new(View view) {
startActivity(new Intent(this, AboutActivity.class));
startActivity(new Intent(this, About.class));
}

@Override
Expand All @@ -59,4 +60,12 @@ public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}
}

public void support(View view) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse(String.format("https://t.me/%s", "z3rod0t")));
startActivity(intent);
}
}
53 changes: 47 additions & 6 deletions app/src/main/java/com/cyberviy/ViyP/Home.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

import com.cyberviy.ViyP.models.ViyCred;
import com.cyberviy.ViyP.ui.password.PasswordViewModel;
import com.github.javiersantos.appupdater.AppUpdater;
import com.github.javiersantos.appupdater.enums.Display;
import com.github.javiersantos.appupdater.enums.UpdateFrom;
import com.google.android.material.navigation.NavigationView;

import java.io.IOException;
Expand All @@ -51,12 +54,15 @@ public class Home extends AppCompatActivity {
private static final String PROVIDER = "mail";
final String PREFS_NAME = "appEssentials";
SharedPreferences sharedPreferences;
String repo = "suryaviyyapu";
String pack = "ViyP";
String PREF_KEY_SECURE_CORE_MODE = "SECURE_CORE";
MasterKey masterKey = null;
String PASSWORD = "";
AlertDialog.Builder builder;
boolean secureCodeModeState;
private AppBarConfiguration mAppBarConfiguration;
//TODO Generate password from add activity
AppUpdater appUpdater;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -90,8 +96,9 @@ protected void onCreate(Bundle savedInstanceState) {
} catch (GeneralSecurityException | IOException e) {
e.printStackTrace();
}
secureCodeModeState = sharedPreferences.getBoolean(PREF_KEY_SECURE_CORE_MODE, false);

if (sharedPreferences.getBoolean(PREF_KEY_SECURE_CORE_MODE, false)) {
if (secureCodeModeState) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
}

Expand All @@ -116,12 +123,48 @@ public void onClick(View v) {
nav_refresh();
}
});

// App updater
appUpdater = new AppUpdater(this)
.showEvery(3)
.setDisplay(Display.NOTIFICATION)
.setDisplay(Display.DIALOG)
.setUpdateFrom(UpdateFrom.GITHUB)
.setGitHubUserAndRepo(repo, pack)
.setTitleOnUpdateAvailable("Update available")
.setContentOnUpdateAvailable("Get the latest version available for better security and fixes!")
.setButtonUpdate("Update now?")
.setButtonDismiss("Maybe later")
.setButtonDoNotShowAgain("Huh, not interested");
}

@Override
protected void onStart() {
super.onStart();
if (sharedPreferences.getBoolean("FIRSTNOTICE", true)) {
//AlertDialog START
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
// Setting Alert Dialog Title
alertDialogBuilder.setTitle("Notice");
// Setting Alert Dialog Message
alertDialogBuilder.setMessage("Viyp is still in beta you may face some issues.");
//Positive button
alertDialogBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface arg0, int arg1) {
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean("FIRSTNOTICE", false).apply();
}
});
//Negative button
AlertDialog alertDialog = alertDialogBuilder.create();
alertDialog.show();

//AlertDialog END
if (!secureCodeModeState)
Log.d("Update", String.valueOf(secureCodeModeState));
appUpdater.start();
}
}

@Override
Expand Down Expand Up @@ -203,12 +246,10 @@ public void onActivityResult(int requestCode, int resultCode, @Nullable Intent d
String enc_email = data.getStringExtra(Add.EXTRA_EMAIL);
ViyCred viyCred = new ViyCred(PROVIDER, providerName, enc_email, enc_passwd);
Log.d(TAG, "Provider: " + PROVIDER + " EMAIL: " + enc_email + " ENC_DATA: " + enc_passwd);
SharedPreferences sharedPreferences = this.getApplicationContext().getSharedPreferences(PROVIDER, Context.MODE_PRIVATE);
SharedPreferences sharedPreferences = this.getApplicationContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
PasswordViewModel passwordViewModel = new ViewModelProvider(this).get(PasswordViewModel.class);
passwordViewModel.insert(viyCred);
Toast.makeText(getApplicationContext(), "Saved", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(), "Not Saved", Toast.LENGTH_SHORT).show();
}
super.onActivityResult(requestCode, resultCode, data);
}
Expand Down
13 changes: 5 additions & 8 deletions app/src/main/java/com/cyberviy/ViyP/MLock.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,18 @@ public class MLock extends AppCompatActivity {
// Gradient on statusbar
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static void setStatusBarGradiant(Activity activity) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = activity.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(ContextCompat.getColor(activity, R.color.colorPrimaryDark));
//window.setStatusBarColor(activity.getResources().getColor(android.R.color.transparent));
//window.setNavigationBarColor(activity.getResources().getColor(android.R.color.transparent));
}
Window window = activity.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(ContextCompat.getColor(activity, R.color.colorPrimaryDark));
//window.setStatusBarColor(activity.getResources().getColor(android.R.color.transparent));
//window.setNavigationBarColor(activity.getResources().getColor(android.R.color.transparent));
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStatusBarGradiant(this);
setContentView(R.layout.activity_mlock);

bioAuth();

mlock_tv_greet = findViewById(R.id.mlock_l_tv_greet);
Expand Down
Loading

0 comments on commit 58bc62a

Please sign in to comment.