mirror of https://github.com/PurpleI2P/i2pd.git
hypnosis-i2p
7 years ago
7 changed files with 136 additions and 34 deletions
@ -1,26 +1,55 @@
@@ -1,26 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" |
||||
package="org.purplei2p.i2pd" |
||||
android:installLocation="auto" |
||||
android:versionCode="1" |
||||
android:versionName="2.18.0"> |
||||
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="25"/> |
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> |
||||
<uses-permission android:name="android.permission.INTERNET"/><!-- normal perm, per https://developer.android.com/guide/topics/permissions/normal-permissions.html --> |
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><!-- normal perm --> |
||||
<application android:label="@string/app_name" android:allowBackup="true" android:icon="@drawable/icon" android:theme="@style/Theme.AppCompat"> |
||||
<receiver android:name=".NetworkStateChangeReceiver"> |
||||
<intent-filter> |
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/> |
||||
</intent-filter> |
||||
</receiver> |
||||
<activity android:name=".I2PDPermsAskerActivity" android:label="@string/app_name"> |
||||
package="org.purplei2p.i2pd" |
||||
android:installLocation="auto" |
||||
android:versionCode="1" |
||||
android:versionName="2.18.0"> |
||||
|
||||
<uses-sdk |
||||
android:minSdkVersion="14" |
||||
android:targetSdkVersion="25" /> |
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
||||
<uses-permission android:name="android.permission.INTERNET" /> <!-- normal perm, per https://developer.android.com/guide/topics/permissions/normal-permissions.html --> |
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> |
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- normal perm --> |
||||
<application |
||||
android:allowBackup="true" |
||||
android:icon="@drawable/icon" |
||||
android:label="@string/app_name" |
||||
> |
||||
<receiver android:name=".NetworkStateChangeReceiver"> |
||||
<intent-filter> |
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> |
||||
</intent-filter> |
||||
</receiver> |
||||
|
||||
<activity |
||||
android:name=".I2PDPermsAskerActivity" |
||||
android:label="@string/app_name"> |
||||
<intent-filter> |
||||
<action android:name="android.intent.action.MAIN" /> |
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" /> |
||||
</intent-filter> |
||||
</activity> |
||||
<activity android:name=".I2PDActivity" android:label="@string/app_name"/> |
||||
<service android:enabled="true" android:name=".ForegroundService"/> |
||||
<activity |
||||
android:name=".I2PDActivity" |
||||
android:label="@string/app_name" /> |
||||
|
||||
<service |
||||
android:name=".ForegroundService" |
||||
android:enabled="true" /> |
||||
|
||||
<activity |
||||
android:name=".I2PDPermsExplanationActivity" |
||||
android:label="@string/title_activity_i2_pdperms_asker_prompt" |
||||
android:parentActivityName=".I2PDPermsAskerActivity"> |
||||
<meta-data |
||||
android:name="android.support.PARENT_ACTIVITY" |
||||
android:value="org.purplei2p.i2pd.I2PDPermsAskerActivity" /> |
||||
</activity> |
||||
</application> |
||||
|
||||
</manifest> |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
<LinearLayout android:id="@+id/layout_prompt" |
||||
xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:orientation="vertical" |
||||
android:paddingBottom="@dimen/vertical_page_margin" |
||||
android:paddingLeft="@dimen/horizontal_page_margin" |
||||
android:paddingRight="@dimen/horizontal_page_margin" |
||||
android:paddingTop="@dimen/vertical_page_margin" |
||||
tools:context=".I2PDPermsAskerActivity"> |
||||
|
||||
<TextView |
||||
android:id="@+id/textview_explanation" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginBottom="@dimen/horizontal_page_margin" |
||||
android:text="SD card write access is required to write the keys and other files to the I2PD folder on SD card." |
||||
/> |
||||
|
||||
<Button |
||||
android:id="@+id/button_ok" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:text="OK" |
||||
/> |
||||
</LinearLayout> |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
package org.purplei2p.i2pd; |
||||
|
||||
import android.content.Intent; |
||||
import android.os.Bundle; |
||||
import android.app.Activity; |
||||
import android.view.View; |
||||
import android.widget.Button; |
||||
|
||||
public class I2PDPermsExplanationActivity extends Activity { |
||||
|
||||
@Override |
||||
protected void onCreate(Bundle savedInstanceState) { |
||||
super.onCreate(savedInstanceState); |
||||
setContentView(R.layout.activity_perms_explanation); |
||||
//getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
Button button_ok = (Button) findViewById(R.id.button_ok); |
||||
button_ok.setOnClickListener(new View.OnClickListener() { |
||||
@Override |
||||
public void onClick(View view) { |
||||
returnFromActivity(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
private void returnFromActivity() { |
||||
Intent data = new Intent(); |
||||
Activity parent = getParent(); |
||||
if (parent == null) { |
||||
setResult(Activity.RESULT_OK, data); |
||||
} else { |
||||
parent.setResult(Activity.RESULT_OK, data); |
||||
} |
||||
finish(); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue