-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use AOSP Share Sheet for IntentResolver
- Loading branch information
1 parent
2c84dfd
commit cbbeb62
Showing
10 changed files
with
73 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/yifeplayte/wommo/hook/hooks/singlepackage/IntentResolver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.yifeplayte.wommo.hook.hooks.singlepackage | ||
|
||
import com.yifeplayte.wommo.hook.hooks.BasePackage | ||
|
||
@Suppress("unused") | ||
object IntentResolver : BasePackage("com.android.intentresolver") |
11 changes: 10 additions & 1 deletion
11
app/src/main/java/com/yifeplayte/wommo/hook/hooks/singlepackage/android/UseAOSPShareSheet.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
package com.yifeplayte.wommo.hook.hooks.singlepackage.android | ||
|
||
import android.provider.Settings | ||
import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass | ||
import com.github.kyuubiran.ezxhelper.EzXHelper.appContext | ||
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook | ||
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder | ||
import com.yifeplayte.wommo.hook.hooks.BaseHook | ||
import com.yifeplayte.wommo.utils.Build.HYPER_OS_VERSION | ||
|
||
@Suppress("unused") | ||
object UseAOSPShareSheet : BaseHook() { | ||
override val key = "use_aosp_share_sheet" | ||
override val isEnabled = (HYPER_OS_VERSION < 2) and super.isEnabled | ||
override fun hook() { | ||
loadClass("com.android.internal.app.ResolverActivityStubImpl").methodFinder() | ||
.filterByName("useAospShareSheet").single().createHook { | ||
returnConstant(true) | ||
before { | ||
it.result = Settings.System.getInt( | ||
appContext.contentResolver, | ||
"mishare_enabled" | ||
) != 1 | ||
} | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...in/java/com/yifeplayte/wommo/hook/hooks/singlepackage/intentresolver/UseAOSPShareSheet.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.yifeplayte.wommo.hook.hooks.singlepackage.intentresolver | ||
|
||
import android.provider.Settings | ||
import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass | ||
import com.github.kyuubiran.ezxhelper.EzXHelper.appContext | ||
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook | ||
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder | ||
import com.yifeplayte.wommo.hook.hooks.BaseHook | ||
import com.yifeplayte.wommo.utils.Build.HYPER_OS_VERSION | ||
|
||
@Suppress("unused") | ||
object UseAOSPShareSheet : BaseHook() { | ||
override val key = "use_aosp_share_sheet" | ||
override val isEnabled = (HYPER_OS_VERSION >= 2) and super.isEnabled | ||
override fun hook() { | ||
loadClass("com.android.intentresolver.ApplicationStubImpl").methodFinder() | ||
.filterByName("useAospVersion").single().createHook { | ||
before { | ||
it.result = Settings.System.getInt( | ||
appContext.contentResolver, | ||
"mishare_enabled" | ||
) != 1 | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters