Commit Graph

417 Commits

Author SHA1 Message Date
Viktor De Pasquale 8737be2623 Updated policy (apps) layout to be more compact
Added pinch in to increase list span count / out to decrease
  The setting will be remembered across the whole app (every list that uses Staggered Grid)
Updated indication of whether the policy has root access enabled permitted or not
  Displays crossed out app logo if not permitted
2020-01-04 16:07:53 +01:00
Viktor De Pasquale b8b0f257db Updated navigation behavior to be consistent and easily manageable 2020-01-04 13:30:21 +01:00
topjohnwu 40c64d50d5 Merge branch 'master' into feature/redesign 2020-01-02 14:52:50 +08:00
topjohnwu b3328a0ec2 Make sure shell command won't block 2020-01-02 02:19:56 +08:00
topjohnwu 3049a81c3b Update several scripts
- Update backup format as we might be patching multiple partitions
- Update uninstaller to remove files in persist (sepolicy.rule)
- Better handling for dtb/dtbo partition patching
2020-01-01 14:02:44 +08:00
Viktor De Pasquale 3bda7cb26b Removed exclusive usage of 29 level API 2019-12-13 14:41:49 +01:00
Viktor De Pasquale 848be8f806 Fixed rtl for reveal animations 2019-12-06 18:06:59 +01:00
Viktor De Pasquale c79b79b37e Cleaned up extensions and utilities in redesign 2019-12-06 16:28:41 +01:00
Viktor De Pasquale 73c4b21285 Added (partially) settings screen
Most importantly added design and functionality backing for these items
2019-11-27 19:47:20 +01:00
Viktor De Pasquale 78d7c45be3 Merge remote-tracking branch 'john/master' into feature/redesign 2019-11-26 14:34:38 +01:00
topjohnwu 72edbfc455 Some platforms do not like null Bundles 2019-11-25 19:09:54 -05:00
Viktor De Pasquale cc7e47bbb6 Added themes
All files (that used styles) were refactored to use styles directly so themes can only actually adjust colors
 - Elaborate themes would be super hard to maintain and would certainly break over time
2019-11-22 19:29:53 +01:00
Viktor De Pasquale 4f0e1c6c61 Merge remote-tracking branch 'john/master' into feature/redesign
# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/topjohnwu/magisk/Hacks.kt
#	app/src/main/java/com/topjohnwu/magisk/data/database/RepoDatabase.kt
#	app/src/main/java/com/topjohnwu/magisk/data/repository/LogRepository.kt
#	app/src/main/java/com/topjohnwu/magisk/di/DatabaseModule.kt
#	app/src/main/java/com/topjohnwu/magisk/extensions/RxJava.kt
#	app/src/main/java/com/topjohnwu/magisk/extensions/XAndroid.kt
#	app/src/main/java/com/topjohnwu/magisk/extensions/XJava.kt
#	app/src/main/java/com/topjohnwu/magisk/model/download/RemoteFileService.kt
#	app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/LogRvItem.kt
#	app/src/main/java/com/topjohnwu/magisk/model/events/ViewEvents.kt
#	app/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt
#	app/src/main/res/xml/app_settings.xml
2019-11-21 17:46:59 +01:00
topjohnwu da159e4655 Better environment status detection 2019-11-16 17:38:10 -05:00
topjohnwu 3d285b91c6 Use ContextCompat 2019-11-15 11:01:39 -05:00
topjohnwu b29f0ca4d1 Support using BiometricPrompt 2019-11-14 05:42:39 -05:00
topjohnwu 576efbdc1b Move su logs out of magiskdb 2019-11-14 00:01:06 -05:00
topjohnwu 171ddab32b Reorganize code handling su requests 2019-11-12 03:20:07 -05:00
Viktor De Pasquale f83f92d3fa Updated modules screen so it displays all the content in one recyclerview
Added "endless" scrolling support
 - this is done in order to display everything very swiftly and load as user needs it
 - for the most part we'll download only ~10 items and load the rest as scroll progresses, this accomplishes the illusion that whole list is being populated
Added sections and updated repo view
2019-11-08 19:04:30 +01:00
Viktor De Pasquale 70a3dbe2b0 Added primitive implementation of modules screen 2019-11-05 19:38:02 +01:00
topjohnwu b1d25e0503 Reuse ALPHANUM 2019-11-04 15:42:40 -05:00
topjohnwu 25c557248c Use ContentProvider call method for communication
Previously, we use either BroadcastReceivers or Activities to receive
messages from our native daemon, but both have their own downsides.
Some OEMs blocks broadcasts if the app is not running in the background,
regardless of who the caller is. Activities on the other hand, despite
working 100% of the time, will steal the focus of the current foreground
app, even though we are just doing some logging and showing a toast.
In addition, since stubs for hiding Magisk Manager is introduced, our
only communication method is left with the broadcast option, as
only broadcasting allows targeting a specific package name, not a
component name (which will be obfuscated in the case of stubs).

To make sure root requests will work on all devices, Magisk had to do
some experiments every boot to test whether broadcast is deliverable or
not. This makes the whole thing even more complicated then ever.

So lets take a look at another kind of component in Android apps:
ContentProviders. It is a vital part of Android's ecosystem, and as far
as I know no OEMs will block requests to ContentProviders (or else
tons of functionality will break catastrophically). Starting at API 11,
the system supports calling a specific method in ContentProviders,
optionally sending extra data along with the method call. This is
perfect for the native daemon to start a communication with Magisk
Manager. Another cool thing is that we no longer need to know the
component name of the reciever, as ContentProviders identify themselves
with an "authority" name, which in Magisk Manager's case is tied to the
package name. We already have a mechanism to keep track of our current
manager package name, so this works out of the box.

So yay! No more flaky broadcast tests, no more stupid OEMs blocking
broadcasts for some bizzare reasons. This method should in theory
work on almost all devices and situations.
2019-11-04 14:32:28 -05:00
Viktor De Pasquale 016e28383b Added animated progressbar 2019-11-04 16:58:39 +01:00
topjohnwu 6f7c13b814 Refactor JarMap 2019-11-03 04:45:35 -05:00
Viktor De Pasquale dad52724db Updated hide fragment with more robust filtering UI 2019-11-02 18:31:20 +01:00
topjohnwu 4cd154675f Random dname 2019-11-01 18:52:37 -04:00
Viktor De Pasquale 6720725d27 Added clarifying tooltips and captions 2019-11-01 18:12:52 +01:00
topjohnwu 10ce11d671 Fix config/locale issues
Close #1977
2019-10-31 17:13:06 -04:00
Viktor De Pasquale 6aa22267f4 Updated Hide screen to be fully functioning
...although still misses search :(
2019-10-31 20:34:07 +01:00
Viktor De Pasquale 7d6eebdae3 Fixed unreasonable change resulting in major breakage all around the app 2019-10-29 16:50:01 +01:00
Viktor De Pasquale f11bb609c9 Merge remote-tracking branch 'john/master' into feature/redesign
# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/topjohnwu/magisk/ClassMap.kt
#	app/src/main/java/com/topjohnwu/magisk/Info.kt
#	app/src/main/java/com/topjohnwu/magisk/extensions/XAndroid.kt
#	app/src/main/java/com/topjohnwu/magisk/ui/SplashActivity.kt
#	app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.kt
#	app/src/main/java/com/topjohnwu/magisk/utils/DataBindingAdapters.kt
2019-10-29 15:53:53 +01:00
topjohnwu ee447bc4ce Improve Keygen yet again 2019-10-26 21:11:32 -04:00
Viktor De Pasquale da707afa3f Updated install ui to better fit app's theme 2019-10-26 17:40:29 +02:00
topjohnwu 97a691ce2f Improve keygen for signing repackaged manager 2019-10-24 13:04:15 -04:00
topjohnwu 9d948f2c2b Temporary disable verification when hiding app
For some reason, Google Play Protect randomly blocks our self-signed
repackaged Magisk Manager APKs. Since we are root, the sky is our
limit, so yeah, disable package verification temporarily when installing
patched APKs, LOLz

Close #1979
2019-10-24 12:23:03 -04:00
topjohnwu c30be20e49 Minor CachedValue fix 2019-10-24 04:02:01 -04:00
topjohnwu 676e9c6593 Provide upgrade path for stubs 2019-10-24 02:47:40 -04:00
topjohnwu 5133e5910e Don't relaunch app immediately 2019-10-23 07:12:00 -04:00
topjohnwu f8fcaadb5b Hide manager with stub if feasible 2019-10-23 05:50:06 -04:00
topjohnwu 0b5fd3ee76 Only allow hide/restore app if connected 2019-10-23 05:43:01 -04:00
topjohnwu 71136d7347 Manually trigger broadcast tests if necessary 2019-10-22 16:04:20 -04:00
topjohnwu a18c552ddf Guard env state behind cached objects 2019-10-22 15:37:55 -04:00
Viktor De Pasquale 17fb8f2298 Added new magisk install flow 2019-10-22 20:46:09 +02:00
Viktor De Pasquale 7ded7de39a Added custom dialog for setting app's name after repackaging 2019-10-22 04:52:19 -04:00
topjohnwu 0f74e89b44 Introduce component agnostic communication
Usually, the communication between native and the app is done via
sending intents to either broadcast or activity. These communication
channels are for launching root requests dialogs, sending root request
notifications (the toast you see when an app gained root access), and
root request logging.

Sending intents by am (activity manager) usually requires specifying
the component name in the format of <pkg>/<class name>. This means parts
of Magisk Manager cannot be randomized or else the native daemon is
unable to know where to send data to the app.

On modern Android (not sure which API is it introduced), it is possible
to send broadcasts to a package, not a specific component. Which
component will receive the intent depends on the intent filter declared
in AndroidManifest.xml. Since we already have a mechanism in native code
to keep track of the package name of Magisk Manager, this makes it
perfect to pass intents to Magisk Manager that have components being
randomly obfuscated (stub APKs).

There are a few caveats though. Although this broadcasting method works
perfectly fine on AOSP and most systems, there are OEMs out there
shipping ROMs blocking broadcasts unexpectedly. In order to make sure
Magisk works in all kinds of scenarios, we run actual tests every boot
to determine which communication method should be used.

We have 3 methods in total, ordered in preference:
1. Broadcasting to a package
2. Broadcasting to a specific component
3. Starting a specific activity component

Method 3 will always work on any device, but the downside is anytime
a communication happens, Magisk Manager will steal foreground focus
regardless of whether UI is drawn. Method 1 is the only way to support
obfuscated stub APKs. The communication test will test method 1 and 2,
and if Magisk Manager is able to receive the messages, it will then
update the daemon configuration to use whichever is preferable. If none
of the broadcasts can be delivered, then the fallback method 3 will be
used.
2019-10-21 13:59:04 -04:00
Viktor De Pasquale 7f0a87742a Fixed design issues in dialogs
Dark theme not being properly implemented
Icons were not set
2019-10-20 17:26:00 +02:00
topjohnwu 325d9a0b86 Generate keys for signing hidden Magisk Manager 2019-10-20 06:56:33 -04:00
Viktor De Pasquale b910db322b Fixed snackbar behavior in contrast with bottom navigation 2019-10-20 10:57:29 +02:00
Viktor De Pasquale 7c6d85221d Updated policy items design 2019-10-19 21:07:06 +02:00
Viktor De Pasquale fcbf56e93a Added superuser screen implementation
* partially
2019-10-18 19:38:55 +02:00