1

I'm currently working on an app for this kind of device: link. I want the user to be able to set a timer to shutdown and boot (NOT reboot) at a specific time during the week.

I did a lot of researches but I have't found the answer to my question. Everybody says that's impossible to boot using a timer since the device is supposed to be off. However, in the settings of the device, there is an option "Timer Switch Machine" which allow to do that (as describe in the link above). So I think there is a way to hack this functionality throw my app, if the device is rooted. But I don't know how to do that.

Does anyone have an idea?

Eselfar
  • 3,759
  • 3
  • 23
  • 43
  • 1
    "So I think there is a way to hack this functionality throw my app, if the device is rooted" -- and it is that particular piece of hardware. "Does anyone have an idea?" -- talk to the manufacturer and ask them. – CommonsWare Apr 04 '16 at 16:03
  • I guess you could pull the settings app off the device with ADB, and then decompile it, to see how it works. My guess is that it uses a shell command of some sort which you could call from your code. – Jonas Czech Apr 04 '16 at 16:08
  • http://stackoverflow.com/questions/32644120/does-a-android-app-work-if-phone-is-switch-off – frogatto Apr 04 '16 at 16:52
  • Thank you for your answers. I can't have information from the manufacturer unfortunately so I tried your other suggestion. I get the apk of the Settings app with Apk Extractor and I used APKTool to decompile the files, but I have no java file in the result (only the xmls). It's because there is no classes.dex in the apk. So I get directly the .odex file (loc. in /system/framework) of the app and I used Baksmali to deassemble. But in the result I have smali files (not java) and I can't read assembler code. Apparently there is no way to transform smali into java. Did I do something wrong? – Eselfar Apr 06 '16 at 09:14

1 Answers1

0

This functionality is not part of the AOSP. That means first you have to gain access to the source code (or alternatively talk to someone who has access to it).

You might be able to find the corresponding code by decompiling System apps (especially the app which contains the option).

Otherwise you'd have to find a contact to the developer (probably via the manufacturer).


If you have the sources, the easiest way to hook into it is normally using xposed.

But depending on the actual implementation (e.g. if it's a shell call) there might be a better way.

F43nd1r
  • 7,690
  • 3
  • 24
  • 62