Libraryless. Click here for Pure Java version (282L/3K/9K).
1 | !752 |
2 | |
3 | import android.content.*; // Intent |
4 | import android.app.*; // Activity |
5 | |
6 | static S serviceProgID = "#1002655"; |
7 | |
8 | p { |
9 | Class serviceClass = Class.forName("de.tinybrain.javax_allperms.PermanentService"); |
10 | print("serviceClass: " + serviceClass); |
11 | if (serviceClass == null) ret; |
12 | |
13 | Activity context = getAndroidContext(); |
14 | print("Context: " + context); |
15 | |
16 | context.startService(new Intent(context, serviceClass)); |
17 | print("Service should be started, looking for instance."); |
18 | |
19 | O service = null; |
20 | for (int i = 0; i < 20*60; i++) { // 60 seconds |
21 | sleep(50); |
22 | service = get(serviceClass, "instance"); |
23 | if (service != null) break; |
24 | } |
25 | |
26 | if (service == null) { print("woot no service?"); ret; } |
27 | |
28 | SharedPreferences prefs = cast call(service, "getSharedPreferences"); |
29 | S id = prefs.getString("serviceprogid", null); |
30 | |
31 | if (id == null) { |
32 | print("No boot program registered."); |
33 | return; |
34 | } |
35 | |
36 | print("Boot program is " + id); |
37 | print("Trying to boot it."); |
38 | call(service, "boot"); |
39 | } |
Began life as a copy of #1002656
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, nbgitpuheiab, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1002657 |
Snippet name: | Boot the boot program |
Eternal ID of this version: | #1002657/1 |
Text MD5: | fe26d84e0ed85d226371f0fb5393f9f8 |
Transpilation MD5: | 88502ab93b2b7801913773939d63d3c3 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (Android) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-02-10 02:22:15 |
Source code size: | 1047 bytes / 39 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 647 / 652 |
Referenced in: | [show references] |