2014-02-07 2 views
2

jailbroken 전화 용 앱에서 com.apple.mobile.installd를 중지하고 시작하려고합니다. 거의 모든 가능한 방법 NSTask, 시스템(), 쉘 스크립트를 시도했지만 작동하지 않습니다. 누군가 나를 도와 줄 수 있니?launchctl이 iOS 앱에서 작동하지 않습니다.

다음은 시도한 코드 샘플입니다. 지난 10 시절부터 내 머리를 bangging는 터미널에서 작동

-(IBAction)stopIntl:(id)sender 
{ 
    NSString *command = [NSString stringWithFormat:@"/bin/launchctl stop com.apple.mobile.installd >> /Applications/loader.app/output.txt"]; 
    const char* new = [command UTF8String]; 
    system(new); 
    NSLog(@"Stopping InstallD"); 
} 

-(IBAction)startIntl:(id)sender 
{ 
    NSString *command = [NSString stringWithFormat:@"/bin/launchctl start com.apple.mobile.installd >> /Applications/loader.app/output.txt"]; 
    const char* new = [command UTF8String]; 
    system(new); 
    NSLog(@"Starting InstallD"); 
} 

-(IBAction)reloadShell:(id)sender 
{ 
    system("/bin/launchctl stop com.apple.mobile.installd"); 
    sleep(2); 
    system("/bin/launchctl start com.apple.mobile.installd"); 

    NSLog(@"Reloading Shell"); 
} 

-(IBAction)reloadShell1:(id)sender 
{ 
    NSString *command = [NSString stringWithFormat:@"/usr/libexec/reload.sh >> /Applications/loader.app/output.txt"]; 
    system([command UTF8String]); 
    NSLog(@"Reloading Shell1"); 
} 

내 reload.sh ..

#!/bin/sh 

# reload.sh 
# 
# Copyright (c) 2014 Avanté Codeworx. All #rights reserved. 

launchctl stop com.apple.mobile.installd 
sleep 2 
launchctl start com.apple.mobile.installd 
exit 

는 또한 ..이 작동하지만 실행에 계속 실행 데몬 시도 아래로 ..

떨쳐 버릴 수 없었죠

여기 내 데몬입니다 ..

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict> 
    <key>LaunchEvents</key> 
    <dict> 
     <key>com.apple.notifyd.matching</key> 
     <dict> 
      <key>com.loader.reload</key> 
      <dict> 
       <key>Notification</key> 
       <string>com.loader.reload</string> 
      </dict> 
     </dict> 
    </dict> 
    <key>Label</key> 
    <string>com.avante.loader</string> 
    <key>UserName</key> 
    <string>root</string> 
    <key>KeepAlive</key> 
    <false/> 
    <key>Program</key> 
    <string>/usr/libexec/reload.sh</string> 
</dict> 
</plist> 

것은 저를 도와주세요!

답변

1

이것은 사람들이 가지고있는 오해입니다.

휴대 전화가 jailbroken되어 있기 때문에, apps don't run with root privileges.

앱이 /Applications/에 설치 되었기 때문에 root 권한으로 실행되지 않습니다.

root 권한을 사용하여 앱을 실행하려면, see this answer. 그렇지 않은 경우 사용자 mobile으로 실행됩니다.

launchctl은 올바르게 작동하려면 root 권한이 필요합니다.

P. 그리고 물론 시작 데몬을 제거 할 수 있습니다. 적절한 방법은 단순히 앱의 루트 권한을 부여하는 것입니다.

+0

나는 이틀 전에 그것을 풀었다. .. 우연히 .. 내가 한 것에 대한 좋은 설명이었다. 감사!! – malhaar

관련 문제