]> Chaos Git - corbenik/ctrulib.git/commitdiff
Clean up and simplify APT_CheckNew3DS
authorfincs <fincs.alt1@gmail.com>
Sat, 20 Jun 2015 16:17:44 +0000 (18:17 +0200)
committerfincs <fincs.alt1@gmail.com>
Sat, 20 Jun 2015 16:17:44 +0000 (18:17 +0200)
libctru/source/services/apt.c

index c38a01e3317d2318317f7585c482a443c777534c..1a4075952bdfd74ff0e7f3518c912892465d307c 100644 (file)
@@ -1093,6 +1093,7 @@ Result APT_GetAppCpuTimeLimit(Handle* handle, u32 *percent)
        return cmdbuf[1];
 }
 
+// Note: this function is unreliable, see: http://3dbrew.org/wiki/APT:PrepareToStartApplication
 Result APT_CheckNew3DS_Application(Handle* handle, u8 *out)
 {
        if(!handle)handle=&aptuHandle;
@@ -1149,25 +1150,8 @@ Result APT_CheckNew3DS(Handle* handle, u8 *out)
                return 0;
        }
 
-       // This may be needed in future exploits because APT_CheckNew3DS has a
-       // compatibility mode which always return zero even on an actual N3DS.
-       if (__system_runflags & BIT(31))
-       {
-               __apt_new3dsflag_initialized = 1;
-               __apt_new3dsflag = 1;
-               *out = 1;
-               return 0;
-       }
-
        aptOpenSession();
-       if(currentAppId==APPID_APPLICATION)
-       {
-               ret = APT_CheckNew3DS_Application(NULL, out);
-       }
-       else
-       {
-               ret = APT_CheckNew3DS_System(NULL, out);
-       }
+       ret = APT_CheckNew3DS_System(NULL, out);
        aptCloseSession();
 
        __apt_new3dsflag_initialized = 1;