Jump to content

nzzrin

Member
  • Posts

    19
  • Joined

  • Last visited

Posts posted by nzzrin

  1. #define kPath @"/var/mobile/Library/Preferences/YOUR_PLIST_NAME.plist"
    
    
    %hook targetClass
    -(bool)istargetmethodActive {
    NSDictionary *prefs=[[NSDictionary alloc] initWithContentsOfFile:kPath];
    %orig;
        if ([[prefs objectForKey:@"keyFromPlist"] boolValue]){
        return true;
        } else {
        return %orig;
      }
    }
    %end

     

    Thanks castix! It's working now!   xD

  2. Forgot to close out. Set another } at the end

     

    Thanks, code my code it's working now. But it seems I'm facing another problem. 

     

    Quote fro Stackoverflow

     

     

     

    If the key does not exist in the user defaults, the result of this method will be NO.

     

    I'm facing this issue now. I think /Library/PreferenceBundles/yourtweak.bundle/yourplistname.plist  can't be read by Preference.

  3. -(bool)istargetmethodActive{
    	
    	if ([[prefs objectForKey:@"keyFromPlist"] boolValue]){
    
    		return true;
    
    	} else {
    
    	return %orig;
    
    }
    %end
    

    Got this error while processing to package... 

    Tweak.xm:46: error: %end does not make sense inside a block
    
  4. istargetmethodActive is case sensitive, have you copied it correctly?

     

    Yes. I'm 100% sure and confident. I just want a simple workflow:

     

    1. User turn the switch OFF = The tweak is not working.

    2. User turn the switch ON = The tweak is working.

     

    Unfortunately, nothing seems to work according my plan.

  5. %hook targetClass
    -(bool)istargetmethodActive{
    	
    	if ([[prefs objectForKey:@"keyFromPlist"] boolValue]){
    
    		return true;
    
    	}
    
    	return %orig;
    
    }
    %end
    

    I've tried running and make countless changes but the results is still the same. The problem is, when I try On or Off my tweak via Preference (in Settings app), the code keep return %orig;

     

    Please help.

  6. Just copy paste the content, no need to upload it.

    
    ***BEFORE make package RUN***
    
    obj |  folder type
    theos | folder type
    control | file type
    Makefile | file type
    tinderplus.plist | file type
    Tweak.xm | file type 
    ***AFTER make package RUN***
    
    control.tar.gz
    data.tar.xz 
  7. Open your /theos/makefiles/package/deb.mk

     

    Edit Line 33 to this:

     

    $(ECHO_NOTHING)COPYFILE_DISABLE=1 $(FAKEROOT) -r dpkg-deb -Zgzip -b "$(THEOS_STAGING_DIR)" "$(_THEOS_DEB_PACKAGE_FILENAME)" $(STDERR_NULL_REDIRECT)$(ECHO_END)
    
    Recompile the deb and reinstall.

     

     

     

    Thanks for your tips, but I've got this error:

    bash-3.2# make package messages=yes
    
    Making all for tweak tinderplusmac...
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile --no-print-directory --no-keep-going \
    		internal-library-compile \
    		_THEOS_CURRENT_TYPE=tweak THEOS_CURRENT_INSTANCE=tinderplusmac _THEOS_CURRENT_OPERATION=compile \
    		THEOS_BUILD_DIR="." _THEOS_MAKE_PARALLEL=yes
    make[2]: Nothing to be done for `internal-library-compile'.
    rm -rf "/Users/Nazrin/tinderplusmac/.theos/_"
    /Users/Nazrin/tinderplusmac/theos/bin/fakeroot.sh -p "/Users/Nazrin/tinderplusmac/.theos/fakeroot" -c
    mkdir -p "/Users/Nazrin/tinderplusmac/.theos/_"
    [ -d layout ] && rsync -a "layout/" "/Users/Nazrin/tinderplusmac/.theos/_" --exclude "DEBIAN" --exclude "_MTN" --exclude ".git" --exclude ".svn" --exclude ".DS_Store" --exclude "._*" || true
    Making stage for tweak tinderplusmac...
    mkdir -p "/Users/Nazrin/tinderplusmac/.theos/_/Library/MobileSubstrate/DynamicLibraries/"
    cp ./.theos/obj/tinderplusmac.dylib "/Users/Nazrin/tinderplusmac/.theos/_/Library/MobileSubstrate/DynamicLibraries/"
    if [ -f tinderplusmac.plist ]; then cp tinderplusmac.plist "/Users/Nazrin/tinderplusmac/.theos/_/Library/MobileSubstrate/DynamicLibraries/"; fi
    mkdir -p "/Users/Nazrin/tinderplusmac/.theos/_/DEBIAN"
    sed -e '/^[Vv]ersion:/d' "/Users/Nazrin/tinderplusmac/control" > "/Users/Nazrin/tinderplusmac/.theos/_/DEBIAN/control"
    echo "Version: 5.0.1-4" >> "/Users/Nazrin/tinderplusmac/.theos/_/DEBIAN/control"
    echo "Installed-Size: 120" >> "/Users/Nazrin/tinderplusmac/.theos/_/DEBIAN/control"
    COPYFILE_DISABLE=1 /Users/Nazrin/tinderplusmac/theos/bin/fakeroot.sh -p "/Users/Nazrin/tinderplusmac/.theos/fakeroot" -r dpkg-deb —Zgzip -b "/Users/Nazrin/tinderplusmac/.theos/_" "./com.nazrin.tinderplusmac_5.0.1-4_iphoneos-arm.deb" 
    dpkg-deb: error: need an action option
    
    Type dpkg-deb --help for help about manipulating *.deb files;
    Type dpkg --help for help about installing and deinstalling packages.
    make: *** [internal-package] Error 2
    
  8. The picture is not working. Copy paste the output.

     

     

    Sorry I can't copy the error code from [/size]mobileterminal. But here's the i[/size]mage with the new host site. [/size]

     

     254dd36.png

     

     

    make package install: dpkg-deb: file `/tmp/_theos_install.deb' contains ununderstood data member data.tar.xz , giving up

  9. You are compiling /var/mobile/projects/tinder

    Try compiling a file from /var/mobile/tinder

    When making a project it should go to the second location, IDK why yours went to projects, I might be wrong

     

     

    It is because I put my tweak inside Projects folder.

     

    Tried to move and create the tweak inside /var/mobile but still no luck.

     

    Same error. Error 126, many suggesstions I've tried. Stuck with the same error. 

     
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines