Skip to content

Commit

Permalink
Merge pull request #20 from mosquez/master
Browse files Browse the repository at this point in the history
update to Snapchat 12.26.0.20
  • Loading branch information
RevealedSoulEven authored Mar 28, 2023
2 parents 26e4efa + 9ec691e commit 137883a
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 149 deletions.
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
<h4 align="center">Simple to use Xposed module for Snapchat 👻</h4>

<p align="center">
<a href="https://github.com/RevealedSoulEven/Snapmod-new/releases">
<img src="https://img.shields.io/github/v/release/RevealedSoulEven/Snapmod-new?style=for-the-badge"></a>
<a href="https://github.com/RevealedSoulEven/Snapmod-new/releases"><img src="https://img.shields.io/github/downloads/RevealedSoulEven/Snapmod-new/total?style=for-the-badge"></a>
<a href="https://github.com/RevealedSoulEven/Snapmod-new/stargazers">
<img src="https://img.shields.io/github/stars/RevealedSoulEven/Snapmod-new?style=for-the-badge"></a>
<a href="#donate">
<img src="https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&amp;style=for-the-badge">
</a>
<a href="https://github.com/mosquez/Snapmod-new/releases">
<img src="https://img.shields.io/github/v/release/mosquez/Snapmod-new?style=for-the-badge"></a>
<a href="https://github.com/mosquez/Snapmod-new/releases"><img src="https://img.shields.io/github/downloads/mosquez/Snapmod-new/total?style=for-the-badge"></a>
<a href="https://github.com/mosquez/Snapmod-new/stargazers">
<img src="https://img.shields.io/github/stars/mosquez/Snapmod-new?style=for-the-badge"></a>
</p>

<p align="center">
Expand All @@ -30,7 +27,7 @@
To use this Xposed module, you'll need a rooted or a non-rooted phone (😱).

## For both
* Please install a supported Snapchat version ([APKMirror](https://www.apkmirror.com/apk/snap-inc/snapchat/snapchat-12-02-1-33-release/snapchat-12-02-1-33-2-android-apk-download/) for example), currently the supported one is **12.02.1.33** for SnapMod 1.8.7. We do not offer official (You might get in GitHub issues) support for versions that are behind either one.
* Please install a supported Snapchat version ([APKMirror](https://www.apkmirror.com/apk/snap-inc/snapchat/snapchat-12-26-0-20-release/snapchat-12-26-0-20-2-android-apk-download/) for example), currently the supported one is **12.26.0.20** for SnapMod 1.8.8. We do not offer official (You might get in GitHub issues) support for versions that are behind either one.
* > **Note** If you are an android developer or something similar, you can create mappings yourself that might work for higher/lower Snapchat versions. You can follow the steps in `.github/workflows`
* > **Note** If you have obtained custom mappings, move them in `/(Android|data)/data/xyz.rodit.snapmod/files/[build].json`. Build numbers you can obtain from APKMirror, if they are not provided. With a good file explorer (Like MiXplorer or File Manager Plus) non-rooted users can do this as well.
Expand All @@ -43,7 +40,7 @@ To use this Xposed module, you'll need a rooted or a non-rooted phone (😱).

## Installation for non-rooted users (Advanced)
1. Download and install [LSPatch](https://github.com/LSPosed/LSPatch) and [Shizuku](https://github.com/RikkaApps/Shizuku)
2. Download and install [app-release.apk](https://github.com/RevealedSoulEven/Snapmod-new/releases/download/v1.8.5/app-release.apk) from latest release
2. Download and install [app-release.apk](https://github.com/mosquez/SnapMod-new/releases/download/1.8.8/app-debug.apk) from latest release
3. Turn on Shizuku and open LSPatch and go to the second tab from the left
4. Press the plus sign and search Snapchat and select it
5. Choose the the Patch Mode to be Portable
Expand All @@ -52,7 +49,7 @@ To use this Xposed module, you'll need a rooted or a non-rooted phone (😱).

## Installation for root users
1. Download and install [LSPosed Framework](https://github.com/LSPosed/LSPosed). We do not offer support for other Xposed implementatios although SnapMod would work fine with them.
2. Download and install [app-release.apk](https://github.com/RevealedSoulEven/Snapmod-new/releases/download/v1.8.5/app-release.apk) from latest release.
2. Download and install [app-release.apk](https://github.com/mosquez/SnapMod-new/releases/download/1.8.8/app-debug.apk) from latest release.
3. Enable SnapMod in LSPosed manager and close Snapchat completely.
5. Open SnapMod and verify that it says "Supported version". If it doesn't, please see <a href="#issues">Issues</a>

Expand Down Expand Up @@ -104,8 +101,3 @@ If you would like to support the deveploment of SnapMod, you can do it by donati
> **Note** These donations are not made to me, but to the original developer @rodit
* [PayPal](https://paypal.me/roditmod)
* [Cashapp](https://cash.app/rodit9)

## Crypto
- BTC: bc1qr06chdv85jf9v7ldf7l24lrgp6ad7av8y7jwyc
- ETH: 0x90659C0556b37107359FA32b40AA74c593590E04
- XRP: rDgNCbi4eCeczpzGHGs3XHsR5C3SyUCr5r
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
minSdk 24
targetSdk 32
versionCode 31
versionName '1.8.7'
versionName '1.8.8'

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -37,7 +37,7 @@ android {

task versionInfo {
doLast {
def build = 84641
def build = 84690
def infoFile = new File('app/build/version.json')
infoFile.getParentFile().mkdirs()
infoFile.delete()
Expand All @@ -53,7 +53,7 @@ dependencies {

implementation files('libs/snapmod.jar')
implementation 'androidx.preference:preference:1.2.0'
implementation 'xyz.rodit:xposed:1.4.4'
implementation files('libs/xposed-1.4.4-release.aar')

implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'io.noties.markwon:core:4.6.2'
Expand Down
Binary file modified app/libs/snapmod.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ abstract class ButtonOption(context: FeatureContext, name: String, private val t
return ActionMenuOptionItemViewModel(
textViewModel,
ActionMenuActionModel(arrayOf(action.instance)),
0,
null,
null,
null,
null,
false,
null,
ActionMenuOptionItemType.OPTION_ITEM()
ActionMenuOptionItemType.OPTION_ITEM(),
0
).instance
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package xyz.rodit.snapmod.features.chatmenu

import de.robv.android.xposed.XposedBridge
import xyz.rodit.snapmod.CustomResources.string.menu_option_anti_auto_save
import xyz.rodit.snapmod.CustomResources.string.menu_option_auto_download
import xyz.rodit.snapmod.CustomResources.string.menu_option_auto_save
import xyz.rodit.snapmod.CustomResources.string.menu_option_stealth_mode
import xyz.rodit.snapmod.CustomResources.string.menu_option_anti_auto_save
import xyz.rodit.snapmod.Shared
import xyz.rodit.snapmod.features.Feature
import xyz.rodit.snapmod.features.FeatureContext
import xyz.rodit.snapmod.mappings.FeedInfoHolder
import xyz.rodit.snapmod.mappings.FriendChatActionHandler
import xyz.rodit.snapmod.mappings.FriendChatActionMenuBuilder
import xyz.rodit.snapmod.mappings.RxSingleton
import xyz.rodit.snapmod.mappings.SendChatAction
import xyz.rodit.snapmod.util.after
import xyz.rodit.snapmod.util.before
Expand Down Expand Up @@ -48,13 +49,18 @@ class ChatMenuModifier(context: FeatureContext) : Feature(context) {

override fun performHooks() {
// Add plugin actions to chat action menu.
FriendChatActionMenuBuilder.build.after {
FriendChatActionMenuBuilder.call.after {
val self = FriendChatActionMenuBuilder.wrap(it.thisObject)
val key = self.feedInfoHolder.info.key
val options = RxSingleton.wrap(it.result).value as MutableList<Any>
if (!FeedInfoHolder.isInstance(self.feedInfoHolder) || it.result !is ArrayList<*>) return@after

val options = it.result as ArrayList<Any>
val key = FeedInfoHolder.wrap(self.feedInfoHolder).feedKey

val subOptions = plugins.values.filter(MenuPlugin::shouldCreate).map { p ->
p.createModel(key)
}

options.addAll(
plugins.values.filter(MenuPlugin::shouldCreate).map { p -> p.createModel(key) })
options.addAll(subOptions);
}

// Override plugin action events.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ class NewChatMenuModifier(context: FeatureContext) : Feature(context) {
}

override fun performHooks() {
// Force new chat action menu


// Add subsection
ProfileActionSheetCreator.apply.before {
if (it.args[0] !is List<*>) return@before
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package xyz.rodit.snapmod.features.chatmenu.shared

import android.app.AlertDialog
import android.util.Base64
import de.robv.android.xposed.XC_MethodHook
import xyz.rodit.snapmod.arroyo.followProtoString
import xyz.rodit.snapmod.createDummyProxy
import xyz.rodit.snapmod.features.FeatureContext
import xyz.rodit.snapmod.mappings.*
import xyz.rodit.snapmod.util.toSnapUUID
import xyz.rodit.snapmod.util.toUUIDString
import xyz.rodit.xposed.utils.StreamUtils
import java.io.File

fun previewChat(context: FeatureContext, key: String) {
val uuid = key.toSnapUUID()
Expand All @@ -24,9 +21,13 @@ fun previewChat(context: FeatureContext, key: String) {
DefaultFetchConversationCallback.onFetchConversationWithMessagesComplete
) { displayPreview(context, it) }


val fetchCallback = DefaultFetchConversationCallback(null, uuid, false);
fetchCallback.dummy = proxy

context.instances.conversationManager.fetchConversationWithMessages(
uuid,
DefaultFetchConversationCallback(proxy, uuid, false)
fetchCallback
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package xyz.rodit.snapmod.features.conversations
import xyz.rodit.snapmod.features.Feature
import xyz.rodit.snapmod.features.FeatureContext
import xyz.rodit.snapmod.logging.log
import xyz.rodit.snapmod.mappings.ArroyoConvertMessagesAction
import xyz.rodit.snapmod.mappings.ArroyoMessageListDataProvider
import xyz.rodit.snapmod.mappings.ChatCommandSource
import xyz.rodit.snapmod.mappings.Message
import xyz.rodit.snapmod.util.*
Expand All @@ -18,7 +18,7 @@ class AutoSave(context: FeatureContext) : Feature(context, 84608.toMax()) {
}

override fun performHooks() {
ArroyoConvertMessagesAction.apply.before {
ArroyoMessageListDataProvider.apply.before {
if (it.args[0] !is List<*>) return@before
if (context.instances.chatCommandsClient.isNull) {
log.debug("Cannot auto-save messages. Chat commands client was null.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ class SnapOverrides(context: FeatureContext) : Feature(context) {
null,
null,
null,
false
null,
false,
null,
0
)
snap.parameterPackage = paramPackage
content.message = MediaBaseBase.wrap(snap.instance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ChatSaving(context: FeatureContext) : Feature(context) {
base.context,
base.messageData,
base.senderId,
emptyMap<Any?, Any>(),
linkedMapOf<Any, Any>(),
true,
null,
true,
Expand All @@ -83,7 +83,9 @@ class ChatSaving(context: FeatureContext) : Feature(context) {
media,
null,
base.status,
true
true,
false,
null
).instance
}
ChatModelPlugin.isInstance(it.args[2]) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fun getMediaInfo(
return@getUsername callback(StoryMedia(OperaMediaInfo.wrap(it), username, ".jpg", map))
}

map[StoryMetadata.getVideoMediaInfo().instance]?.let {
map[StoryMetadata.getVideoMediaInfoList().instance]?.let {
mLog.debug("Found video media info for story.")
return@getUsername callback(StoryMedia(OperaMediaInfo.wrap(it), username, ".mp4", map))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ class BypassVideoLength(context: FeatureContext) : Feature(context) {
// Bypass video duration limit from gallery in chat.
MemoriesPickerVideoDurationConfig.constructors.before(
context, "bypass_video_length_restrictions"
) { it.args[0] = Long.MAX_VALUE }
) { it.args[1] = Long.MAX_VALUE; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package xyz.rodit.snapmod.features.tweaks

import xyz.rodit.snapmod.features.Feature
import xyz.rodit.snapmod.features.FeatureContext
import xyz.rodit.snapmod.mappings.CameraRollVideoLengthChecker
import xyz.rodit.snapmod.mappings.CameraRollMediaId
import xyz.rodit.snapmod.mappings.MediaPackage
import xyz.rodit.snapmod.mappings.VideoLengthChecker
import xyz.rodit.snapmod.util.after
Expand All @@ -28,11 +28,9 @@ class BypassVideoLengthGlobal(context: FeatureContext) : Feature(context, 84606.
MediaPackage.wrap(it.args[0]).media.videoDurationMs = lastVideoDuration
}

CameraRollVideoLengthChecker.isOver60Seconds.before(
context,
"bypass_video_length_restrictions"
) {
it.result = false
CameraRollMediaId.constructors.after(context, "bypass_video_length_restrictions") {
val mediaId = CameraRollMediaId.wrap(it.thisObject)
mediaId.durationMs = 60000L
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import java.lang.reflect.Proxy
class PinStories(context: FeatureContext) : Feature(context) {

override fun performHooks() {
//TODO: StoryViewModel Mapping

/*
DfSectionControllerActions.apply.before {
if (!DfSectionController.isInstance(DfSectionControllerActions.wrap(it.thisObject).sectionController)) return@before
Expand Down Expand Up @@ -45,5 +48,6 @@ class PinStories(context: FeatureContext) : Feature(context) {
data.dataModels = SnapIterable.wrap(iterableProxy)
}
*/
}
}
Loading

0 comments on commit 137883a

Please sign in to comment.