Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/libs/ca.psiphon.aar
Git LFS file not shown
89 changes: 53 additions & 36 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@
android:scheme="psiphon"
android:host="settings" />
</intent-filter>
<!-- Accepts URIs in the form of "psiphon://pair” -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="psiphon"
android:host="pair" />
</intent-filter>
</activity>
<activity-alias
android:name="com.psiphon3.psiphonlibrary.TunnelIntentsHandler"
Expand Down Expand Up @@ -111,6 +120,14 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<activity
android:name=".psiphonlibrary.PersonalPairingPreferenceActivity"
android:parentActivityName=".MainActivity"
android:label="@string/app_name">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<activity android:theme="@style/Theme.DialogAlert"
android:excludeFromRecents="true"
android:name=".NotificationPermissionRationaleActivity" />
Expand Down Expand Up @@ -159,41 +176,41 @@
android:process=":LoggingContentProvider"
android:authorities="com.psiphon3.LoggingContentProvider" />
<!-- PsiphonUpdateReceiver receives intents that trigger upgrade checking. -->
<receiver android:name=".PsiphonUpdateReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
<!-- UpgradeChecker receives intents (direct, alarm, boot) that trigger upgrade checking. -->
<receiver
android:name=".psiphonlibrary.UpgradeChecker"
android:process=":UpgradeChecker"
android:exported="false"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<!-- The service that UpgradeChecker uses to do work -->
<service
android:name=".psiphonlibrary.UpgradeChecker$UpgradeCheckerService"
android:label="@string/upgrade_checker_service_name"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":UpgradeChecker" >
</service>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.psiphon3.UpgradeFileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
</application>
<receiver android:name=".PsiphonUpdateReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>

<!-- UpgradeChecker receives intents (direct, alarm, boot) that trigger upgrade checking. -->
<receiver
android:name=".psiphonlibrary.UpgradeChecker"
android:process=":UpgradeChecker"
android:exported="false"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<!-- The service that UpgradeChecker uses to do work -->
<service
android:name=".psiphonlibrary.UpgradeChecker$UpgradeCheckerService"
android:label="@string/upgrade_checker_service_name"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"
android:process=":UpgradeChecker" >
</service>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.psiphon3.UpgradeFileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
</application>

</manifest>
11 changes: 8 additions & 3 deletions app/src/main/java/com/psiphon3/HomeTabFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import android.widget.TextView;
import android.widget.ViewFlipper;

import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
Expand Down Expand Up @@ -164,16 +165,20 @@ public void onDestroy() {
}

private void updateStatusUI(TunnelState tunnelState) {
@DrawableRes int statusIconResId;
if (tunnelState.isRunning()) {
if (tunnelState.connectionData().isConnected()) {
statusViewImage.setImageResource(R.drawable.status_icon_connected);
statusIconResId = tunnelState.connectionData().personalPairingEnabled() ?
R.drawable.status_icon_connected_pp : R.drawable.status_icon_connected;
} else {
statusViewImage.setImageResource(R.drawable.status_icon_connecting);
statusIconResId = tunnelState.connectionData().personalPairingEnabled() ?
R.drawable.status_icon_connecting_pp : R.drawable.status_icon_connecting;
}
} else {
// the tunnel state is either unknown or not running
statusViewImage.setImageResource(R.drawable.status_icon_disconnected);
statusIconResId = R.drawable.status_icon_disconnected;
}
statusViewImage.setImageResource(statusIconResId);
}

private void loadEmbeddedWebView(String url) {
Expand Down
Loading