2

I'm developing a module to achieve when specifying app launch, change the system time by SystemClock.setCurrentTimeMillis(), this method required sharedUserId permission, as we know, most of the app haven't this permission, and I'm sure in my module can invoke SystemClock.setCurrentTimeMillis() correctly

But now, it's invoked by hook app:

Error Screenshot

So I want to know how to call SystemClock.setCurrentTimeMillis() at handleLoadPackage in the name of My Xposed Module

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
zxq
  • 21
  • 3
  • As you have Xposed your device is rooted. For changing the system time you could therefore just change date and time using using root permissions. The "Xposed way" would be not to manipulate the system time but instead hook all methods used by the app that return the current time and let them return a wrong date (e.g. use the correct time but always on the same fixed day). In this case the system time for all apps would remain correct but the one app that needs it different gets the time it expects. – Robert Jan 01 '21 at 17:17
  • you mean i should change time using root or hook app method and return wrong time to achieve it, i just try to hook java.lang.System.currentTimeMillis, not reached my expectation,is not work in my case, i'll try change time using root, thank you! – zxq Jan 01 '21 at 19:40
  • Nobody who want's to get current date and time uses `java.lang.System.currentTimeMillis`. Normal developers use `java.util.Date`, `java.util.Calendar` respectively `java.util.GregorianCalendar`. Decompile the app and check what date function(s) are used in it to check the date requirement. May be you can even hook the specific method of the app that checks the date. – Robert Jan 02 '21 at 09:53

0 Answers0