13-CF / afetch

Simple system info written in C
GNU General Public License v3.0
223 stars 39 forks source link

Seperated iOS and macOS #68

Closed Torrekie closed 3 years ago

Torrekie commented 3 years ago

iOS and macOS both returns "Darwin" when reading uname, so when running on iOS it outputs like that:

iPhone:~/proj/afetch mobile$ ./afetch 
ls: cannot access '/usr/local/Cellar/*': No such file or directory
          .:'          USER mobile
      __ :'__            OS macOS 14.2
   .'`__`-'__``.     KERNEL 20.1.0
  :__________.-'     UPTIME 1h 3m
  :_________:         SHELL sh
   :_________`-;       PKGS 0
    `.__.-.__.' 

For a jailbroken iOS device, APT is the default package manager, so I replaced getPkgCont to the same one that Debian/Ubuntu uses. This pr fixes the issue and it will work properly on iOS devices.

iPhone:~/proj/afetch mobile$ ./afetch
          .:'          USER mobile
      __ :'__            OS iOS 14.2
   .'`__`-'__``.     KERNEL 20.1.0
  :__________.-'     UPTIME 1h 47m
  :_________:         SHELL sh
   :_________`-;       PKGS 675
    `.__.-.__.' 
13-CF commented 3 years ago

This looks quite interesting, I tried compiling it when I my iPhone was jailbroken but I couldn't get it to work.

Did you have to install a package that includes the header files (and the C compiler)?

Torrekie commented 3 years ago

This looks quite interesting, I tried compiling it when I my iPhone was jailbroken but I couldn't get it to work.

Did you have to install a package that includes the header files (and the C compiler)?

I poured all the contents from an iPhoneOS sdk to the corresponding path in /usr so I could compile C/Cpp/ObjC codes on my device. And yes, C compilers can be found in Elucubratus or Procursus depending on which jailbreak tool are using

13-CF commented 3 years ago

This looks quite interesting, I tried compiling it when I my iPhone was jailbroken but I couldn't get it to work.

Did you have to install a package that includes the header files (and the C compiler)?

I poured all the contents from an iPhoneOS sdk to the corresponding path in /usr so I could compile C/Cpp/ObjC codes on my device.

And yes, C compilers can be found in Elucubratus or Procursus depending on which jailbreak tool are using

Cool, that's good to know for if I ever jailbreak my phone again. Thanks!