mirror of
https://github.com/Gh0stByte/Bkstg-Plus
synced 2025-07-01 20:16:46 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
e696020a1f | |||
3415c0f6f7 | |||
7871aa6f8d |
11
README.md
11
README.md
@ -30,11 +30,18 @@ To save videos: Triple tap on them and select "Save Video"
|
||||
|
||||
## History
|
||||
|
||||
TODO: Write history
|
||||
#### 1.0.2
|
||||
* Fix ability to save Profile Pictures
|
||||
|
||||
#### 1.0.1
|
||||
* Fix ability to save Poll images
|
||||
|
||||
#### 1.0.0
|
||||
* Initial Release
|
||||
|
||||
## Credits
|
||||
|
||||
Made by Gh0stByte
|
||||
Made by [Gh0stByte](http://twitter.com/Gh0stByte)
|
||||
|
||||
Suggestion by /u/marcelre
|
||||
|
||||
|
264
Tweak.xm
264
Tweak.xm
@ -35,240 +35,134 @@
|
||||
@property (assign, nonatomic) FLImageView *photoView;
|
||||
@end
|
||||
|
||||
%hook FLHubPhotoViewController
|
||||
|
||||
-(void)viewDidLoad
|
||||
{
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]
|
||||
initWithTarget:self
|
||||
action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = 1.5;
|
||||
[self.view addGestureRecognizer:longPress];
|
||||
%orig;
|
||||
}
|
||||
|
||||
%new
|
||||
-(void)handleLongPress:(UILongPressGestureRecognizer *)sender
|
||||
{
|
||||
UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
|
||||
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
|
||||
|
||||
// Cancel button tappped.
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
}]];
|
||||
|
||||
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Save Image" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
||||
|
||||
UIImage *snapshot = self.imageView.originalImage;
|
||||
|
||||
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^
|
||||
{
|
||||
PHAssetChangeRequest *changeRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:snapshot];
|
||||
changeRequest.creationDate = [NSDate date];
|
||||
}
|
||||
completionHandler:^(BOOL success, NSError *error)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
NSLog(@"successfully saved");
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"error saving to photos: %@", error);
|
||||
}
|
||||
}];
|
||||
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
}]];
|
||||
|
||||
// Present action sheet.
|
||||
[self presentViewController:actionSheet animated:YES completion:nil];
|
||||
}
|
||||
|
||||
%end
|
||||
|
||||
@interface FLFullScreenPhotoViewController : UIViewController
|
||||
@property (assign, nonatomic) UIImageView *imageView;
|
||||
@end
|
||||
|
||||
@interface FLPhotoDetailViewController : UIViewController
|
||||
@property (assign, nonatomic) FLImageView *photoView;
|
||||
@end
|
||||
|
||||
|
||||
// Save Image with UIImage and the Controller
|
||||
inline void requestSaveImage(UIImage *snapshot, UIViewController *sender) {
|
||||
|
||||
UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
|
||||
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
|
||||
[sender dismissViewControllerAnimated:YES completion:^{ }]; }]];
|
||||
|
||||
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Save Image" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
||||
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^
|
||||
{
|
||||
PHAssetChangeRequest *changeRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:snapshot];
|
||||
changeRequest.creationDate = [NSDate date];
|
||||
}
|
||||
completionHandler:^(BOOL success, NSError *error)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
NSLog(@"successfully saved");
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"error saving to photos: %@", error);
|
||||
}
|
||||
}];
|
||||
|
||||
[sender dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
}]];
|
||||
[sender presentViewController:actionSheet animated:YES completion:nil];
|
||||
}
|
||||
|
||||
#define SETUP_LONGPRESS_ONCONTROLLER UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; longPress.minimumPressDuration = 1.5; [self.view addGestureRecognizer:longPress];
|
||||
|
||||
// Media tab images
|
||||
%hook FLHubPhotoViewController
|
||||
|
||||
-(void)viewDidLoad
|
||||
{
|
||||
SETUP_LONGPRESS_ONCONTROLLER
|
||||
%orig;
|
||||
}
|
||||
%new
|
||||
-(void)handleLongPress:(UILongPressGestureRecognizer *)sender
|
||||
{
|
||||
requestSaveImage(self.imageView.originalImage, self);
|
||||
}
|
||||
|
||||
%end
|
||||
|
||||
//Normal Timeline Photos
|
||||
%hook FLPhotoDetailViewController
|
||||
|
||||
-(void)viewDidLoad
|
||||
{
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]
|
||||
initWithTarget:self
|
||||
action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = 1.5;
|
||||
[self.view addGestureRecognizer:longPress];
|
||||
SETUP_LONGPRESS_ONCONTROLLER
|
||||
%orig;
|
||||
}
|
||||
|
||||
|
||||
|
||||
%new
|
||||
-(void)handleLongPress:(UILongPressGestureRecognizer *)sender
|
||||
{
|
||||
UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
|
||||
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
|
||||
|
||||
// Cancel button tappped.
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
}]];
|
||||
|
||||
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Save Image" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
||||
|
||||
UIImage *snapshot = [self.photoView image];
|
||||
|
||||
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^
|
||||
{
|
||||
PHAssetChangeRequest *changeRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:snapshot];
|
||||
changeRequest.creationDate = [NSDate date];
|
||||
}
|
||||
completionHandler:^(BOOL success, NSError *error)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
NSLog(@"successfully saved");
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"error saving to photos: %@", error);
|
||||
}
|
||||
}];
|
||||
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
}]];
|
||||
|
||||
// Present action sheet.
|
||||
[self presentViewController:actionSheet animated:YES completion:nil];
|
||||
requestSaveImage([self.photoView image], self);
|
||||
}
|
||||
|
||||
%end
|
||||
|
||||
//Collage Photos
|
||||
%hook FLCollageSinglePhotoViewController
|
||||
|
||||
-(void)viewDidLoad
|
||||
{
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]
|
||||
initWithTarget:self
|
||||
action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = 1.5;
|
||||
[self.view addGestureRecognizer:longPress];
|
||||
SETUP_LONGPRESS_ONCONTROLLER
|
||||
%orig;
|
||||
}
|
||||
|
||||
%new
|
||||
-(void)handleLongPress:(UILongPressGestureRecognizer *)sender
|
||||
{
|
||||
UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
|
||||
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
|
||||
|
||||
// Cancel button tappped.
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
}]];
|
||||
|
||||
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Save Image" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
||||
|
||||
UIImage *snapshot = self.photoView.photoView.originalImage;
|
||||
|
||||
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^
|
||||
{
|
||||
PHAssetChangeRequest *changeRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:snapshot];
|
||||
changeRequest.creationDate = [NSDate date];
|
||||
}
|
||||
completionHandler:^(BOOL success, NSError *error)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
NSLog(@"successfully saved");
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"error saving to photos: %@", error);
|
||||
}
|
||||
}];
|
||||
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
}]];
|
||||
|
||||
// Present action sheet.
|
||||
[self presentViewController:actionSheet animated:YES completion:nil];
|
||||
requestSaveImage(self.photoView.photoView.originalImage, self);
|
||||
}
|
||||
|
||||
%end
|
||||
|
||||
|
||||
//Poll Images
|
||||
%hook FLPollSinglePhotoViewController
|
||||
|
||||
-(void)viewDidLoad
|
||||
{
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]
|
||||
initWithTarget:self
|
||||
action:@selector(handleLongPress:)];
|
||||
longPress.minimumPressDuration = 1.5;
|
||||
[self.view addGestureRecognizer:longPress];
|
||||
SETUP_LONGPRESS_ONCONTROLLER
|
||||
%orig;
|
||||
}
|
||||
|
||||
%new
|
||||
-(void)handleLongPress:(UILongPressGestureRecognizer *)sender
|
||||
{
|
||||
UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
|
||||
|
||||
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
|
||||
|
||||
// Cancel button tappped.
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
}]];
|
||||
|
||||
[actionSheet addAction:[UIAlertAction actionWithTitle:@"Save Image" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
||||
|
||||
UIImage *snapshot = self.photoView.originalImage;
|
||||
|
||||
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^
|
||||
{
|
||||
PHAssetChangeRequest *changeRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:snapshot];
|
||||
changeRequest.creationDate = [NSDate date];
|
||||
}
|
||||
completionHandler:^(BOOL success, NSError *error)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
NSLog(@"successfully saved");
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"error saving to photos: %@", error);
|
||||
}
|
||||
}];
|
||||
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
}];
|
||||
}]];
|
||||
|
||||
// Present action sheet.
|
||||
[self presentViewController:actionSheet animated:YES completion:nil];
|
||||
requestSaveImage(self.photoView.originalImage, self);
|
||||
}
|
||||
|
||||
%end
|
||||
|
||||
// IGNORE ABOVE. SAVES IMAGES
|
||||
//FLAVPlayerLayerView
|
||||
//FLHubVideoCollection
|
||||
//FLVideoContentHolderVIew
|
||||
//Profile Pictures
|
||||
%hook FLFullScreenPhotoViewController
|
||||
|
||||
-(void)viewDidLoad
|
||||
{
|
||||
SETUP_LONGPRESS_ONCONTROLLER
|
||||
%orig;
|
||||
}
|
||||
|
||||
%new
|
||||
-(void)handleLongPress:(UILongPressGestureRecognizer *)sender
|
||||
{
|
||||
requestSaveImage(self.imageView.image, self);
|
||||
}
|
||||
|
||||
%end
|
||||
|
||||
//Saves Videos
|
||||
%hook FLPostCollectionViewCell
|
||||
|
||||
-(void)setPostView:(FLBaseContentHolderView *)holderView
|
||||
|
2
control
2
control
@ -1,7 +1,7 @@
|
||||
Package: gg.gh0stbyte.bkstg
|
||||
Name: Bkstg Plus
|
||||
Depends: mobilesubstrate
|
||||
Version: 1.0.0
|
||||
Version: 1.0.2
|
||||
Architecture: iphoneos-arm
|
||||
Description: Save Media from Bkstg
|
||||
Download photos & videos using this tweak. This tweak was suggested by /u/marcelre.
|
||||
|
BIN
gg.gh0stbyte.bkstg_1.0.0_iphoneos-arm.deb
Normal file
BIN
gg.gh0stbyte.bkstg_1.0.0_iphoneos-arm.deb
Normal file
Binary file not shown.
BIN
gg.gh0stbyte.bkstg_1.0.2_iphoneos-arm.deb
Normal file
BIN
gg.gh0stbyte.bkstg_1.0.2_iphoneos-arm.deb
Normal file
Binary file not shown.
Reference in New Issue
Block a user