iOS specified directory does not perform icloud detection

Source: Internet
Author: User

Time is really fast, a week past, now to sum up to think, seems to have nothing to gain. This is a very annoying thing, obviously every day overtime, obviously even Saturday are at work, money did not take more, experience and knowledge has not increased. The previous week was mainly to add new features to the modules that my colleagues had made, and the original application was completely maintained by me because of my colleagues ' new games. Colleague's code is good, adopt MVC structure, structure stripping is quite clear, C layer adopt a drive, drive inside nested a state machine. The M data is embedded in the C layer using the decorator mode, and the event response mechanism is used to realize the C-layer communication with the V-layer. More valuable should be his realization of the process of state machine, but I have to catch the project, and then the compilation principle has not learned thoroughly, so a bit swallowed. The other is to look at the definition of colleagues and the background of the agreement, we are now doing is Texas hold ' em replay, the state is more. It really took some time to see how the code reads the data.

Of course, this is not a complaint article, although I always complain about that, in fact, I hate that kind of self, just can't control it. A more meaningful point might be how to bypass icloud auditing for iOS. Our application is a weak network, in order to save user traffic so there are some data stored in the app. Copies data from the package to the document directory the first time the program is run. For this reason, the app was rejected by the app Store once, prompting the program to do nothing, but icloud has some more data.

Here's how to bypass it:

-(BOOL) Addskipbackupattributetoitematurlhigh: (Nsurl *) url{//    5.1 +    assert ([[Nsfilemanager Defaultmanager] Fileexistsatpath: [URL Path]]);        Nserror *error = nil;    BOOL success = [URL setresourcevalue: [NSNumber numberwithbool:yes]                                  forkey:nsurlisexcludedfrombackupkey Error: & Amp;error];    if (!success) {        NSLog (@ "Error excluding%@ from backup%@", [URL lastpathcomponent], Error);    }    return success;} -(BOOL) Addskipbackupattributetoitematurllow: (Nsurl *) url{//    5.0.1:    assert ([[Nsfilemanager Defaultmanager] Fileexistsatpath: [URL Path]]);                Const char* FilePath = [[URL path] filesystemrepresentation];                Const char* attrname = "Com.apple.MobileBackup";        u_int8_t attrValue = 1;                int result = Setxattr (FilePath, Attrname, &attrvalue, sizeof (AttrValue), 0, 0);        return result = = 0;    }


No good detection version of the method, the use of one of the most soil:

  <p class= "P1" ><span class= "S1" >    </span><span class= "S2" >nsurl</span ><span class= "S1" > *tempurl = [</span><span class= "S2" >nsurl</span><span class= "S1" > </span>fileurlwithpath<span class= "S1" >:[</span><span class= "S2" >NSString</span ><span class= "S1" > </span>stringwithutf8string<span class= "S1" >:(</span><span class= "S3" >ccfileutils</span><span class= "S1" >::</span><span class= "S4" >sharedFileUtils< /span><span class= "S1" > ()-></span><span class= "S4" >getwritablepath</span><span class= "S1" > () +</span><span class= "S5" > "temp/" </span><span class= "S1" >). </span>c _str<span class= "S1" > ()]];</span></p><p class= "P2" >   </p><p class= "P3" >    <span class= "S2" >NSString</span> *stringversion =[[<span class= "s2 ">UIDevice</span> <span class=" S6 "&GT;CURRENTDEVICE&LT;/SPAN&GT;] <span class=" S6 "> Systemversion</span>];</p><p class= "P3" >    <span class= "S2" >nsarray</span > * array = [stringversion <span class= "S6" >componentsseparatedbystring</span>:<span class= "S5" > @"." </span>];</p><p class= "P3" >    <span class= "s7" >int</span> symbol = <span class= "S8" >0</span>;</p><p class= "P3" >    <span class= "S7" >for</span> ( <span class= "s2" >NSInteger</span> i = <span class= "S8" >0</span>; I < Array.<span class= "S6" >count</span>; + + i) {</p><p class= "p3" >        <span class= "S7" >if</span> (i = = <span CLA ss= "S8" >0</span>) {</p><p class= "p3" >            <span class= "S7" >if</span> ([[[Array <span class= "S6" &GT;OBJECTATINDEX&LT;/SPAN&GT;:I] <span class= "S6" &GT;INTEGERVALUE&LT;/SPAN&GT;] > <span class= "S8" >5 </span>) {</p><p class= "p3" >                symbol = <span cl ass= "S8" >3</span>;</p><p class= "P3" >                < Span class= "S7" >break</span>;</p><p class= "P3" >           }< Span class= "S7" >else</span> <span class= "S7" >if</span> ([[[Array <span class= "S6" > OBJECTATINDEX&LT;/SPAN&GT;:I] <span class= "S6" &GT;INTEGERVALUE&LT;/SPAN&GT;] < <span class= "S8" >5</ span>) {</p><p class= "p3" >                symbol = <span class= "s 8 ">0</span>;</p><p class=" P3 ">                <span class= "S7" >break</span>;</p><p class= "P3" >           }</p><p class= "P3" >       }<span class= "S7" >else</ Span> <span class= "S7" >if</span> (i = = <span class= "s8" >1</span>) {</p><p class= " P3 ">            <span class=" S7 ">if</span> ([[[Array <span class=] S6" > OBJECTATINDEX&LT;/SPAN&GT;:I] <span class= "S6" &GT;INTEGERVALUE&LT;/SPAN&GT;] >= <span class= "S8" >1</ span>) {</p><p class= "p3" >                symbol = <span class= " S8 ">3</span>;</p><p class=" P3 ">                <span class= "S7" >break</span>;</p><p class= "P3" >           }</p> <p class= "P3" >       }<span class= "S7" >else</span> <span class= "S7" >if </span> (i = = <span class= "s8" >2</span>) {</p><p class= "P3" >            <span class= "S7" >if</span> ([[[Array <span class= "S6" >objectatindex</span>:i] <span class= "S6" &GT;INTEGERVALUE&LT;/SPAN&GT;] > < Span class= "S8" >0</span>) {</p><p class= "p3" >                symbol = <span class= "s8" >2</span>;</p><p class= "P3" >          and nbsp     <span class= "S7" >break</span>;</p><p class= "P3" >           }</p><p class= "P3" >       }</p><p class= "P3" >   }& Lt;/p><p class= "P3" >    <span class= "S7" >if</span> (symbol = = <span class= "S8" >2 </span>) {</p><p class= "P4" ><span class= "S1" >        [</span>< Span class= "S7" >self</span><span class= "S1" > &Lt;/span>addskipbackupattributetoitematurllow<span class= "S1" >:tempurl];</span></p><p class= "P3" >   }<span class= "S7" >else</span> <span class= "s7" >if</span> (symbol = = <span class= "s8" >3</span>) {</p><p class= "P4" ><span class= "S1" >      & nbsp [</span><span class= "S7" >self</span><span class= "S1" > </span> Addskipbackupattributetoitematurlhigh<span class= "S1" >:tempurl];</span></p><p class= "P3" >   }</p>
It is worth noting that there is no icloud detection in 5.0, the whole directory of document is not allowed to be ignored as icloud, and import is required to detect V5.0.1Sys/xattr.h


iOS specified directory does not perform icloud detection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.