【问题标题】:Remote wipe out application in iDevice远程清除 iDevice 中的应用程序
【发布时间】:2013-06-12 09:50:13
【问题描述】:

如何远程清除 iDevice [iPod Touch、iPhone 或 iPad] 中的数据/应用程序?

可能的解决方案如下。

  1. 在您的 iPod 上配置“查找我的 iPod”
  2. 调用服务器并检查设备是否被报告为被盗?如果是,则调用 exit(0) 函数并清除数据和应用程序。

我使用第二种解决方案来清除应用程序中的数据。为此,我使用了以下两种方法。

-(NSString *)getDatabasePath {
    NSArray *subDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:[self applicationAppSupportDirectory] error:nil];
    NSString *path = [[[self applicationAppSupportDirectory] stringByAppendingPathComponent:[subDir lastObject]]
                      stringByAppendingPathComponent:@"xyz.sqlite"];

    return path ;
}
-(void)deleteDatabase {

    NSFileManager *manager = [NSFileManager defaultManager] ;
    NSError *error = nil ;
    NSString *databasePath = [self getDatabasePath];

    if ([manager fileExistsAtPath:databasePath]) {
        [manager removeItemAtPath:databasePath error:&error] ;
    }
    debug(@"%@",error);

    if (error) {
        [Utility showAlertViewWithTitle:@"Error" andMessage:error.localizedDescription];        
    }
}

-(void)deleteApplication {

    exit(0);
    NSString *appPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent] ;
    NSLog(@"%@",appPath);

}

我删除了应用程序文件夹,但我的 iDevice 上仍然有应用程序徽标。 这是清除我的应用程序的正确方法吗? 苹果会为此拒绝我的应用程序吗? 为什么 appLogo 仍然存在,因为我完全删除了 app 文件夹?

【问题讨论】:

  • 您不能以编程方式删除应用程序,顺便问一下,您为什么要这样做??
  • 由于我的应用程序包含敏感数据,如果他的设备被盗,客户希望将其删除。
  • @milanpanchal:iOS 已经通过 iCloud 和“查找 iPhone”应用提供了对整个设备的远程擦除功能。
  • @Marcelo Cantos - 我已经在我的问题中指定了那个东西。但为此,用户必须启用该功能。

标签: iphone ios ipad ipod


【解决方案1】:

Apple 不允许您使用 exit(0)。不过,您可能可以擦除用户数据,但您必须确保之后仍然可以使用应用程序(即,将应用程序恢复到首次启动的状态)。

对于报告被盗部分:您必须为此创建自己的 Web UI 或类似用户界面,因为 Apple 目前不允许您从第三方应用程序中访问此类 iCloud 信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-04-12
    • 2015-08-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-15
    相关资源
    最近更新 更多