12. februar 2016

[Source] Spotify hack for iOS (Mobile Substrate)

I no longer develop my own spotify hack called SpotiHack so i share my source code

FULL SOURCE CODE DOWNLOAD NOW AVALIABLE!:
You can use my source code to update the tweak, compile it and install it. don't forget to go to settings and enable the hacks:)

Source code preview:
tweak.xm

#import <Foundation/Foundation.h>
#define PLIST_PATH @"/var/mobile/Library/Preferences/spotihacks.plist"

inline bool GetPrefBool(NSString *key)
{
return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}

//---------- Allow seeking ----------//
%hook SPTPlayerRestrictions
-(bool)disallowSeeking
{
        if(GetPrefBool(@"kSeeking")) //1 seeking
        {
               return false;
        }
        return %orig;
}

-(id)disallowSeekingReasons
{
        return NULL;
}

//---------- Allow skipping ----------//
-(id)disallowSkippingToNextTrackReasons
{
        if(GetPrefBool(@"kSkipping")) //2 skipping
        {
               return NULL;
        }
        return %orig;
}

-(id)disallowSkippingToPreviousTrackReasons
{
        if(GetPrefBool(@"kSkipping")) //2 skipping
        {
               return NULL;
        }
        return %orig;
}

-(void)setDisallowSkippingToPreviousTrackReasons:(id)fp8
{
        if(GetPrefBool(@"kSkipping")) //2 skipping
        {
               fp8 = NULL;
        }
        %orig(fp8);
}

//---------- Allow peeking ----------//
-(bool)disallowPeekingAtNextTrack
{
        if(GetPrefBool(@"kPeeking")) //5 Peeking
        {
               return false;
        }
        return %orig;
}

-(id)disallowPeekingAtNextTrackReasons
{
        if(GetPrefBool(@"kPeeking")) //5 Peeking
        {
               return NULL;
        }
        return %orig;
}

//---------- Allow TogglingShuffle ----------//
-(bool)disallowTogglingShuffle
{
        if(GetPrefBool(@"kTogglingShuffle")) //3 TogglingShuffle
        {
               return false;
        }
        return %orig;
}

-(id)disallowTogglingShuffleReasons
{
        if(GetPrefBool(@"kTogglingShuffle")) //3 TogglingShuffle
        {
               return NULL;
        }
        return %orig;
}
%end

%hook SPTNowPlayingModel
-(bool)disallowTogglingShuffle
{
        if(GetPrefBool(@"kTogglingShuffle")) //3 TogglingShuffle
        {
               return false;
        }
        return %orig;
}
       
//---------- Allow peeking ----------//
-(bool)disallowPeekingAtNextTrack
{
        if(GetPrefBool(@"kPeeking")) //5 Peeking
        {
               return false;
        }
        return %orig;
}
%end

//---------- Allow seeking 2 ----------//
%hook SPTNowPlayingTrackPosition
-(bool)disallowSeeking
{
        if(GetPrefBool(@"kSeeking")) //1 seeking
        {
               return false;
        }
        return %orig;
}
%end

//---------- Disable Shuffle ----------//
%hook ShuffleFeatureImplementation
-(id)baseUI
{
        if(GetPrefBool(@"kNoShuffle")) //4 NoShuffle
        {
               return NULL;
        }
        return %orig;
}
%end

%hook SPTActionButton
-(void)setFrame:(CGRect)fp8
{
        if(GetPrefBool(@"kNoShuffle")) //4 NoShuffle
        {
              
        }
        %orig;
}
%end

//---------- No ads ----------//
%hook FBAdView
-(void)setFrame:(CGRect)fp8
{
}
%end

%hook AdController
-(void)playAdFromLink:(id)fp8
{
        fp8 = NULL;
        %orig(fp8);
}
%end

%hook SPTAdsManager
-(void)adsViewModel:(id)arg1 shouldPlayAds:(bool)arg2
{
        arg1 = NULL;
        arg2 = false;
}
%end

//---------- No jailbreak detection ----------//
%hook MATTracker
-(bool)shouldDetectJailbroken
{
        return false;
}
%end

%hook CSComScore
+(bool)isJailbroken
{
        return false;
}
%end

%hook CSCore
+(bool)isJailBroken
{
        return false;
}
%end

%hook GADDevice
+(bool)isJailbroken
{
        return false;
}
%end

info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>entry</key>
        <dict>
               <key>cell</key>
               <string>PSLinkCell</string>
               <key>icon</key>
               <string>icon.png</string>
               <key>label</key>
               <string>SpotiHacks (Spotify 2.2.0)</string>
        </dict>
        <key>items</key>
        <array>
        <dict>
                       <key>cell</key>
                       <string>PSGroupCell</string>
                       <key>label</key>
                       <string>Allow you to seeking</string>   
               </dict>
               <dict>
                       <key>cell</key>
                       <string>PSSwitchCell</string>
                       <key>default</key>
                       <false/>
                       <key>defaults</key>
                       <string>spotihacks</string>      
                       <key>key</key>
                       <string>kSeeking</string>     
                       <key>label</key>
                       <string>Enable seeking</string>      
               </dict>
               <dict>
                       <key>cell</key>
                       <string>PSGroupCell</string>
                       <key>label</key>
                       <string>Skip music</string>   
               </dict>
               <dict>
                       <key>cell</key>
                       <string>PSSwitchCell</string>
                       <key>default</key>
                       <false/>
                       <key>defaults</key>
                       <string>spotihacks</string>      
                       <key>key</key>
                       <string>kSkipping</string>     
                       <key>label</key>
                       <string>Enable skipping</string>      
               </dict>
               <dict>
                       <key>cell</key>
                       <string>PSGroupCell</string>
                       <key>label</key>
                       <string>Can Toggling Shuffle</string>   
               </dict>
               <dict>
                       <key>cell</key>
                       <string>PSSwitchCell</string>
                       <key>default</key>
                       <false/>
                       <key>defaults</key>
                       <string>spotihacks</string>      
                       <key>key</key>
                       <string>kTogglingShuffle</string>     
                       <key>label</key>
                       <string>Enable Toggling Shuffle</string>      
               </dict>
               <dict>
                       <key>cell</key>
                       <string>PSGroupCell</string>
                       <key>label</key>
                       <string>Disable Shuffle if you don't like it</string>   
               </dict>
               <dict>
                       <key>cell</key>
                       <string>PSSwitchCell</string>
                       <key>default</key>
                       <false/>
                       <key>defaults</key>
                       <string>spotihacks</string>      
                       <key>key</key>
                       <string>kNoShuffle</string>     
                       <key>label</key>
                       <string>No Shuffle</string>      
               </dict>
               <dict>
                       <key>cell</key>
                       <string>PSGroupCell</string>
                       <key>label</key>
                       <string>Allow you to peeking</string>   
               </dict>
               <dict>
                       <key>cell</key>
                       <string>PSSwitchCell</string>
                       <key>default</key>
                       <false/>
                       <key>defaults</key>
                       <string>spotihacks</string>      
                       <key>key</key>
                       <string>kPeeking</string>     
                       <key>label</key>
                       <string>Enable peeking</string>      
               </dict>
               <dict>
                       <key>cell</key>
                       <string>PSGroupCell</string>
                       <key>label</key>
                       <string>After you apply settings, please respring your device.</string>   
               </dict>
               <dict>
        <key>cell</key>
        <string>PSButtonCell</string>
        <key>label</key>
        <string>Respring</string>
        <key>action</key>
        <string>respring</string>
               </dict>
               <dict>
                       <key>action</key>
                       <string>link</string>
                       <key>cell</key>
                       <string>PSButtonCell</string>
                       <key>icon</key>
                       <string>iOSGods.png</string>
                       <key>label</key>
                       <string>Visit iOSgods</string>
               </dict>
               <dict>
                       <key>cell</key>
                       <string>PSGroupCell</string>
                       <key>footerText</key>
                       <string>Brought to you by evildog1 - iosgods.com</string>
               </dict>
              
        </array>
        <key>title</key>
        <string>SpotiHacks (Spotify 2.2.0)</string>
</dict>
</plist>


0 kommentarer:

Send en kommentar