Skip to content

Commit 79ff57f

Browse files
committed
init
0 parents  commit 79ff57f

File tree

79 files changed

+4180
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+4180
-0
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
16+
/app/release/

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.project

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>AutoRun1</name>
4+
<comment>Project AutoRun1 created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
16+
</natures>
17+
<filteredResources>
18+
<filter>
19+
<id>1636629667783</id>
20+
<name></name>
21+
<type>30</type>
22+
<matcher>
23+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
24+
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25+
</matcher>
26+
</filter>
27+
</filteredResources>
28+
</projectDescription>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
arguments=
2+
auto.sync=false
3+
build.scans.enabled=false
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5+
connection.project.dir=
6+
eclipse.preferences.version=1
7+
gradle.user.home=
8+
java.home=D\:/Program Files (x86)/AdoptOpenJDK/jdk-11.0.11.9-hotspot
9+
jvm.arguments=
10+
offline.mode=false
11+
override.workspace.settings=true
12+
show.console.view=true
13+
show.executions.view=true

app/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build
2+
/release/

app/build.gradle

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
plugins {
2+
id 'com.android.application'
3+
}
4+
5+
android {
6+
compileSdkVersion 30
7+
buildToolsVersion "30.0.3"
8+
9+
defaultConfig {
10+
applicationId "com.example.omenchallengehelper"
11+
minSdkVersion 24
12+
targetSdkVersion 30
13+
versionCode 1
14+
versionName "0.0.6"
15+
multiDexEnabled true
16+
17+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18+
}
19+
20+
buildTypes {
21+
release {
22+
minifyEnabled false
23+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24+
}
25+
}
26+
compileOptions {
27+
sourceCompatibility JavaVersion.VERSION_1_8
28+
targetCompatibility JavaVersion.VERSION_1_8
29+
}
30+
buildFeatures {
31+
viewBinding true
32+
}
33+
packagingOptions{
34+
exclude 'META-INF/DEPENDENCIES'
35+
exclude 'androidsupportmultidexversion.txt'
36+
}
37+
38+
}
39+
40+
dependencies {
41+
42+
implementation 'androidx.appcompat:appcompat:1.3.0'
43+
implementation 'com.google.android.material:material:1.3.0'
44+
implementation 'androidx.annotation:annotation:1.2.0'
45+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
46+
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
47+
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
48+
testImplementation 'junit:junit:4.13.2'
49+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
50+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
51+
implementation "org.projectlombok:lombok:1.18.20"
52+
annotationProcessor "org.projectlombok:lombok:1.18.20"
53+
api 'com.github.ok2c.hc5.android:httpclient-android:0.1.1'
54+
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'
55+
implementation 'com.android.support:multidex:1.0.3'
56+
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
57+
implementation 'org.apache.commons:commons-lang3:3.12.0'
58+
// https://mvnrepository.com/artifact/org.gavaghan/geodesy
59+
implementation 'org.gavaghan:geodesy:1.1.3'
60+
// implementation 'ch.qos.logback:logback-classic:1.2.3'
61+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.example.autorun;
2+
3+
import androidx.test.ext.junit.runners.AndroidJUnit4;
4+
5+
import org.junit.runner.RunWith;
6+
7+
import lombok.extern.slf4j.Slf4j;
8+
9+
/**
10+
* Instrumented test, which will execute on an Android device.
11+
*
12+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
13+
*/
14+
@RunWith(AndroidJUnit4.class)
15+
@Slf4j
16+
public class ExampleInstrumentedTest {
17+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package com.example.autorun;
2+
3+
import java.io.IOException;
4+
import java.net.InetAddress;
5+
import java.net.Socket;
6+
7+
import javax.net.ssl.HttpsURLConnection;
8+
import javax.net.ssl.SSLSocket;
9+
import javax.net.ssl.SSLSocketFactory;
10+
11+
public class NoSSLv3SocketFactory extends SSLSocketFactory {
12+
private final SSLSocketFactory delegate;
13+
14+
public NoSSLv3SocketFactory() {
15+
this.delegate = HttpsURLConnection.getDefaultSSLSocketFactory();
16+
}
17+
18+
public NoSSLv3SocketFactory(SSLSocketFactory delegate) {
19+
this.delegate = delegate;
20+
}
21+
22+
@Override
23+
public String[] getDefaultCipherSuites() {
24+
// return delegate.getDefaultCipherSuites();
25+
return new String[]{
26+
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"
27+
};
28+
}
29+
30+
@Override
31+
public String[] getSupportedCipherSuites() {
32+
// return delegate.getSupportedCipherSuites();
33+
34+
return new String[]{
35+
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"
36+
};
37+
}
38+
39+
private Socket makeSocketSafe(Socket socket) {
40+
if (socket instanceof SSLSocket) {
41+
String[] protocols = {
42+
"TLSv1.1",
43+
"TLSv1.2"
44+
};
45+
((SSLSocket) socket).setEnabledProtocols(protocols);
46+
}
47+
return socket;
48+
}
49+
50+
@Override
51+
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException {
52+
return makeSocketSafe(delegate.createSocket(s, host, port, autoClose));
53+
}
54+
55+
@Override
56+
public Socket createSocket(String host, int port) throws IOException {
57+
return makeSocketSafe(delegate.createSocket(host, port));
58+
}
59+
60+
@Override
61+
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {
62+
return makeSocketSafe(delegate.createSocket(host, port, localHost, localPort));
63+
}
64+
65+
@Override
66+
public Socket createSocket(InetAddress host, int port) throws IOException {
67+
return makeSocketSafe(delegate.createSocket(host, port));
68+
}
69+
70+
@Override
71+
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
72+
return makeSocketSafe(delegate.createSocket(address, port, localAddress, localPort));
73+
}
74+
75+
}

app/src/main/AndroidManifest.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.autorun">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/Theme.OmenChallengeHelper">
12+
<activity
13+
android:name="com.example.autorun.ui.login.LoginActivity"
14+
android:label="@string/app_name">
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN" />
17+
18+
<category android:name="android.intent.category.LAUNCHER" />
19+
</intent-filter>
20+
</activity>
21+
</application>
22+
23+
</manifest>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.example.autorun.data;
2+
3+
import com.example.autorun.data.model.LoggedInUser;
4+
5+
import java.io.IOException;
6+
7+
/**
8+
* Class that handles authentication w/ login credentials and retrieves user information.
9+
*/
10+
public class LoginDataSource {
11+
12+
public Result<LoggedInUser> login(String username, String password) {
13+
14+
try {
15+
// TODO: handle loggedInUser authentication
16+
LoggedInUser fakeUser =
17+
new LoggedInUser(
18+
java.util.UUID.randomUUID().toString(),
19+
"Jane Doe");
20+
return new Result.Success<>(fakeUser);
21+
} catch (Exception e) {
22+
return new Result.Error(new IOException("Error logging in", e));
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)