SSH command to list installed application bundles on iOS7 - ios

I want to be able to find a list installed applications on an iOS 7 device using SSH. I have installed open to be able to launch them, but it requires the com.application.identifier bundle names to work. Is there some centralized place that lists these identifiers? If not, is there some command to extract them? I have been looking for hours, but I everything I have found is for older iOS versions and outdated.

I found my answer. I had to install Erica Utilities to get the plutil function. Then I just used find /User/Applications/ -name iTunesMetadata.plist -exec plutil -key softwareVersionBundleId {} \;

Related

Xcode build rules script "command not found" on M1

I have a project that runs some utility I've installed using homebrew on one of its build rules.
On my M1 mac, homebrew is installed on /opt/homebrew/bin.
I have eval "$(/opt/homebrew/bin/brew shellenv)" present in my ~/.zprofile file, but it seems like Xcode doesn't respect that (or maybe overrides it?).
When trying to evaluate the PATH variable during Xcode run script command I get the following:
PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/local/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/local/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
For clearance, this is the phase I was running, under Build rules.
I've managed to find two workarounds that work with this issue, the first is to symlink the program you want from /opt/homebrew/bin onto /usr/local/bin (protoc in my case)
sudo ln -s /opt/homebrew/bin/protoc /usr/local/bin/protoc
The second is to add the following line to the build rule script:
eval "$(/opt/homebrew/bin/brew shellenv)"
This has the disadvantage of not working on non M1 Macs.
There is a possible, very simple solution provided by this answer.
Basically, freshly upgraded versions of XCode (for example, 13.4.1) running on Apple Silicon-powered Macs (like my M1 MacBook Pro), have components that cannot properly use/output the appropriate object files in all the output platform combinations you need.
This leads to some "interesting" issues and error message cross-overs that find "almost correct" answers on StackOverflow. Hence the many suggestions to exclude "arm64" platform and similar from the build options.
The simple answer to all of that is... to just run XCode with Rosetta enabled. Rosetta will engage with the components that miss the needed cross-platform capabilities.
Here is an example of how to enable an application to use Rosetta. You select the app icon, then go to the File menu and select "Get Info". Then click the "Open using Rosetta" checkbox.

OTOOL alternate for linux

I have a reverse engineering set up on a Mac machine. This set up does some reverse engineering on iOS applications(.ipa files). I'm migrating the setup from Mac to a linux machine.
Currently on Mac, I'm using OTOOL on ipa binary files and using the following commands:
otool -L /iOS/binary/path
otool -lv /iOS/binary/path
otool -hv /iOS/binary/path
Now, I've to do the same operation, i.e reverse engineer the iOS applications, but now on the linux machine. AFAIK, OTOOL is not available for linux machine.
I've come across JTOOL which I think is most relevant till now. I can use it on linux, and it does something similar to OTOOL, but not exactly same. E.g. while using the -L command on JTOOL, I also need to specify architecture. However, OTOOL gives the shared libraries for all the available architectures.
I tried ldd, but I'm getting the error - "not a dynamic executable".
I tried objdump, but it asks for the object file.
I'm not sure which tool can I use. I to figure out the alternate tool which can do same as OTOOL. Or, if not same, then what changes do i need to make to use the alternate tool.

How to get UUID for apple binaries on Linux

I am trying to figure out how to get the UUID for a apple executable file while on Linux (EC2).
When on Mac, I can use the following line to get the UUID:
xcrun dwarfdump --uuid
I learned that there is a version of dwarfdump on Linux, so I used the following command to install it:
sudo yum install libdwarf-tools
However when I run the utility and look at the help screen there is no "-u" or "-uuid" command, and trying to run them does't do anything (there is no error message). The commands available look like it is a different tool that what I am looking for. I tried some of the arguments like "-a" and "-b" against the same file which worked on Mac, but I never get any output.
Does anyone know where I can get the version of dwarfdump that supports UUID for Linux? Or any other easy way to get the UUID from a file? I know it's in the binary file somewhere but I don't want to have to write an entire command parser just for this.
I talked to the developer of this tool and the problem is that MachO is not currently supported.
So it looks like the only way to do this would be to write a tool from scratch to do it, or to modify an existing tool. I think ATOSL might be able to be used for this purpose.

Blackberry 10 Webworks SDK command line generate build with package and signing

So I already was able to build the .bar file, but now I want to build the .bar file to be sent to the store with the package and signing.
So far I've tried this.
bbwp C:\xampp\htdocs\maddash\packaged\maddash.zip -g (password) -b 1.0.0 -o C:\xampp\htdocs\maddash\packaged\
and my error is..
failed to find signing key file
Did you register your keys from RIM and put them in the default location (%HOMEPATH%\Local Settings\Application Data\Research In Motion for Windows)
Did you update your SDK? Then check your keys in bbwp\bin and rename sigtool to author and move your file to the default location.
If not sufficient, try installing the native IDE and use the UI for managing the keys in the preferences
My personal opinion about this problem.
First. If you have your signing key, great for you, because BB changed the system of signing apps. (Now they use BBtokenID, related with your BBID and, in this moment, the webworks framework is the only one that doesn't support this tokens) (Come on, Hip, Hip, Hurrah! :P).
According to your command, one comment
bbwp C:\xampp\htdocs\maddash\packaged\maddash.zip -g (password) -b 1.0.0 -o C:\xampp\htdocs\maddash\packaged\
In the first paramenter yoy must add the FOLDER of your source code, not your zipped code.
If you have your keys where it corresponds, it will generate a bar file signed.
NOW, you must package it in a zip file. If you need more help with that, tell me :)

Access iOS filesystem without jailbreak?

I would like to write/use an open source script that can access iOS filesystem (non-jailbroken). On a Jailbroken device, i use ssh/scp to access, transfer data from the device. Intent is to copy some part of the iOS filesystem (say /var/mobile/Applications/xxx-xxxx/Documents) to a Mac, from a non-Jailbroken device, using some script. I see that tools like iFunBox is able to do it. Would like to know it manages to do so.
I came across mobiledevice.h but could not really understand how to use it.
Also, would prefer getting this done over USB.. for a jailbroken device, i use tcprelay.py for doing the usb tunneling. Is there something i can use for a non jailbroken device?
You can install the ifuse tool, which is hosted here: https://github.com/libimobiledevice/ifuse
In order to compile this tool, you will need the a working set of Gnu-tools (make, libtool, etc).
#Don't worry - clang is still default
sudo port install gcc48
NB: Update your .bash_profile (or similar) to include the following:
#Important - this is where your compiled libs will get installed to, so we need this
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/**
The rest of this process should take a few minutes
Install fuse4x
sudo port install fuse4x
Build the dependencies:
Check out: https://github.com/libimobiledevice/libplist, cd into the checkout, and run:
./autogen.sh
./configure
make
sudo make install
Check out: https://github.com/libimobiledevice/libusbmuxd, cd into the checkout, and run:
./autogen.sh
./configure
make
sudo make install
Check out: https://github.com/libimobiledevice/libimobiledevice, cd into the checkout, and run:
./autogen.sh
./configure
make
sudo make install
(If you're on Linux you'll also need to install usbmuxd, after building libusbmuxd and libimobiledevice. . otherwise, for Windows and OSX . . . )
Now build iFuse:
Check out: https://github.com/libimobiledevice/ifuse
./autogen.sh
./configure
make
sudo make install
To use ifuse to access your app's documents directory:
Make a mount directory:
sudo mkdir -p /Volumes/myapp.app
Now mount the app's dir:
ifuse --container <appid> /Volumes/abced.app
Where app id is the name what's displayed in the bundle identifier . . example:
ifuse --container mycompany.ABCED.com /Volumes/abced.app/
(Refer to the attached pic)
The MobileDeviceManager library brings us simple filesystem operations (it's an easy-to-use Objective-C wrapper around the MobileDevice framework you have come across).
The thing is that it doesn't support copying files from the device to the computer, only the other way around. So, in order to work around this issue, I've created a patch (GitHub gist) that you can merge into the included sample program to have it understand the copyFrom command.

Resources