1
0
mirror of http://galexander.org/git/simplesshd.git synced 2025-02-18 17:51:58 +00:00

implement start on boot

This commit is contained in:
Greg Alexander 2014-12-17 23:18:27 -05:00
parent 3112a7ecb3
commit 3620b17411
3 changed files with 22 additions and 3 deletions

View File

@ -6,6 +6,7 @@
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="11" /> <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="11" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application android:label="SimpleSSHD"> <application android:label="SimpleSSHD">
<activity android:name="SimpleSSHD" android:label="SimpleSSHD"> <activity android:name="SimpleSSHD" android:label="SimpleSSHD">
<intent-filter> <intent-filter>
@ -16,5 +17,10 @@
<activity android:name="Settings" android:label="Settings" /> <activity android:name="Settings" android:label="Settings" />
<service android:name="SimpleSSHDService" <service android:name="SimpleSSHDService"
android:label="SimpleSSHDService" /> android:label="SimpleSSHDService" />
<receiver android:name="BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application> </application>
</manifest> </manifest>

2
NOTES
View File

@ -72,8 +72,6 @@ it uses select(), I'm not sure how I would honor Thread.interrupt() or
whatever. It's not guaranteed to interrupt select(), and I'm not keen on whatever. It's not guaranteed to interrupt select(), and I'm not keen on
adding an arbitrary timeout/polling feature to it. adding an arbitrary timeout/polling feature to it.
XXX - implement start on boot
XXX - scp XXX - scp
XXX - zlib XXX - zlib
XXX - rsync XXX - rsync

View File

@ -0,0 +1,15 @@
package org.galexander.sshd;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.Context;
public class BootReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
Prefs.init(context);
if (Prefs.get_onboot()) {
context.startService(new Intent(context,
SimpleSSHDService.class));
}
}
}