Closed 54m4d closed 1 year ago
I get the same error I've tried a couple different versions of TikTok
Are you patching with Manager, or with command line tools?
Edit: the stack trace shows it's Flutter, so it's patched with Manager.
Manager v1.6.1
I've never succeeded in patching TikTok before, even with older Manager/TikTok versions, but today i decided to open the issue.
File a bug report in Manager repository, it might be an issue with Manager not allocating enough memory to the patcher. Or there's a chance it's something going haywire during the patcher decoding and it's blowing out the device memory limit.
For now you can patch using command line tools, but you'll probably also have to include the -Xmx
flag with a max memory value (ie: -Xmx2048M
)
I saw this comment there, so prolly not a Manager issue if that person is right.
yea it don't work with manager android13- pixel5 6gb ram , have to use the cli with revanced-patches jar and revanced-integrations apk instead, make sure to use an other java version (i'm using openjdk-18) if you see the error
org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$BCKeyStoreException: java.io.IOException: Error initialising store of key store: java.lang.SecurityException: JCE cannot authenticate the provider BC
while signing the apk with the cli
Hi, I solved it by using the CLI, you can read this Reddit thread for a guide
I'm a Manager user.
This issue should be moved to Manager repository. This issue only shows up when patching with Manager.
Manager already has android:largeHeap="true"
set.
But perhaps the Flutter/Dart settings can be adjusted? I've never used Flutter or Dart so I can't comment on this much. Maybe this is the fix?
This issue should be moved to Manager repository. This issue only shows up when patching with Manager.
Manager already has
android:largeHeap="true"
set.But perhaps the Flutter/Dart settings can be adjusted? I've never used Flutter or Dart so I can't comment on this much. Maybe this is the fix?
I don't think anything can be done. The problem is caused by the Android runtime not giving us enough java heap memory. Dart memory allocations don't contribute to that limit if I understand things correctly. People who run into this have to use the CLI in Termux instead, which does not have this memory limit.
The OOM stack trace here shows the max heap is set to a modest 512MB (some users have shown OOM at 256MB), which seems small if the maxheap flag is being applied to the patching process.
If Dart does not contribute to the heap memory of the android app, then it must be running on its own process/service or some other memory isolation. That means it might be possible to increase the max memory of that process/service.
If this truly cannot be fixed, then maybe the OOM can be caught and the user informed that Manager won't work and CLI is required.
You guys need to agree if this is a Manager issue or not, as you may have seen, oSumAtrIX mentioned that it's not related to the Manager, but at least they gave a comment before closing that issue.
If CLI is the only way to patch this, TikTok patches may be temporarily or permanently disabled in the Manager, with users being informed to use the CLI instead, in order to avoid confusion.
There is no such thing as "Disabling" patches. TikTok can be patched on ReVanced Manager if you have enough memory, but the issue is inherently large memory usage due to dexlib2. ReVanced Manager can fix it by increasing max memory usage.
Fixed in Manager v1.7.0
Not sure how it was fixed when 1.7.0 has no patcher or memory related changes, but oh well 🤷🏼♂️
There is no such thing as "Disabling" patches. TikTok can be patched on ReVanced Manager if you have enough memory, but the issue is inherently large memory usage due to dexlib2. ReVanced Manager can fix it by increasing max memory usage.
We already did and its still not enough for some devices
I have tried the exact same process i tried with the previous Manager and i got no issues now, i have also tested with the version of TikTok where this issue appeared and i got no memory errors, It's fair to say Manager v1.7.0 fixed the memory issue.
When patching using Termux, it doesn't have these memory limitations. And it's a regular android app, and it even has the memory overhead of running a full Linux system (which surely uses more memory than the ReVanced Manager UI).
Yet Termux has no OOM problems. For reference, Java command line in Termux shows a max heap memory of 1.8GB. Meanwhile the patcher in Flutter Manager is blowing out at 256 or 512MB.
Termux does not run an entire operating system. It just launches linux processes. Only dalvik code running in ART is subjected to the problematic java heap limit. It does not apply when running the JRE in Termux.
I believe i spoke a bit too soon. When i tried an older version of TikTok, i encountered a different error unrelated to memory issues.
The suggested version of Tiktok for patching should not be set as "All," as some versions work just fine, like 30.7.4
while others can throw errors like the one below, re-opening this issue since ReVanced Patches do not work properly with TikTok.
Initializing installer
Creating working directory
Copying original apk
Unpacking input apk
Reading dex files
Decoding AndroidManifest.xml only, because resources are not needed
Merging integrations
Executing patches
Failed to apply Downloads: 'Downloads' depends on 'Settings' but the following error was raised: Failed to resolve SettingsEntryFingerprint
Failed to apply Feed filter: 'Feed filter' depends on 'Settings' but the following error was raised: 'Settings' did not succeed previously
Applied Hide ads
Failed to apply Playback speed: NullPointerException
Failed to apply Settings: 'Settings' did not succeed previously
Failed to apply Sim spoof: 'Sim spoof' depends on 'Settings' but the following error was raised: 'Settings' did not succeed previously
Repacking patched apk
Not compiling resources because resource patching is not required
Writing modified dex files
Finished!
This is not a patch issue. There is simply not enough RAM provided to patch the app on your end.
So enough RAM is only provided to certain TikTok apks but not others, is that what you are trying to say?
In the last error, how can you tell if enough RAM was not provided?
Enough RAM is needed to patch TikTok. The last error is a product of patching an old version.
Forget the memory issue now, it has been addressed in Manager v1.7.0. and i tested and got no memory errors.
The last issue is not related to memory and the suggested version of Tiktok for patching is set to"All," so i don't understand why you mention "old version"? read my posts once again, you seem like you have a hard time distinguishing between a memory issue and something else, please re-open this issue.
@Axelen123 Can you confirm if this is a Manager issue or not?
Can you confirm if this is a Manager issue or not?
Long answer:
The memory issue is caused by the android app runtime (ART) not giving the patcher enough java heap memory. The only way to affect how much memory you are provided is to set the android:largeHeap
attribute in the manifest, but we have already done that. The CLI is unaffected because it does not run in ART unlike manager.
Short answer: I would say this is a manager issue, but we cannot do anything about it.
If you are having another problem then you need to open a new issue so it can be tracked properly.
Type
Error while patching
Bug description
Getting this error while patching TikTok 30.7.2
Steps to reproduce
Just try to patch TikTok as any other app.
Relevant log output
Screenshots or videos
N/A
Solution
N/A
Additional context
No special context.
Invalidly closing the issue is not acceptable.
Acknowledgements