Tweaks, issues, and how to find them.
Added 2020-03-02 03:47:25 +0000 UTCToday I made a thread on Twitter. I should've just done it here so I will explain in more here as I have the freedom to type as much as I want :) Please check out the twitter thread before reading.
Twitter thread.
The summary of the post is that users are unaware of why tweaks conflict with each other and how to find out what is conflicting.
What does this post cover
In this post I will go through an example of two tweaks that conflict with each other and explain how to use iCleaner to find this issue.
The issue:
When Springtomize is enabled LockPlus doesn't show.
Background
I know the issue and it's because Springtomize is removing the camera from the lock screen. I created this conflict myself when I added support another tweak HideToday13.
How to find this issue yourself with iCleaner
1. Install iCleaner Pro from its repo. (please google as it might change) Dev's Twitter
2. Open iCleaner and click the plus button in the bottom left.
3. Click Cydia Substrate Addons.
4. Disable everything with a blue toggle, except the tweak you think you have an issue with. In this case LockPlus.
5. Respring and see if your previous issue still exists.
6. If the tweak works as should go back to iCleaner and enable tweaks one at a time.
This is process of elimination. We don't know what's causing the issue so we take all the variables away. Then add them back one at a time.
In this case you would find the issue the same way. Disable all tweaks. Some users say "I removed all lock screen tweaks." This is not a good way to think about it. Almost all tweaks hook springboard. Something that changes the switcher could also effect something on the lock screen. Once you found that springtomize and lockplus conflict that's not all you can do. Maybe it's just 1 setting in springtomize conflicting. In this case I would go to springtomize and check it's settings.
LockPlus/Springtomize conflict
I said I created this conflict, why would I do that? Easy I didn't do it on purpose. I also added more issues by trying to support HideToday13 and will explain those as well.
LockPlus adds a view to the lock screen. It does this without messing with the stock windows. It adds a view to the scrollview. The scrollview contains the today view, main view, and the camera.
When users reported that LockPlus didn't work with HideToday13 I knew exactly what it was. Since the today view was removed from the scrollview the scrollview width was now smaller than stock iOS.
If you have an iPX then the scrollview is 375 * 3 the 375 is the width of your screen, and the 3 comes from the 3 views. TodayView, MainView, and Camera.
LockPlus would get the size of your screen, then move its view that much over. If I add it without moving it over it would be on the today view. So I move it over 375 which display LockPlus on your main view where you want it.
So what happens if a tweak is made to remove the today view completely from iOS? LockPlus still is moved over because it doesn't know someone removed this view. Therefore it will not show in the correct place.
I thought about not even fixing this issue tbh. In LockPlus itself it has the option to stop the today view from showing. It does not delete the Today view as I think that could cause other issues, like iOS trying to make it and a tweak that keeps removing it. This could happen very easily.
Anyway to fix this conflict I check the width of the scrollview is less than 375*3 (of course this changes per device and I don't use 375 in code. I use the device width) if it is that means a user has removed a screen that stock iOS has.
In doing this I broke something else. Phones that are in Arabic flip the screen horizontally. So their camera is on the left, and today view is on the right.
When I checked if the scrollview width was less then it should be I would place to view to 0. As I assumed the today view was removed. It now would place the LockPlus view on the camera view.
To fix this I checked if iOS was setting the device DirectionRightToLeft. I could then adjust accordingly.
After this comes an issue with Springtomize. After all that yes still issues. Springtomize removes the camera view. Again scrollview has the wrong sizes and LockPlus is yet again placing its view on another screen.
The solution? Go to springtomize and don't remove the camera. I'm even thinking of removing all the code I added to support HideToday13 and just removing it if someone installs LockPlus.
As mentioned with one toggle in LockPlus you can hide the camera and today view without messing up anything. How do I do this? I don't remove anything. I simply tell the scrollview to not scroll. Therefore the user tries to access today view or camera and they think it's gone. It's really not gone, i'm just stopping the scrollview.
Why I think removing views could be bad (opinion).
Besides the whole explanation above, it's very hard to know if iOS is checking if this view is added. It knows it should add this view and does so, but if a tweak removes it, iOS still thinks it's there. I'm sure developers will say but the method that says showTodayView (I made that up) I make sure it returns NO.
Cool that's what you should do, but how are you 100% sure that iOS isn't checking that somewhere else and there is code that is continually running because you removed this view? This is a little tougher to find out so I try to not remove anything totally.
When I make a tweak I tread lightly. I try not to remove things from stock iOS and try to keep it as stock as possible. I could easily make LockPlus where it never has an issue showing, but that means I add a new window and jack up everything. PullOver is a tweak that does this, the goal is quick access to apps on the home screen. It creates a window on the lock screen and makes it the keyWindow. By doing this any tweak that wants the originial window will not get it through stock methods because PullOver hijacked it and added its own. The window isn't even visible on the lock screen. It only shows on the home screen but places the window, displays on both and is now considered the keyWindow. Which it isn't.
Hopefully these examples explain a little more on why tweaks conflict. These don't even scratch the surface when it comes to conflicts. Just be aware they happen and are a thing before you blame a developer for their tweak not working on your device.
If you have questions put them below I will try to answer them.
Oh yea :) If you email, message, or whatever a dev. Include the device and firmware. If you email from Cydia, it will include it for you.
Comments
Thank you for the support and glad it made some kind of sense:)
JunesiPhone
2020-03-02 04:26:53 +0000 UTCThis was an amazing, easy to understand, and enjoyable read! I feel like I actually learned a couple things here today! Just became a patron earlier today and already worth every penny!!! Your tweaks work flawlessly on my 11! Thank you!!!
Alexander
2020-03-02 04:10:18 +0000 UTC