Skip to content

Commit cda5a0f

Browse files
author
hussienalrubaye
committed
files
1 parent 5f657f3 commit cda5a0f

File tree

259 files changed

+7207
-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.

259 files changed

+7207
-0
lines changed

AlarmManager.java

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
public void startAlert() {
3+
// for Alarm 25/12/2012 at 12.00
4+
Calendar myAlarmDate = Calendar.getInstance();
5+
myAlarmDate.setTimeInMillis(System.currentTimeMillis());
6+
myAlarmDate.set(2012, 11, 25, 12, 00, 0);
7+
8+
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
9+
10+
Intent intent = new Intent(this, MyBroadcastReceiver.class);
11+
intent.putExtra("MyMessage","HERE I AM PASSING THEPERTICULAR
12+
MESSAGE WHICH SHOULD BE SHOW ON RECEIVER OF ALARM");
13+
PendingIntent pendingIntent = PendingIntent.getBroadcast(
14+
this.getApplicationContext(),
15+
234324243, intent, 0);
16+
alarmManager.set(AlarmManager.RTC_WAKEUP,
17+
myAlarmDate.getTimeInMillis(),_myPendingIntent);
18+
/* Create Repeating Alarm Start After Each 2 Minutes
19+
am.setRepeating(AlarmManager.ELAPSED_REALTIME,myAlarmDate.getTimeInMillis(),
20+
2*60*60,pendingIntent);
21+
*/
22+
}
23+
24+
25+
/* Permission need
26+
<uses-permission android:name="android.permission.VIBRATE" />
27+
28+
29+
*/

AlertDialog.java

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
AlertDialog.Builder alert= new AlertDialog.Builder(this);
2+
alert.setMessage("are you sure to delete")
3+
.setIcon(android.R.drawable.stat_notify_error)
4+
.setTitle("Alert")
5+
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
6+
@Override
7+
public void onClick(DialogInterface dialog, int which) {
8+
//do some thing
9+
}
10+
})
11+
.setNegativeButton("No", new DialogInterface.OnClickListener() {
12+
@Override
13+
public void onClick(DialogInterface dialog, int which) {
14+
//do some thing
15+
}
16+
}).show();

AndroidVulnerabilityNote.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
Android Vulnerability GitHub Repository
3+
4+
https://github.com/dan7800/VulnerableAndroidAppOracle

Animation.txt

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<set xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<scale xmlns:android="http://schemas.android.com/apk/res/android"
5+
android:fromXScale="0.5"
6+
android:toXScale="3.0"
7+
android:fromYScale="0.5"
8+
android:toYScale="3.0"
9+
android:duration="5000"
10+
android:pivotX="50%"
11+
android:pivotY="50%" >
12+
</scale>
13+
14+
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
15+
android:fromDegrees="0"
16+
android:toDegrees="360"
17+
android:pivotX="50%"
18+
android:pivotY="50%"
19+
android:duration="5000" >
20+
</rotate>
21+
22+
<alpha
23+
android:fromAlpha="0"
24+
android:toAlpha="1"
25+
android:duration="2000" >
26+
</alpha>
27+
28+
29+
<translate
30+
android:fromXDelta="0%p"
31+
android:toXDelta="75%p"
32+
android:duration="800" />
33+
34+
<scale
35+
android:duration="500"
36+
android:fromXScale="1.0"
37+
android:fromYScale="1.0"
38+
android:interpolator="@android:anim/linear_interpolator"
39+
android:toXScale="1.0"
40+
android:toYScale="0.0" />
41+
42+
</set>
43+
44+
45+
46+
47+
/*load
48+
ImageView image = (ImageView)findViewById(R.id.imageView);
49+
Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.slide);
50+
image.startAnimation(animation1);
51+
52+
53+
Use the Reveal Effect
54+
// previously visible view
55+
final View myView = findViewById(R.id.my_view);
56+
57+
// get the center for the clipping circle
58+
int cx = myView.getWidth() / 2;
59+
int cy = myView.getHeight() / 2;
60+
61+
// get the initial radius for the clipping circle
62+
float initialRadius = (float) Math.hypot(cx, cy);
63+
64+
// create the animation (the final radius is zero)
65+
Animator anim =
66+
ViewAnimationUtils.createCircularReveal(myView, cx, cy, initialRadius, 0);
67+
68+
// make the view invisible when the animation is done
69+
anim.addListener(new AnimatorListenerAdapter() {
70+
@Override
71+
public void onAnimationEnd(Animator animation) {
72+
super.onAnimationEnd(animation);
73+
myView.setVisibility(View.INVISIBLE);
74+
}
75+
});
76+
77+
// start the animation
78+
anim.start();
79+
80+
*/

BroadcastReceiver.java

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
2+
3+
//Define BroadcastReceiver
4+
5+
public class MyReceiver extends BroadcastReceiver {
6+
7+
@Override
8+
public void onReceive(Context context, Intent intent) {
9+
// get the bundles in the message
10+
final Bundle bundle = intent.getExtras();
11+
// check the action equal to the action we fire in broadcast,
12+
if ( intent.getAction().equalsIgnoreCase("com.example.Broadcast"))
13+
//read the data from the intent
14+
Toast.makeText(context,bundle.getString("username"),Toast.LENGTH_LONG).show();
15+
16+
if ( intent.getAction().equalsIgnoreCase("android.provider.Telephony.SMS_RECEIVED"))
17+
{
18+
if (bundle != null) {
19+
20+
final Object[] pdusObj = (Object[]) bundle.get("pdus");
21+
SmsMessage[] messages = new SmsMessage[pdusObj.length];
22+
for (int i = 0; i < messages.length; i++) {
23+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
24+
String format = bundle.getString("format");
25+
messages[i] = SmsMessage.createFromPdu((byte[]) pdusObj[i], format);
26+
}
27+
else {
28+
messages[i] = SmsMessage.createFromPdu((byte[]) pdusObj[i]);
29+
}
30+
// SmsMessage currentMessage = SmsMessage.createFromPdu((byte[]) pdusObj[i]);
31+
String senderNum =messages[i].getOriginatingAddress();
32+
String message =messages[i].getMessageBody();//
33+
}
34+
35+
}
36+
}
37+
38+
/* add to AndroidManifest.xml
39+
<uses-permission android:name="android.permission.READ_SMS" />
40+
41+
42+
<receiver android:name=".MyReceiver"
43+
android:permission="android.permission.BROADCAST_SMS"
44+
tools:ignore="UnprotectedSMSBroadcastReceiver">
45+
<intent-filter android:priority="2147483647">
46+
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
47+
<action android:name="com.example.Broadcast" >
48+
</action>
49+
<category android:name="android.intent.category.DEFAULT" />
50+
</intent-filter>
51+
</receiver>
52+
53+
54+
*/
55+
56+
// send sendBroadcast
57+
Intent intent = new Intent();
58+
//set the action that will receive our broadcast
59+
intent.setAction("com.example.Broadcast");
60+
// add data to the bundle
61+
intent.putExtra("username", "alxs1aa");
62+
// send the data to broadcast
63+
sendBroadcast(intent);
64+
65+
//send sms
66+
SmsManager smsManagersend = SmsManager.getDefault();
67+
smsManagersend.sendTextMessage("phone number", null,"hellor from android", null, null);
68+
69+
//start activity from
70+
//start activity
71+
Intent i = new Intent(context,MainActivity.class);
72+
// i.setClassName("com.test", "com.test.MainActivity");
73+
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
74+
context.startActivity(i);
75+
76+

CitySunsetTime/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.externalNativeBuild

CitySunsetTime/.idea/compiler.xml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CitySunsetTime/.idea/copyright/profiles_settings.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CitySunsetTime/.idea/encodings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CitySunsetTime/.idea/gradle.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CitySunsetTime/.idea/misc.xml

+49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CitySunsetTime/.idea/modules.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CitySunsetTime/.idea/runConfigurations.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CitySunsetTime/app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

CitySunsetTime/app/build.gradle

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 24
5+
buildToolsVersion "24.0.0"
6+
defaultConfig {
7+
applicationId "com.hussienalrubaye.services"
8+
minSdkVersion 14
9+
targetSdkVersion 24
10+
versionCode 1
11+
versionName "1.0"
12+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25+
exclude group: 'com.android.support', module: 'support-annotations'
26+
})
27+
compile 'com.android.support:appcompat-v7:24.2.0'
28+
compile 'com.android.support:support-v4:24.2.0'
29+
testCompile 'junit:junit:4.12'
30+
}

0 commit comments

Comments
 (0)