Giter Club home page Giter Club logo

snake's Introduction

Snake

🐍 Snake, Yet Another Mach-O Unused ObjC Selector/Class/Protocol Detector.

ObjC Metadata

  • Classes ✔
  • Protocols ✔
  • Methods ✔
  • Categories ✔
  • Binding Info ✔
  • ObjC-Specific Sections
    • __objc_selrefs
    • __objc_superrefs
    • __objc_classrefs
    • __objc_classlist
    • __objc_catlist
    • __objc_protolist

See SnakeKit

Features

  • Parse Mach-O directly, no Symbols option required in Strip style of Build Settings, no depends on otool.
  • Unused selectors.
  • Unsued classes.
  • Unused protocols.
  • Duplicate selectors.
  • Selector/Classes/Protocols sort by library, and selector size, if Linkmap file provided.
  • Fast, a 460.6M binary and a 134.3M linkmap file costs 1.62s(3.7 GHz 6-Core Intel Core i5;40 GB 2667 MHz DDR4).

Homebrew

brew tap flexih/tap && brew install snake

How To Use

Usage:
  snake [-dscp] [-l path] path/to/binary ...

  -s, --selector     Unused selectors
  -c, --class        Unused classes
  -p, --protocol     Unused protocoles
  -d, --duplicate    Duplicate selectors
  -l, --linkmap arg  Linkmap file, which has selector size, library name
  -j, --json         Output json format
      --help         Print help

snake -l path/to/linkmap path/to/binary [-dscp]

Example

bin/snake -l demo/release/demo-LinkMap-normal-x86_64.txt demo/release/demo.app/demo -c

Total Lib Count: 1
Total Unused Class Count: 3

# demo

SceneDelegate
UnusedClass
ViewController

bin/snake -l demo/release/demo-LinkMap-normal-x86_64.txt demo/release/demo.app/demo -s

Total Lib Count: 1
Total Class Count: 2
Total Unused Selector: 2

# demo

@ UnusedClass
-[UnusedClass unusedMethOfUnusedClass]  6

@ UsedClass
-[UsedClass unusedMeth] 6

Storyboard

Used selectors

python2 storyboard.py path/to/x.storyboard

Source

git clone --recursive https://github.com/flexih/Snake.git

Details

Objective-C二进制瘦身

Credits

snake's People

Contributors

flexih avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.