From 5db4a378a9a695435396ceccde4f6c5df518a34c Mon Sep 17 00:00:00 2001 From: kastorcode Date: Thu, 4 May 2023 17:32:17 -0300 Subject: [PATCH] First commit Add README.md, MainActivity, Questions and app icon --- .gitignore | 15 ++ .idea/.gitignore | 3 + .idea/.name | 1 + .idea/codeStyles/Project.xml | 123 ++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/compiler.xml | 6 + .idea/deploymentTargetDropDown.xml | 17 ++ .idea/gradle.xml | 20 ++ .idea/kotlinc.xml | 6 + .idea/misc.xml | 22 +++ README.md | 76 +++++++ app/.gitignore | 1 + app/build.gradle | 43 ++++ app/proguard-rules.pro | 21 ++ .../quizgame/ExampleInstrumentedTest.kt | 24 +++ app/src/main/AndroidManifest.xml | 27 +++ .../quizgame/activities/MainActivity.kt | 107 ++++++++++ .../quizgame/services/quiz/Questions.kt | 39 ++++ .../drawable-v24/ic_launcher_foreground.xml | 30 +++ .../res/drawable/ic_launcher_background.xml | 170 ++++++++++++++++ app/src/main/res/layout/activity_main.xml | 109 +++++++++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3275 bytes .../mipmap-hdpi/ic_launcher_adaptive_back.png | Bin 0 -> 6080 bytes .../mipmap-hdpi/ic_launcher_adaptive_fore.png | Bin 0 -> 4114 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5181 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 1933 bytes .../mipmap-mdpi/ic_launcher_adaptive_back.png | Bin 0 -> 3375 bytes .../mipmap-mdpi/ic_launcher_adaptive_fore.png | Bin 0 -> 2666 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 3031 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4619 bytes .../ic_launcher_adaptive_back.png | Bin 0 -> 9274 bytes .../ic_launcher_adaptive_fore.png | Bin 0 -> 6402 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7369 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7872 bytes .../ic_launcher_adaptive_back.png | Bin 0 -> 16405 bytes .../ic_launcher_adaptive_fore.png | Bin 0 -> 11208 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 12607 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 11652 bytes .../ic_launcher_adaptive_back.png | Bin 0 -> 24257 bytes .../ic_launcher_adaptive_fore.png | Bin 0 -> 16217 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 17884 bytes app/src/main/res/values-night/themes.xml | 16 ++ app/src/main/res/values/colors.xml | 10 + app/src/main/res/values/strings.xml | 9 + app/src/main/res/values/themes.xml | 16 ++ app/src/main/res/xml/backup_rules.xml | 13 ++ .../main/res/xml/data_extraction_rules.xml | 19 ++ .../kastorcode/quizgame/ExampleUnitTest.kt | 17 ++ build.gradle | 10 + gradle.properties | 23 +++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 185 ++++++++++++++++++ gradlew.bat | 89 +++++++++ screenshots/0.jpg | Bin 0 -> 43318 bytes settings.gradle | 16 ++ 58 files changed, 1304 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/.name create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/deploymentTargetDropDown.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/kotlinc.xml create mode 100644 .idea/misc.xml create mode 100644 README.md create mode 100644 app/.gitignore create mode 100644 app/build.gradle create mode 100644 app/proguard-rules.pro create mode 100644 app/src/androidTest/java/com/kastorcode/quizgame/ExampleInstrumentedTest.kt create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/com/kastorcode/quizgame/activities/MainActivity.kt create mode 100644 app/src/main/java/com/kastorcode/quizgame/services/quiz/Questions.kt create mode 100644 app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_back.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_fore.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_back.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_fore.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_back.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/values-night/themes.xml create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/themes.xml create mode 100644 app/src/main/res/xml/backup_rules.xml create mode 100644 app/src/main/res/xml/data_extraction_rules.xml create mode 100644 app/src/test/java/com/kastorcode/quizgame/ExampleUnitTest.kt create mode 100644 build.gradle create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 screenshots/0.jpg create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..30b5318 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Quiz Game \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..7643783 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,123 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..fec2762 --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a0de2a1 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..4515aa3 --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..6f4b444 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..53cc071 --- /dev/null +++ b/README.md @@ -0,0 +1,76 @@ +## Quiz Game Android Kotlin + +> 👷 Developed by Matheus Ramalho de Oliveira +🔨 Brazilian Software Engineer +🏡 Goiânia, Goiás, Brasil +✉️ kastorcode@gmail.com +👍 [instagram.com/kastorcode](https://instagram.com/kastorcode) + +--- + +

+ +

+ +

+ A Q&A game. Developed in the Android App Development & Android Hacking, Android Security course. +

+ +--- + +### Screenshots + +

+ +

+ +--- + +### 🧰 Tools used +[Android Backup Extractor](https://github.com/nelenkov/android-backup-extractor) +[Android Studio](https://developer.android.com/studio) +[APK Studio](https://vaibhavpandey.com/apkstudio) +[Apktool](https://ibotpeaches.github.io/Apktool) +[Bytecode Viewer](https://bytecodeviewer.com) +[jadx](https://github.com/skylot/jadx) +[Uber Apk Signer](https://github.com/patrickfav/uber-apk-signer) +[Visual Studio Code](https://code.visualstudio.com) + +--- + +### 🗓️ Roadmap +- Course Overview +- Introduction to Android +- Android Architecture +- Introduction to Android Development +- Environment Setup +- Development Environment +- Basics of Java Syntax +- Operators +- Control Flow Statements +- Methods Functions +- Java Object Oriented Concept +- Object Oriented Programming +- Wrapper Classes, Auto-Boxing and Unboxing +- Strings +- Exception Handling +- Let's Start Android Application Development +- Android Components +- User Interactions +- Lists & Views +- Components and LifeCycles +- Shared Preferences and Data Saving +- Device Compatibility +- Android Project 1 +- Publishing Your App on Google Play +- Android Project 2 +- Android's Security Model +- Setting Up the Laboratory for Android Security Testing +- Android Static Security Analysis +- Android Pentesting + +--- + +

+ <kastor.code/> +

\ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..99683a6 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,43 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' +} + +android { + compileSdk 32 + + defaultConfig { + applicationId "com.kastorcode.quizgame" + minSdk 21 + targetSdk 32 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'com.google.android.material:material:1.7.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/kastorcode/quizgame/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/kastorcode/quizgame/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..1e20070 --- /dev/null +++ b/app/src/androidTest/java/com/kastorcode/quizgame/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.kastorcode.quizgame + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.kastorcode.quizgame", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..35290a6 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/kastorcode/quizgame/activities/MainActivity.kt b/app/src/main/java/com/kastorcode/quizgame/activities/MainActivity.kt new file mode 100644 index 0000000..966a5c7 --- /dev/null +++ b/app/src/main/java/com/kastorcode/quizgame/activities/MainActivity.kt @@ -0,0 +1,107 @@ +package com.kastorcode.quizgame.activities + +import android.annotation.SuppressLint +import android.app.AlertDialog +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.widget.Button +import android.widget.LinearLayout +import android.widget.TextView +import com.kastorcode.quizgame.R +import com.kastorcode.quizgame.services.quiz.Questions + + +class MainActivity : AppCompatActivity() { + + private lateinit var score : TextView + private lateinit var questions : TextView + private lateinit var answers : Array