Skip to content

Commit

Permalink
Merge branch 'master' into daniellacosse/tunneltime/move_metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse authored Oct 16, 2024
2 parents 9cd85db + 14dc63d commit ba026eb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<preference name="android-minSdkVersion" value="26" />
<preference name="android-minSdkVersion" value="29" />
<preference name="android-targetSdkVersion" value="34" />
<preference name="AndroidLaunchMode" value="singleInstance" />
<preference name="ShowSplashScreenSpinner" value="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ServiceInfo;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
Expand Down Expand Up @@ -379,6 +380,8 @@ private void broadcastVpnConnectivityChange(TunnelStatus status) {
}
Intent statusChange = new Intent(STATUS_BROADCAST_KEY);
statusChange.addCategory(getPackageName());
// We must explicitly set the package for security reasons: https://developer.android.com/about/versions/14/behavior-changes-14#security
statusChange.setPackage(this.getPackageName());
statusChange.putExtra(MessageData.PAYLOAD.value, status.value);
statusChange.putExtra(MessageData.TUNNEL_ID.value, tunnelConfig.id);
sendBroadcast(statusChange);
Expand Down Expand Up @@ -448,7 +451,9 @@ private void startForegroundWithNotification(final String serverName) {
notificationBuilder = getNotificationBuilder(serverName);
}
notificationBuilder.setContentText(getStringResource("connected_server_state"));
startForeground(NOTIFICATION_SERVICE_ID, notificationBuilder.build());

// We must specify the service type for security reasons: https://developer.android.com/about/versions/14/changes/fgs-types-required
startForeground(NOTIFICATION_SERVICE_ID, notificationBuilder.build(), ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE);
} catch (Exception e) {
LOG.warning("Unable to display persistent notification");
}
Expand Down
4 changes: 2 additions & 2 deletions client/src/cordova/apple/xcode/macos/Outline/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<preference name="EnableViewportScale" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="29" />
<preference name="android-minSdkVersion" value="29" />
<preference name="android-targetSdkVersion" value="34" />
<preference name="AndroidLaunchMode" value="singleInstance" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="deployment-target" value="10.11" />
Expand Down
2 changes: 2 additions & 0 deletions client/src/cordova/plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
</config-file>

<config-file target="app/src/main/AndroidManifest.xml" parent="/manifest/application">
<service
android:foregroundServiceType="connectedDevice"
android:name="org.outline.vpn.VpnTunnelService"
android:exported="false"
android:label="@string/app_name"
Expand Down

0 comments on commit ba026eb

Please sign in to comment.