Skip to content

Commit

Permalink
Merge pull request #10 from SecUSo/sdk-version-update
Browse files Browse the repository at this point in the history
Update sdk version
  • Loading branch information
udenr authored Oct 4, 2024
2 parents 919eb15 + c3270a0 commit 4b6a605
Show file tree
Hide file tree
Showing 18 changed files with 151 additions and 139 deletions.
8 changes: 3 additions & 5 deletions BaseGameUtils/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: 'android-library'
apply plugin: 'com.android.library'

repositories {
mavenCentral()
Expand All @@ -11,17 +11,15 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.android.tools.build:gradle:7.4.2'
}
}

dependencies {
compile 'com.android.support:appcompat-v7:20.0.+'
compile 'com.android.support:support-v4:20.0.+'
api 'androidx.appcompat:appcompat:1.6.1'
}

android {
compileSdkVersion 20
buildToolsVersion '27.0.3'
}

26 changes: 17 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion '25.0.0'
compileSdkVersion 33
defaultConfig {
applicationId 'de.tudarmstadt.informatik.secuso.phishedu2'
minSdkVersion 10
targetSdkVersion 19
minSdkVersion 19
targetSdkVersion 33
versionCode 31
versionName "1.4.0"
}
Expand All @@ -21,9 +20,18 @@ android {
}

dependencies {
compile 'com.android.support:support-v4:21.0.2'
compile project(':BaseGameUtils')
compile 'com.google.code.gson:gson:2.3'
compile files('libs/android-json-rpc-0.2.jar')
compile 'com.android.support:appcompat-v7:21.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation project(':BaseGameUtils')
implementation 'com.google.code.gson:gson:2.3'
implementation files('libs/android-json-rpc-0.2.jar')
implementation 'androidx.appcompat:appcompat:1.0.0'

constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
}
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
android:theme="@style/AppTheme" >

<activity
android:exported="true"
android:name="de.tudarmstadt.informatik.secuso.phishedu2.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void sendEmail(View view) {
} else {
// Input is OK send email
// invoke Backendcontroller
BackendControllerImpl.getInstance().sendMail(from, to, userMessage);
//BackendControllerImpl.getInstance().sendMail(from, to, userMessage);

// Pop up with go to E-Mail on your Smartphone
showAlertDialog();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ protected void onStartClick() {
Class next_activity = URLTaskActivity.class;
if (this.getLevel() == 0) {
BackendControllerImpl.getInstance().skipLevel0();
next_activity = AwarenessActivity.class;
BackendControllerImpl.getInstance().startLevel(1);
next_activity = LevelIntroActivity.class;
} else if (this.getLevel() == 1) {
next_activity = FindAddressBarActivity.class;
BackendControllerImpl.getInstance().skipLevel1();
BackendControllerImpl.getInstance().startLevel(2);
next_activity = LevelIntroActivity.class;
} else if (this.getLevel() == BackendControllerImpl.getInstance()
.getLevelCount() - 1) {
next_activity = AppEndActivity.class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
package de.tudarmstadt.informatik.secuso.phishedu2;

import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.viewpager.widget.ViewPager;

import de.tudarmstadt.informatik.secuso.phishedu2.backend.BackendControllerImpl;
import de.tudarmstadt.informatik.secuso.phishedu2.backend.NoPhishLevelInfo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
import android.net.Uri;
import android.os.Bundle;
import android.os.Vibrator;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -53,7 +54,7 @@
//import com.google.android.gms.common.api.GoogleApiClient;
//import com.google.android.gms.games.Games;

public class MainActivity extends ActionBarActivity implements FrontendController, OnLevelChangeListener, BackendInitListener, OnLevelstateChangeListener {
public class MainActivity extends AppCompatActivity implements FrontendController, OnLevelChangeListener, BackendInitListener, OnLevelstateChangeListener {
Map<String, PhishBaseActivity> fragCache = new HashMap<String, PhishBaseActivity>();
String current_frag;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBarActivity;

import androidx.appcompat.app.ActionBar;
import androidx.fragment.app.Fragment;
import androidx.appcompat.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
Expand Down Expand Up @@ -149,7 +151,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
}

private void setTitles(){
android.support.v7.app.ActionBar ab = ((ActionBarActivity)getActivity()).getSupportActionBar();
ActionBar ab = ((AppCompatActivity)getActivity()).getSupportActionBar();
//ab.setDisplayUseLogoEnabled(true);
ab.setDisplayHomeAsUpEnabled(enableHomeButton());
ab.setDisplayShowHomeEnabled(true);
Expand Down Expand Up @@ -312,21 +314,21 @@ int getLevel(){
return BackendControllerImpl.getInstance().getLevel();
}

@Override
public void onDetach() {
super.onDetach();

try {
Field childFragmentManager = Fragment.class.getDeclaredField("mChildFragmentManager");
childFragmentManager.setAccessible(true);
childFragmentManager.set(this, null);

} catch (NoSuchFieldException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
// @Override
// public void onDetach() {
// super.onDetach();
//
// try {
// Field childFragmentManager = Fragment.class.getDeclaredField("mChildFragmentManager");
// childFragmentManager.setAccessible(true);
// childFragmentManager.set(this, null);
//
// } catch (NoSuchFieldException e) {
// throw new RuntimeException(e);
// } catch (IllegalAccessException e) {
// throw new RuntimeException(e);
// }
// }

protected void switchToFragment(Class<?extends PhishBaseActivity> target){
((MainActivity)getActivity()).switchToFragment(target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import androidx.fragment.app.FragmentManager;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;

import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
Expand Down Expand Up @@ -104,6 +105,9 @@ void updateUI(Activity v){
super.updateUI(v);

final ViewPager mPager= (ViewPager) v.findViewById(R.id.pager);
if(mPager == null) {
return;
}
mPager.setAdapter(new SwipePageAdapter(getFragmentManager(),this));
mPager.setOnPageChangeListener(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@

import android.os.AsyncTask;

import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.StatusLine;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Arrays;

import de.tudarmstadt.informatik.secuso.phishedu2.backend.BackendControllerImpl;
import de.tudarmstadt.informatik.secuso.phishedu2.backend.BasePhishURL;
import de.tudarmstadt.informatik.secuso.phishedu2.backend.PhishAttackType;
import de.tudarmstadt.informatik.secuso.phishedu2.backend.PhishURL;

Expand All @@ -56,38 +44,38 @@ public GetUrlsTask(UrlsLoadedListener controller){

protected PhishURL[] doInBackground(Integer... params) {

if(false){
int count = params[0];
this.type = PhishAttackType.NoPhish;
for(PhishAttackType type : PhishAttackType.values()){
if(type.getValue() == params[1]){
this.type=type;
break;
}
}
try {
String url = "https://api.no-phish.de/urls/"+this.type.toString()+".json";
HttpResponse response = new DefaultHttpClient().execute(new HttpGet(url));
StatusLine statusLine = response.getStatusLine();
if(statusLine.getStatusCode() == HttpStatus.SC_OK){
ByteArrayOutputStream out = new ByteArrayOutputStream();
response.getEntity().writeTo(out);
out.close();
BasePhishURL[] result = BackendControllerImpl.deserializeURLs(out.toString());
if(result.length > count){
result = Arrays.copyOf(result, count);
}
return result;
} else{
//Closes the connection.
response.getEntity().getContent().close();
throw new IOException(statusLine.getReasonPhrase());
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// if(false){
// int count = params[0];
// this.type = PhishAttackType.NoPhish;
// for(PhishAttackType type : PhishAttackType.values()){
// if(type.getValue() == params[1]){
// this.type=type;
// break;
// }
// }
// try {
// String url = "https://api.no-phish.de/urls/"+this.type.toString()+".json";
// HttpResponse response = new DefaultHttpClient().execute(new HttpGet(url));
// StatusLine statusLine = response.getStatusLine();
// if(statusLine.getStatusCode() == HttpStatus.SC_OK){
// ByteArrayOutputStream out = new ByteArrayOutputStream();
// response.getEntity().writeTo(out);
// out.close();
// BasePhishURL[] result = BackendControllerImpl.deserializeURLs(out.toString());
// if(result.length > count){
// result = Arrays.copyOf(result, count);
// }
// return result;
// } else{
// //Closes the connection.
// response.getEntity().getContent().close();
// throw new IOException(statusLine.getReasonPhrase());
// }
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
return new PhishURL[0];
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_pager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_height="match_parent"
android:orientation="vertical" >

<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="0dp"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<string name="awareness_skip">Skip</string>

<!-- Buttons -->
<string name="level_01_exercise_text_01"><b>Now it's your turn</b>\n\n1. Click on the button \"Click here\", to open a practice website.\n\n2. Wait until the website is fully loaded.\n\n3. Solve the task on the website. When you have completed the task, you will be automatically redirected to the app.</string>
<string name="level_01_exercise_text_01"><b>Now it\'s your turn</b>\n\n1. Click on the button \"Click here\", to open a practice website.\n\n2. Wait until the website is fully loaded.\n\n3. Solve the task on the website. When you have completed the task, you will be automatically redirected to the app.</string>
<string name="level_01_exercise_button_click_here">Click here</string>

<!-- Level 2 - Beispiele -->
Expand Down Expand Up @@ -166,7 +166,7 @@
<string name="level_00_intro_02_text_03">Sender E-Mail:</string>
<string name="level_00_intro_02_text_04">Optional free text:</string>
<string name="level_00_finish_00a_text_01"><b>Not arrived at Google?</b>\n\nYou probably thought you were getting to Google\'s website. Unfortunately, you can but the links in an e-mail or. In general, trust links as well as the given email sender and the rest of the email content.</string>
<string name="level_00_intro_01_text_01"><b>General information:</b>\n\n1.) It is easy to fake the sender of an e-mail. Anyone can do this, even without much prior knowledge. Accordingly, you should be careful when evaluating the trustworthiness of news (Emails, Skype, Social Networks etc.). This is especially true if they contain a link. Not only for links that seem to be familiar to you, but also for those who, for example. �Click Here� mean, you should be careful.\n\n2.) Furthermore, clicking on links does not necessarily lead to the web address specified in the link. Most e-mail applications do not provide a way to see the real goal of links at first glance. \n\nThe real goal of a link is experienced by letting your finger on the link. Depending on the mail program, the destination is then displayed either in a small window directly next to the mouse pointer, or in the status bar at the bottom of the opened mail.\n\nPhishing-Emails and phishing websites you can <b>just</b> based on the web address (of the link) recognize. Therefore, in this app, we'll explain how to verify the authenticity of web addresses before clicking.</string>
<string name="level_00_intro_01_text_01"><b>General information:</b>\n\n1.) It is easy to fake the sender of an e-mail. Anyone can do this, even without much prior knowledge. Accordingly, you should be careful when evaluating the trustworthiness of news (Emails, Skype, Social Networks etc.). This is especially true if they contain a link. Not only for links that seem to be familiar to you, but also for those who, for example. �Click Here� mean, you should be careful.\n\n2.) Furthermore, clicking on links does not necessarily lead to the web address specified in the link. Most e-mail applications do not provide a way to see the real goal of links at first glance. \n\nThe real goal of a link is experienced by letting your finger on the link. Depending on the mail program, the destination is then displayed either in a small window directly next to the mouse pointer, or in the status bar at the bottom of the opened mail.\n\nPhishing-Emails and phishing websites you can <b>just</b> based on the web address (of the link) recognize. Therefore, in this app, we\'ll explain how to verify the authenticity of web addresses before clicking.</string>
<string name="level_00_finish_01_text_01"><b>By the way, that does not just apply to e-mails!</b>\n\nDangers do not just lurk behind links in emails, but generally whenever you click on a link (e.g., on another website, in an SMS or in messages on Facebook or Twitter).</string>
<string name="level_00_finish_02_text_01"><b>Anyone can create web addresses and website copies!</b>\n\nAnyone can create web addresses and website copies. Displaying an identical copy of a web page there is almost effortless and involves almost no cost. That, if you land on a website, the displayed website may look correct at first glance, but is actually the copy of a familiar website, which was created to harm you.</string>
<string name="level_00_finish_03_text_01"><b>Original</b>\n\nIn the following we show you a part of the <b>original</b> Website of Facebook. At the web address https://m.facebook.com/ (outlined in green) you can tell that this website is the original.</string>
Expand Down Expand Up @@ -219,7 +219,7 @@
<string name="level_finished"><b>Done!</b>\n\nCongratulations! You have completed the level successfully. On to the next Level!</string>

<!-- Level 2 - IP NO BRAND-->
<string name="level_04_intro_00_text_01"><b>Attack by IP address as the who area</b>\n\nPhishers use various deceptions, to make web addresses trustworthy, although they are not.\n\nYou will gradually learn with which tricks they try, to fool you.\n\nIn this level, we'll cover one of the simplest tricks of using IP addresses instead of terms in the who's area of the web address.</string>
<string name="level_04_intro_00_text_01"><b>Attack by IP address as the who area</b>\n\nPhishers use various deceptions, to make web addresses trustworthy, although they are not.\n\nYou will gradually learn with which tricks they try, to fool you.\n\nIn this level, we\'ll cover one of the simplest tricks of using IP addresses instead of terms in the who\'s area of the web address.</string>
<string name="level_04_intro_01_text_01"><b>IP-Addresses</b>\n\nJust as our homes are addressed by street names, computers are identified on the Internet with so-called IP-Address.</string>
<string name="level_04_intro_01_text_02">An IP address is a sequence of 4 blocks of numbers separated by dots.</string>
<string name="level_04_intro_01_example_ip">Example: 192.168.10.15</string>
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.8.10"
repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.android.tools.build:gradle:7.4.2'
}
}

allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
android.enableJetifier=true
android.useAndroidX=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jul 02 16:05:46 CEST 2018
#Mon Jul 17 15:37:25 CEST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
zipStoreBase=GRADLE_USER_HOME
Loading

0 comments on commit 4b6a605

Please sign in to comment.