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
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ along with SwiFTP. If not, see <http://www.gnu.org/licenses/>.
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<uses-feature
android:name="android.software.leanback"
Expand Down Expand Up @@ -117,6 +118,13 @@ along with SwiFTP. If not, see <http://www.gnu.org/licenses/>.
</intent-filter>
</receiver>

<receiver android:name="be.ppareit.android.AutoStartAfterBoot">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>

<service
android:name=".gui.FsTileService"
android:icon="@mipmap/ic_qs_ftp_server"
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/java/be/ppareit/android/AutoStartAfterBoot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package be.ppareit.android;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import be.ppareit.swiftp.FsService;
import be.ppareit.swiftp.FsSettings;

public class AutoStartAfterBoot extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()) && FsSettings.allowAfterBootStart()) {
FsService.start();
}
}
}
5 changes: 5 additions & 0 deletions app/src/main/java/be/ppareit/swiftp/FsSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ public static boolean allowAnonymous() {
return sp.getBoolean("allow_anonymous", false);
}

public static boolean allowAfterBootStart() {
final SharedPreferences sp = getSharedPreferences();
return sp.getBoolean("allow_start_after_boot", false);
}

public static File getDefaultChrootDir() {
File chrootDir;
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,6 @@ Gemeldete Probleme und Verbesserungsvorschläge sind unter https://github.com/pp
<string name="mixed_theme">Gemischtes Thema</string>
<string name="app_theme">Thema...</string>

<string name="boot_auto_start_label">Permitir inicio de arranque</string>
<string name="boot_auto_start">Iniciar automáticamente después de arrancar Android</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,7 @@ https://github.com/ppareit/swiftp/issues .\n\n
<string name="light_theme">Φωτεινό Θέμα</string>
<string name="mixed_theme">Ανάμεικτο Θέμα</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>

3 changes: 3 additions & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,7 @@ implementarán, mira el registro de incidencias en https://github.com/ppareit/sw
<string name="light_theme">Tema ligero</string>
<string name="mixed_theme">Tema mixto</string>
<string name="app_theme">Tema...</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,6 @@ https://github.com/ppareit/swiftp/issues .\n\n
<string name="mixed_theme">Thème mixte</string>
<string name="app_theme">Thème...</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@ https://github.com/ppareit/swiftp/issues .\n\n
<string name="mixed_theme">Tema misto</string>
<string name="app_theme">Tema...</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,6 @@ https://github.com/ppareit/swiftp/issues を参照してください。\n\n
<string name="mixed_theme">混合テーマ</string>
<string name="app_theme">テーマ...</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,6 @@ van de volgende versie staan op https://github.com/ppareit/swiftp/issues .\n\n
<string name="mixed_theme">Gemengd thema</string>
<string name="app_theme">Thema...</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,6 @@ na stronie https://github.com/ppareit/swiftp/issues .\n\n
</string>
<string name="write_external_storage_old_android_version_summary">Na tych urządzeniach cały sklep jest dostępny przy użyciu hierarchii plików.</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,6 @@ https://github.com/ppareit/swiftp/issues .\n\n
<string name="mixed_theme">Смешанная тема</string>
<string name="app_theme">Тема...</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-sq/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,6 @@ https://github.com/ppareit/swiftp/issues .\n\n
</string>
<string name="write_external_storage_old_android_version_summary">Në këto pajisje, e gjithë dyqani është në dispozicion duke përdorur hierarkinë e skedarit.</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-sr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,6 @@ https://github.com/ppareit/swiftp/issues .\n\n
<string name="mixed_theme">микед Тема</string>
<string name="app_theme">Тема...</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,6 @@ https://github.com/ppareit/swiftp/issues 提交您的建议。\n\n
<string name="storage_warning">警告:当前存储暂不可用,您可能需要取消挂载。</string>
<string name="widget_name">FTP Server Widget</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,6 @@ https://github.com/ppareit/swiftp/issues 提交您的建議。\n\n
</string>
<string name="write_external_storage_old_android_version_summary">在這些裝置上,可以使用檔案階層標準來使用所有存儲空間。</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/defaults.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ along with SwiFTP. If not, see <http://www.gnu.org/licenses/>.
<string name="acceptwifi_default" translatable="false">true</string>
<string name="wakelock_default" translatable="false">true</string>
<string name="writeExternalStorage_default" translatable="false">true</string>
<string name="start_after_boot" translatable="false">false</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,6 @@ https://github.com/ppareit/swiftp/issues .\n\n
</string>
<string name="write_external_storage_old_android_version_summary">On these devices, all store is available using the file hierarchy.</string>

<string name="boot_auto_start_label">Allow After Boot startup</string>
<string name="boot_auto_start">Automatically start after booting android</string>
</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ along with SwiFTP. If not, see <http://www.gnu.org/licenses/>.
android:summary="@string/anonymous_summary"
android:title="@string/allow_anonymous_label" />

<CheckBoxPreference
android:defaultValue="@string/start_after_boot"
android:key="allow_start_after_boot"
android:summary="@string/boot_auto_start"
android:title="@string/boot_auto_start_label" />

<be.ppareit.android.DynamicMultiSelectListPreference
android:defaultValue="@array/empty_array"
android:entries="@array/empty_array"
Expand Down