-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
200 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="fill_parent" android:layout_height="500dip" | ||
|
||
android:padding="6dip"> | ||
|
||
<LinearLayout android:layout_width="0dip" | ||
android:layout_weight="1" android:layout_height="1000dip" | ||
android:weightSum="1" android:orientation="vertical"> | ||
|
||
<TextView android:id="@+id/thanks" android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" android:textSize="25px" | ||
android:gravity="center_vertical" android:text="Thanks! \n\nWe are now collecting network data from applications on your phone.(It is anonymous with little overhead)\n | ||
\nData collecting can be stopped at any time." /> | ||
<Button android:id="@+id/tpa_btn_stop" | ||
android:layout_marginTop="10dip" android:text="Stop Data Collection" | ||
android:layout_width="match_parent" android:layout_height="wrap_content"></Button> | ||
</LinearLayout> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.mobiperf.service; | ||
|
||
import com.mobiperf.InformationCenter; | ||
import com.mobiperf.Utilities; | ||
|
||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.content.SharedPreferences; | ||
import android.util.Log; | ||
public class StartupReceiver extends BroadcastReceiver { | ||
|
||
static Thread serviceSwitchThread; | ||
|
||
@Override | ||
public void onReceive(Context context, Intent intent) { | ||
|
||
SharedPreferences settings = context.getSharedPreferences( | ||
"pref", 0); | ||
//if the user doesn't allow us to upload | ||
if(!settings.getBoolean("canUpload", | ||
false)) | ||
return; | ||
Log.v("Mobiperf", "receive boot intent"); | ||
InformationCenter.init(context); | ||
InformationCenter.reset(); | ||
Thread binaryThread = Utilities.installBinaries(context); | ||
/**** wait till all the binaries are installed ****/ | ||
try { | ||
binaryThread.join(); | ||
} catch (InterruptedException e) { | ||
e.printStackTrace(); | ||
} | ||
Intent serviceIntent = new Intent(context, TcpdumpService.class); | ||
context.startService(serviceIntent); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/**************************** | ||
* This file is part of the MobiPerf project (http://mobiperf.com). | ||
* We make it open source to help the research community share our efforts. | ||
* If you want to use all or part of this project, please give us credit and cite MobiPerf's official website (mobiperf.com). | ||
* The package is distributed under license GPLv3. | ||
* If you have any feedbacks or suggestions, don't hesitate to send us emails (3gtest@umich.edu). | ||
* The server suite source code is not included in this package, if you have specific questions related with servers, please also send us emails | ||
* | ||
* Contact: 3gtest@umich.edu | ||
* Development Team: Junxian Huang, Birjodh Tiwana, Zhaoguang Wang, Zhiyun Qian, Cheng Chen, Yutong Pei, Feng Qian, Qiang Xu | ||
* Copyright: RobustNet Research Group led by Professor Z. Morley Mao, (Department of EECS, University of Michigan, Ann Arbor) and Microsoft Research | ||
* | ||
****************************/ | ||
|
||
package com.mobiperf.ui; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.content.SharedPreferences; | ||
import android.os.Bundle; | ||
import android.text.Editable; | ||
import android.text.method.ScrollingMovementMethod; | ||
import android.util.Log; | ||
import android.view.Menu; | ||
import android.view.MenuItem; | ||
import android.view.View; | ||
import android.widget.TextView; | ||
|
||
import com.mobiperf.R; | ||
import com.mobiperf.Tcpdump; | ||
|
||
public class Thanks extends Activity { | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.thanks); | ||
|
||
findViewById(R.id.tpa_btn_stop).setOnClickListener( | ||
new View.OnClickListener() { | ||
// @Override | ||
public void onClick(View v) { | ||
SharedPreferences settings = getSharedPreferences("pref", 0); | ||
SharedPreferences.Editor spe = settings.edit(); | ||
spe.putBoolean("canUpload", false); | ||
spe.commit(); | ||
Intent intent = new Intent(getActivity(), com.mobiperf.service.TcpdumpService.class); | ||
stopService(intent); | ||
finish(); | ||
} | ||
}); | ||
} | ||
protected Activity getActivity() { | ||
return this; | ||
} | ||
/******************** Menu ends here ********************/ | ||
|
||
} |