How to quickly get app's directory from its bundle id on jailbroken iOS device?

前端 未结 2 1205
天涯浪人
天涯浪人 2021-02-06 11:49

In iOS devices, all user applications are located in /var/mobile/Applications directory, and each app has a unique random uuid as its directory name, for instance:<

相关标签:
2条回答
  • 2021-02-06 12:24

    And here this is another solution, if your code runs in SpringBoard:

    NSString *applicationBundleIdentifier = @"...";
    SBApplication *application = [[SBApplicationController sharedInstance]applicationWithDisplayIdentifier:applicationBundleIdentifier];
    NSString *path = application.containerPath;
    
    0 讨论(0)
  • I think the file you are looking for is

    /var/mobile/Library/Caches/com.apple.mobile.installation.plist
    

    For example, it contains information like this for each app:

        "com.zillow.ZillowMap" =         {
            ApplicationDSID = 216284405;
            ApplicationType = User;
            CFBundleDisplayName = Zillow;
            CFBundleExecutable = ZillowMap;
            CFBundleIconFiles =             (
                "app-icon",
                "app-icon-iPad.png",
                "app-icon-iPad@2x.png"
            );
            CFBundleIcons =             {
                CFBundlePrimaryIcon =                 {
                    CFBundleIconFiles =                     (
                        "app-icon",
                        "app-icon-iPad.png",
                        "app-icon-iPad@2x.png"
                    );
                    UIPrerenderedIcon = 1;
                };
            };
            CFBundleIdentifier = "com.zillow.ZillowMap";
            CFBundleName = ZillowMap;
            CFBundleShortVersionString = "6.1.0112";
            CFBundleVersion = "6.1.0112";
            CodeInfoIdentifier = "com.zillow.ZillowMap";
            Container = "/private/var/mobile/Applications/B9284FBE-E558-4A65-A7E4-AE20CDAD9A1D";
            Entitlements =             {
                "application-identifier" = "JEWMY3RZ4A.com.zillow.ZillowMap";
                "aps-environment" = production;
            };
            EnvironmentVariables =             {
                "CFFIXED_USER_HOME" = "/private/var/mobile/Applications/B9284FBE-E558-4A65-A7E4-AE20CDAD9A1D";
                HOME = "/private/var/mobile/Applications/B9284FBE-E558-4A65-A7E4-AE20CDAD9A1D";
                TMPDIR = "/private/var/mobile/Applications/B9284FBE-E558-4A65-A7E4-AE20CDAD9A1D/tmp";
            };
            IsUpgradeable = 1;
            LSRequiresIPhoneOS = 1;
            MinimumOSVersion = "5.0";
            Path = "/private/var/mobile/Applications/B9284FBE-E558-4A65-A7E4-AE20CDAD9A1D/ZillowMap.app";
            SequenceNumber = 2618;
            SignerIdentity = "Apple iPhone OS Application Signing";
            UIDeviceFamily =             (
                1,
                2
            );
            UIPrerenderedIcon = 1;
        };
    

    Update

    This file was removed in iOS 8: (https://www.theiphonewiki.com/wiki/Com.apple.mobile.installation.plist)

    There exists a similar file for iOS 8 at /var/mobile/Library/MobileInstallation/LastLaunchServicesMap.plist, but it might only be updated at launch (reboot).

    0 讨论(0)
提交回复
热议问题