Skip to content

Commit

Permalink
Merge pull request #41 from i-shivamsoni/master
Browse files Browse the repository at this point in the history
refactered the code to androidx
  • Loading branch information
i-shivamsoni authored Feb 14, 2023
2 parents 78d8c3d + edc20f9 commit 883ae12
Show file tree
Hide file tree
Showing 23 changed files with 137 additions and 132 deletions.
18 changes: 1 addition & 17 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 18 additions & 16 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 30
defaultConfig {
applicationId "com.appknox.mfva"
minSdkVersion 19
targetSdkVersion 25
minSdkVersion 25
targetSdkVersion 30
versionCode 6
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
Expand All @@ -20,14 +19,14 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.2.0'
compile 'com.squareup.okhttp3:okhttp:3.8.0'
compile 'redis.clients:jedis:2.9.0'
testCompile 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation 'redis.clients:jedis:2.9.0'
testImplementation 'junit:junit:4.12'
}
6 changes: 2 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.appknox.mfva">

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand Down Expand Up @@ -71,10 +72,7 @@
</intent-filter>
</receiver>

<permission
android:description="@string/permission_custom"
android:label="@string/permission_custom"
android:name="com.appknox.mfva.CustomPermission" />


<provider
android:name="com.appknox.mfva.StubProvider"
Expand Down
23 changes: 12 additions & 11 deletions app/src/main/java/com/appknox/mfva/ApiRequestsActivity.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
package com.appknox.mfva;

import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.IOException;
import java.util.UUID;
import java.util.Random;

import okhttp3.MediaType;
import okhttp3.OkHttpClient;
Expand All @@ -27,7 +28,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_api_requests);

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_api_requests);
androidx.appcompat.widget.Toolbar toolbar = (androidx.appcompat.widget.Toolbar) findViewById(R.id.toolbar_api_requests);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);

Expand Down Expand Up @@ -88,11 +89,11 @@ public void run() {
textViewLogs.append(" expiry:" + expiry0 + "\n");
}
});
} catch (IOException|JSONException e) {
} catch (IOException | JSONException e) {
Snackbar.make(v, e.toString(), Snackbar.LENGTH_SHORT).show();
}

if(token == null) {
if (token == null) {
textViewLogs.post(new Runnable() {
@Override
public void run() {
Expand Down Expand Up @@ -122,15 +123,15 @@ public void run() {
textViewLogs.append(" userid:" + id2 + "\n");
}
});
} catch (IOException|JSONException e) {
} catch (IOException | JSONException e) {
Snackbar.make(v, e.toString(), Snackbar.LENGTH_SHORT).show();
}

// Create user
final String user5 = UUID.randomUUID().toString().substring(24, 32),
password5 = "pass0";
RequestBody body5 = RequestBody.create(JSON, "{\"user\":{\"username\":\"" +
user5 + "\",\"password\":\"" + password5 + "\"}}\n");
user5 + "\",\"password\":\"" + password5 + "\"}}\n");
Request request5 = new Request.Builder()
.url("http://vapi.appknox.io/user")
.post(body5)
Expand Down Expand Up @@ -180,7 +181,7 @@ public void run() {
textViewLogs.append(" system up since:" + uptime.trim() + "\n");
}
});
} catch (IOException|JSONException e) {
} catch (IOException | JSONException e) {
Snackbar.make(v, e.toString(), Snackbar.LENGTH_SHORT).show();
}

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/appknox/mfva/ExportedActivity.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.appknox.mfva;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import androidx.appcompat.app.AppCompatActivity;

import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;

Expand All @@ -24,7 +25,7 @@ protected void onCreate(Bundle savedInstanceState) {

try {
Cipher.getInstance("DES/ECB/ZeroBytePadding", "BC");
} catch (NoSuchAlgorithmException|NoSuchProviderException|NoSuchPaddingException e) {
} catch (NoSuchAlgorithmException | NoSuchProviderException | NoSuchPaddingException e) {
// pass
}
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/appknox/mfva/ExportedReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

public class ExportedReceiver extends BroadcastReceiver {
private static final String TAG = "ExportedReceiver";

@Override
public void onReceive(Context context, Intent intent) {
StringBuilder sb = new StringBuilder();
Expand Down
Loading

0 comments on commit 883ae12

Please sign in to comment.