Hello, I would like to know how I can disable device verification in the GameActivity file below, I am trying to play the game Star Wars: Hunters on an Android emulator Open GL ES 3.1, but the game requires Open GL ES 3.2 support, I would like to disable this requirement, as technically the The game doesn't need that API level, the devs just put it to stop installation on older devices while the game is still poorly optimized (I did it with the GLTools test).
I'm a layman on this subject, so I'm here looking for help, I used APKEasyTool to decompile the APK file, you can check the GameActivity content below, which I believe is where the Open GL ES version verification is being done.
https://gist.github.com/celozaga/1f5efbcd8bee41612b887ae64b497967
C++:
.method private V()V
.locals 15
.line 1
invoke-static {}, Landroid/opengl/EGL14;->eglGetError()I
move-result v0
const-string v1, ""
const-string v2, " "
const/16 v3, 0x3000
if-ne v0, v3, :cond_0
move-object v0, v1
goto :goto_0
.line 2
:cond_0
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "InitialEGLError = "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
:goto_0
iput-object v0, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
const/4 v0, 0x0
.line 3
invoke-static {v0}, Landroid/opengl/EGL14;->eglGetDisplay(I)Landroid/opengl/EGLDisplay;
move-result-object v11
.line 4
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
iget-object v4, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
sget-object v4, Landroid/opengl/EGL14;->EGL_NO_DISPLAY:Landroid/opengl/EGLDisplay;
if-eq v11, v4, :cond_1
move-object v4, v1
goto :goto_1
:cond_1
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
const-string v5, "eglGetDisplay = "
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-static {}, Landroid/opengl/EGL14;->eglGetError()I
move-result v5
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
:goto_1
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
iput-object v3, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
const/4 v3, 0x2
new-array v3, v3, [I
const/4 v12, 0x1
.line 5
invoke-static {v11, v3, v0, v3, v12}, Landroid/opengl/EGL14;->eglInitialize(Landroid/opengl/EGLDisplay;[II[II)Z
move-result v3
.line 6
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
iget-object v5, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
if-eqz v3, :cond_2
move-object v3, v1
goto :goto_2
:cond_2
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v5, "eglInitialize = "
invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-static {}, Landroid/opengl/EGL14;->eglGetError()I
move-result v5
invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
:goto_2
invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
iput-object v3, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
const/16 v3, 0x9
new-array v4, v3, [I
.line 7
fill-array-data v4, :array_0
new-array v13, v12, [Landroid/opengl/EGLConfig;
new-array v14, v12, [I
const/4 v5, 0x0
const/4 v7, 0x0
const/4 v8, 0x1
const/4 v10, 0x0
move-object v3, v11
move-object v6, v13
move-object v9, v14
.line 8
invoke-static/range {v3 .. v10}, Landroid/opengl/EGL14;->eglChooseConfig(Landroid/opengl/EGLDisplay;[II[Landroid/opengl/EGLConfig;II[II)Z
.line 9
aget v3, v14, v0
if-nez v3, :cond_3
.line 10
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
iget-object v1, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "eglChooseConfig = "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-static {}, Landroid/opengl/EGL14;->eglGetError()I
move-result v1
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
.line 11
sget-object v0, Lcom/epicgames/ue4/GameActivity;->Log:Lcom/epicgames/ue4/d;
const-string v1, "Did not find an EGL config"
invoke-virtual {v0, v1}, Lcom/epicgames/ue4/d;->c(Ljava/lang/String;)V
return-void
.line 12
:cond_3
aget-object v3, v13, v0
const/4 v4, 0x5
new-array v4, v4, [I
.line 13
fill-array-data v4, :array_1
.line 14
invoke-static {v11, v3, v4, v0}, Landroid/opengl/EGL14;->eglCreatePbufferSurface(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLConfig;[II)Landroid/opengl/EGLSurface;
move-result-object v4
.line 15
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
iget-object v6, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
sget-object v6, Landroid/opengl/EGL14;->EGL_NO_SURFACE:Landroid/opengl/EGLSurface;
if-eq v4, v6, :cond_4
move-object v6, v1
goto :goto_3
:cond_4
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "eglCreatePbufferSurface = "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-static {}, Landroid/opengl/EGL14;->eglGetError()I
move-result v7
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v6, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
:goto_3
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
iput-object v5, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
const/4 v5, 0x3
new-array v5, v5, [I
.line 16
fill-array-data v5, :array_2
.line 17
sget-object v6, Landroid/opengl/EGL14;->EGL_NO_CONTEXT:Landroid/opengl/EGLContext;
invoke-static {v11, v3, v6, v5, v0}, Landroid/opengl/EGL14;->eglCreateContext(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLConfig;Landroid/opengl/EGLContext;[II)Landroid/opengl/EGLContext;
move-result-object v3
.line 18
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
iget-object v6, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
sget-object v6, Landroid/opengl/EGL14;->EGL_NO_CONTEXT:Landroid/opengl/EGLContext;
if-eq v3, v6, :cond_5
move-object v6, v1
goto :goto_4
:cond_5
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "eglCreateContext = "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-static {}, Landroid/opengl/EGL14;->eglGetError()I
move-result v7
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v6, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
:goto_4
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
iput-object v5, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
.line 19
invoke-static {v11, v4, v4, v3}, Landroid/opengl/EGL14;->eglMakeCurrent(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;Landroid/opengl/EGLSurface;Landroid/opengl/EGLContext;)Z
move-result v5
.line 20
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
iget-object v7, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
if-eqz v5, :cond_6
move-object v5, v1
goto :goto_5
:cond_6
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "eglMakeCurrent = "
invoke-virtual {v5, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-static {}, Landroid/opengl/EGL14;->eglGetError()I
move-result v7
invoke-virtual {v5, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v5, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
:goto_5
invoke-virtual {v6, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
iput-object v5, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
const/16 v5, 0x1f03
.line 21
invoke-static {v5}, Landroid/opengl/GLES20;->glGetString(I)Ljava/lang/String;
move-result-object v5
const/16 v6, 0x1f00
.line 22
invoke-static {v6}, Landroid/opengl/GLES20;->glGetString(I)Ljava/lang/String;
move-result-object v6
iput-object v6, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLVendor:Ljava/lang/String;
const/16 v6, 0x1f01
.line 23
invoke-static {v6}, Landroid/opengl/GLES20;->glGetString(I)Ljava/lang/String;
move-result-object v6
iput-object v6, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLDevice:Ljava/lang/String;
const/16 v6, 0x1f02
.line 24
invoke-static {v6}, Landroid/opengl/GLES20;->glGetString(I)Ljava/lang/String;
move-result-object v6
iput-object v6, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLDriver:Ljava/lang/String;
const-string v7, "OpenGL ES 3."
.line 25
invoke-virtual {v6, v7}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v6
.line 26
invoke-static {}, Landroid/opengl/GLES20;->glGetError()I
move-result v7
.line 27
new-instance v8, Ljava/lang/StringBuilder;
invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V
iget-object v9, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
if-nez v7, :cond_7
const-string v7, "getGraphicsInformation completed. "
goto :goto_6
:cond_7
new-instance v9, Ljava/lang/StringBuilder;
invoke-direct {v9}, Ljava/lang/StringBuilder;-><init>()V
const-string v10, "gl error = "
invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v9, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
:goto_6
invoke-virtual {v8, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
iput-object v7, p0, Lcom/epicgames/ue4/GameActivity;->r0:Ljava/lang/String;
.line 28
sget-object v7, Landroid/opengl/EGL14;->EGL_NO_SURFACE:Landroid/opengl/EGLSurface;
sget-object v8, Landroid/opengl/EGL14;->EGL_NO_CONTEXT:Landroid/opengl/EGLContext;
invoke-static {v11, v7, v7, v8}, Landroid/opengl/EGL14;->eglMakeCurrent(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;Landroid/opengl/EGLSurface;Landroid/opengl/EGLContext;)Z
.line 29
invoke-static {v11, v4}, Landroid/opengl/EGL14;->eglDestroySurface(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLSurface;)Z
.line 30
invoke-static {v11, v3}, Landroid/opengl/EGL14;->eglDestroyContext(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLContext;)Z
.line 31
invoke-static {v11}, Landroid/opengl/EGL14;->eglTerminate(Landroid/opengl/EGLDisplay;)Z
.line 32
iget-object v3, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLDevice:Ljava/lang/String;
const-string v4, "NVIDIA"
invoke-virtual {v3, v4}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
.line 33
iget-object v3, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLDevice:Ljava/lang/String;
const-string v4, "PowerVR"
invoke-virtual {v3, v4}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
.line 34
iget-object v3, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLDevice:Ljava/lang/String;
const-string v4, "Adreno"
invoke-virtual {v3, v4}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
.line 35
iget-object v3, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLDevice:Ljava/lang/String;
const-string v4, "Mali"
invoke-virtual {v3, v4}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
.line 36
iget-object v3, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLDevice:Ljava/lang/String;
const-string v4, "VideoCore"
invoke-virtual {v3, v4}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
.line 37
iput-object v1, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLVersion:Ljava/lang/String;
.line 38
iget-object v3, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLDriver:Ljava/lang/String;
const-string v4, "OpenGL ES "
invoke-virtual {v3, v4}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
move-result v3
if-ltz v3, :cond_8
.line 39
iget-object v4, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLDriver:Ljava/lang/String;
add-int/lit8 v3, v3, 0xa
invoke-virtual {v4, v3}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v3
iput-object v3, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLVersion:Ljava/lang/String;
.line 40
invoke-virtual {v3, v2}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
move-result v2
if-lez v2, :cond_8
.line 41
iget-object v3, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLVersion:Ljava/lang/String;
invoke-virtual {v3, v0, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v2
iput-object v2, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLVersion:Ljava/lang/String;
:cond_8
const-string v2, "GL_EXT_color_buffer_half_float"
.line 42
invoke-virtual {v5, v2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v2
if-nez v2, :cond_a
if-eqz v6, :cond_9
const-string v2, "GL_EXT_color_buffer_float"
.line 43
invoke-virtual {v5, v2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v2
if-eqz v2, :cond_9
goto :goto_7
:cond_9
move v12, v0
:cond_a
:goto_7
iput-boolean v12, p0, Lcom/epicgames/ue4/GameActivity;->bSupportsFloatingPointRenderTargets:Z
.line 44
iput-object v1, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
const-string v1, "GL_KHR_texture_compression_astc_ldr"
.line 45
invoke-virtual {v5, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v1
if-eqz v1, :cond_b
.line 46
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
iget-object v2, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v2, "ASTC,"
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
iput-object v1, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
:cond_b
const-string v1, "GL_IMG_texture_compression_pvrtc"
.line 47
invoke-virtual {v5, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v1
if-eqz v1, :cond_c
.line 48
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
iget-object v2, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v2, "PVRTC,"
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
iput-object v1, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
:cond_c
const-string v1, "GL_NV_texture_compression_s3tc"
.line 49
invoke-virtual {v5, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_d
const-string v1, "GL_EXT_texture_compression_s3tc"
invoke-virtual {v5, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v1
if-eqz v1, :cond_e
.line 50
:cond_d
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
iget-object v2, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v2, "DXT,"
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
iput-object v1, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
:cond_e
const-string v1, "GL_ATI_texture_compression_atitc"
.line 51
invoke-virtual {v5, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_f
const-string v1, "GL_AMD_compressed_ATC_texture"
invoke-virtual {v5, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v1
if-eqz v1, :cond_10
.line 52
:cond_f
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
iget-object v2, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v2, "ATC,"
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
iput-object v1, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
.line 53
:cond_10
iget-object v1, p0, Lcom/epicgames/ue4/GameActivity;->OpenGLVersion:Ljava/lang/String;
invoke-virtual {v1, v0}, Ljava/lang/String;->charAt(I)C
move-result v0
const/16 v1, 0x33
if-lt v0, v1, :cond_11
.line 54
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
iget-object v1, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "ETC2,"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
.line 55
:cond_11
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
iget-object v1, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v1, "ETC1"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Lcom/epicgames/ue4/GameActivity;->TextureFormats:Ljava/lang/String;
return-void
nop
:array_0
.array-data 4
0x303f
0x308e
0x3029
0x0
0x3040
0x4
0x3033
0x1
0x3038
.end array-data
:array_1
.array-data 4
0x3057
0x8
0x3056
0x8
0x3038
.end array-data
:array_2
.array-data 4
0x3098
0x2
0x3038
.end array-data
.end method
Related
This tutorial is going to delve into the convoluted smali involved in handling dialogs, and ultimately bypassing them. I must warn you there will be a lot of tracing in this post, so if all you want is the patch, this may not be for you. The idea is to gain an intimate understanding of dialogs from smali! (This is based on LPD base)
Decompile jobmanager.apk, then search for 'Exit all', which leads to public.xml: <public type="string" name="kill_all" id="0x7f050005" />
Searching for '7f050005' leads us to RunningAppsListActivity.smali (referred to as RALA from now on), which we can now dissect. Start by looking at some of the variables at the top of
code. Two should stand out:
Code:
.field private mKillAll:Landroid/widget/Button;
...
.field private mOnClickListenerKillAll:Landroid/view/View$OnClickListener;
These represent the button and the code that executes when it's clicked. Let's find out what that code is by searching, which leads to:
Code:
.line 308
new-instance v0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;
invoke-direct {v0, p0}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;-><init>(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)V
iput-object v0, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mOnClickListenerKillAll:Landroid/view/View$OnClickListener;
So now we know RALA$6 is our executed code:
Code:
.method public onClick(Landroid/view/View;)V
.locals 2
.parameter "v"
.prologue
.line 311
iget-object v0, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
const/4 v1, 0x5
invoke-virtual {v0, v1}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->showDialog(I)V
.line 312
return-void
.end method
So what does this mean? When the button is clicked, it's calling back to RALA with a value of 0x5. Let's figure out what that means, look at '.method protected onCreateDialog'
Code:
packed-switch p1, :pswitch_data_0
(This is defined at the end of the method as)
:pswitch_data_0
.packed-switch 0x1
:pswitch_1
:pswitch_0
:pswitch_2
:pswitch_3
:pswitch_4
.end packed-switch
So our value when clicking the button is 0x5, which translates to pswitch_4
Code:
:pswitch_4
new-instance v3, Landroid/app/AlertDialog$Builder;
invoke-direct {v3, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V
const v4, 0x7f050005 <<<<<<<<<<<<<<<<<<<<<<<<<< Remember this #, it's our 'Exit all' string id
...
new-instance v4, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$12;
invoke-direct {v4, p0}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$12;-><init>(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)V
invoke-virtual {v3, v7, v4}, Landroid/app/AlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;
This last line sets the code executed when you click 'Ok', so lets look at RALA$12, inside OnClick:
Code:
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mHandler:Landroid/os/Handler;
invoke-static {v0}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$300(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Landroid/os/Handler;
move-result-object v0
const/4 v1, 0x6
invoke-virtual {v0, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z
So this is sending a code (0x6) to mHandler in the main RALA module, let's see what that means. mHandler is our message handler, and is defined here:
Code:
.line 331
new-instance v0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
invoke-direct {v0, p0}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;-><init>(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)V
iput-object v0, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mHandler:Landroid/os/Handler;
So RALA$7 is our next target, specifically '.method public handleMessage(Landroid/os/MessageV':
Code:
iget v3, p1, Landroid/os/Message;->what:I
packed-switch v3, :pswitch_data_0
(which is)
.line 333
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
:pswitch_5
:pswitch_6
:pswitch_7
.end packed-switch
(A side note, packed-switch 0x1 means the first entry starts with 0x1, so 0x6 is pswitch_5. Let's now look at that)
:pswitch_5
const-string v3, "RunningAppsListActivity"
const-string v4, "MSG_KILL_ALL"
invoke-static {v3, v4}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
.line 410
iget-object v3, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
new-instance v4, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;
...
So finally we have reached the true code for executing KILL ALL, and it lies within RALA$7$4. If you look at '.method public run()V' in RALA$7$4, you will see the extensive code to kill all running apps. So now we that we have what we want, how do we bypass the dialog? Simple, just abort creating the dialog and execute the code instead.
Let's take a moment to review the execution entirely:
RALA assigns button -> RALA$6 which calls back RALA -> Create dlg and set OK -> RALA$12 which then calls the message handler RALA$7 with code 0x5 ->
RALA$7$4 which is the ACTUAL 'kill all' code.
So our intercept point is in RALA$6, where we can bypass the creation of the dialog and execute the code directly. Now you can't just copy/paste the code from RALA$7$4 to RALA$6, there are variables specific to each .smali. So this is the fixed code with the manual changes highlighted:
Code:
.method public onClick(Landroid/view/View;)V
.locals [COLOR="Red"]7[/COLOR]
.parameter "v"
.prologue
.line 311
iget-object v0, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
const/4 v1, 0x5
[COLOR="red"]#[/COLOR] invoke-virtual {v0, v1}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->showDialog(I)V
.line 412
[COLOR="red"]#[/COLOR] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->getBaseAppList()Ljava/util/List;
move-result-object v1
.line 413
.local v1, items:Ljava/util/List;,"Ljava/util/List<Lcom/sec/android/app/controlpanel/PackageInfoItem;>;"
new-instance v3, Ljava/util/HashSet;
invoke-direct {v3}, Ljava/util/HashSet;-><init>()V
.line 414
.local v3, removeTarget:Ljava/util/Set;,"Ljava/util/Set<Lcom/sec/android/app/controlpanel/PackageInfoItem;>;"
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v0
.local v0, i$:Ljava/util/Iterator;
:cond_0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v4
if-eqz v4, :cond_1
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/sec/android/app/controlpanel/PackageInfoItem;
.line 415
.local v2, p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
invoke-virtual {v2}, Lcom/sec/android/app/controlpanel/PackageInfoItem;->isCanKilled()Z
move-result v4
if-eqz v4, :cond_0
.line 416
const-string v4, "RunningAppsListActivity"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "Kill runningApplication! "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v2}, Lcom/sec/android/app/controlpanel/PackageInfoItem;->getPackageName()Ljava/lang/String;
move-result-object v6
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v4, v5}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
.line 417
[COLOR="red"]#[/COLOR] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPkgInfo:Lcom/sec/android/app/controlpanel/PackageInfo;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$400(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/PackageInfo;
move-result-object v4
invoke-virtual {v2}, Lcom/sec/android/app/controlpanel/PackageInfoItem;->getPackageName()Ljava/lang/String;
move-result-object v5
const/4 v6, 0x1
invoke-virtual {v4, v5, v6}, Lcom/sec/android/app/controlpanel/PackageInfo;->killPackage(Ljava/lang/String;Z)V
.line 418
invoke-interface {v3, v2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 421
.end local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
:cond_1
invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_1
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v4
if-eqz v4, :cond_2
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/sec/android/app/controlpanel/PackageInfoItem;
.line 422
.restart local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
invoke-interface {v1, v2}, Ljava/util/List;->remove(Ljava/lang/Object;)Z
goto :goto_1
.line 424
.end local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
:cond_2
[COLOR="red"]#[/COLOR] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4, v1}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->setList(Ljava/util/List;)V
.line 425
[COLOR="red"]#[/COLOR] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->notifyDataSetChanged()V
.line 428
[COLOR="red"]#[/COLOR] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
[COLOR="red"]#[/COLOR] iget-object v5, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v5, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
const v6, 0x7f050028
invoke-virtual {v5, v6}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->getText(I)Ljava/lang/CharSequence;
move-result-object v5
const/4 v6, 0x0
invoke-static {v4, v5, v6}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v4
invoke-virtual {v4}, Landroid/widget/Toast;->show()V
.line 312
return-void
.end method
That is it, recompile JobManager.apk, u/l and test it out! Hope you enjoyed the tut =)
Why didn't I see this before, your holding out on us in chat.
LiLChris06 said:
Why didn't I see this before, your holding out on us in chat.
Click to expand...
Click to collapse
I finished this a few weeks back, but just got around to writing it up..I'm pretty sure you got a pastebin msg one night =)
PS - For those that just want the patch, just copy/paste that last code box into RALA$6 (replacing the existing onclick method).
Lovely piece of information, easily readable
thanks very much
Update for 4.0.4
The overall structure is still the same, but here's the updated patch based on 4.0.4 LPO. You paste this into RALA$6, replacing the existing onclick method:
Code:
.method public onClick(Landroid/view/View;)V
.locals 8
.prologue
const/4 v7, 0x0
.line 428
# iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->getBaseAppList()Ljava/util/List;
move-result-object v1
.line 429
.local v1, items:Ljava/util/List;,"Ljava/util/List<Lcom/sec/android/app/controlpanel/PackageInfoItem;>;"
new-instance v3, Ljava/util/HashSet;
invoke-direct {v3}, Ljava/util/HashSet;-><init>()V
.line 432
.local v3, removeTarget:Ljava/util/Set;,"Ljava/util/Set<Lcom/sec/android/app/controlpanel/PackageInfoItem;>;"
if-eqz v1, :cond_3
.line 433
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v0
.local v0, i$:Ljava/util/Iterator;
:cond_0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v4
if-eqz v4, :cond_1
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/sec/android/app/controlpanel/PackageInfoItem;
.line 434
.local v2, p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
invoke-virtual {v2}, Lcom/sec/android/app/controlpanel/PackageInfoItem;->isCanKilled()Z
move-result v4
if-eqz v4, :cond_0
.line 437
# iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPkgInfo:Lcom/sec/android/app/controlpanel/PackageInfo;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$400(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/PackageInfo;
move-result-object v4
invoke-virtual {v2}, Lcom/sec/android/app/controlpanel/PackageInfoItem;->getPackageName()Ljava/lang/String;
move-result-object v5
const/4 v6, 0x1
invoke-virtual {v4, v5, v6}, Lcom/sec/android/app/controlpanel/PackageInfo;->killPackage(Ljava/lang/String;Z)V
.line 438
invoke-interface {v3, v2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 441
.end local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
:cond_1
invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_1
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v4
if-eqz v4, :cond_2
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/sec/android/app/controlpanel/PackageInfoItem;
.line 442
.restart local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
invoke-interface {v1, v2}, Ljava/util/List;->remove(Ljava/lang/Object;)Z
goto :goto_1
.line 444
.end local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
:cond_2
# iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4, v1}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->setList(Ljava/util/List;)V
.line 445
# iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->notifyDataSetChanged()V
.line 447
const/4 v4, 0x2
const/4 v5, 0x0
:try_start_0
invoke-static {v4, v5}, Lcom/sec/android/hardware/SecHardwareInterface;->setBatteryUse(IZ)V
.line 448
const/4 v4, 0x3
const/4 v5, 0x0
invoke-static {v4, v5}, Lcom/sec/android/hardware/SecHardwareInterface;->setBatteryUse(IZ)V
.line 449
const/4 v4, 0x4
const/4 v5, 0x0
invoke-static {v4, v5}, Lcom/sec/android/hardware/SecHardwareInterface;->setBatteryUse(IZ)V
.line 450
const/4 v4, 0x5
const/4 v5, 0x0
invoke-static {v4, v5}, Lcom/sec/android/hardware/SecHardwareInterface;->setBatteryUse(IZ)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 457
:goto_2
# iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
# iget-object v5, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v5, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
const v6, 0x7f050028
invoke-virtual {v5, v6}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->getText(I)Ljava/lang/CharSequence;
move-result-object v5
invoke-static {v4, v5, v7}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v4
invoke-virtual {v4}, Landroid/widget/Toast;->show()V
.line 461
.end local v0 #i$:Ljava/util/Iterator;
:cond_3
return-void
.line 451
.restart local v0 #i$:Ljava/util/Iterator;
:catch_0
move-exception v4
goto :goto_2
.end method
good day, I need some help in adding some codes to settings.smali. I want to add a condition to the preferencetreeclick method but I always get a force close error, the condition I'm trying to add would be that if wifi toggle is checked then call wifi_settings subscreen. please help me on this one devs. thanks..
Code:
.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
.locals 4
.parameter "preferenceScreen"
.parameter "preference"
.prologue
const-string v3, "com.android.settings"
.line 175
invoke-virtual {p2}, Landroid/preference/Preference;->getKey()Ljava/lang/String;
move-result-object v1
.line 176
.local v1, key:Ljava/lang/String;
const-string v2, "call_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_1
.line 177
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 178
.local v0, intent:Landroid/content/Intent;
const-string v2, "com.android.phone"
const-string v3, "com.android.phone.CallSettings"
invoke-virtual {v0, v2, v3}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 179
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
.line 258
.end local v0 #intent:Landroid/content/Intent;
:cond_0
:goto_0
invoke-super {p0, p1, p2}, Landroid/preference/PreferenceActivity;->onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
move-result v2
return v2
.line 180
:cond_1
const-string v2, "fm_transmitter_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_2
.line 181
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 182
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.mediatek.FMTransmitter"
const-string v3, "com.mediatek.FMTransmitter.FMTransmitterActivity"
invoke-virtual {v0, v2, v3}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 184
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto :goto_0
.line 185
.end local v0 #intent:Landroid/content/Intent;
:cond_2
const-string v2, "customization_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_3
.line 186
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 187
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.Customization"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 188
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto :goto_0
.line 189
.end local v0 #intent:Landroid/content/Intent;
:cond_3
const-string v2, "gemini_sim_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_4
.line 190
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 191
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.gemini.SimManagement"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 192
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto :goto_0
.line 193
.end local v0 #intent:Landroid/content/Intent;
:cond_4
const-string v2, "toggle_wifi"
# i don't know if this is the right dalvik code for the condition I want to add..
iget-boolean v2, v3, Lcom/android/settings/Settings;->mWifiEnabler:Lcom/android/settings/wifi/WifiEnabler;
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_5
.line 194
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 195
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.wifi.WifiSettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 196
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto :goto_0
.line 197
.end local v0 #intent:Landroid/content/Intent;
:cond_5
const-string v2, "audio_profile_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_6
.line 198
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 199
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.audioprofile.AudioProfileSettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 201
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto :goto_0
.line 202
.end local v0 #intent:Landroid/content/Intent;
:cond_6
const-string v2, "display_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_7
.line 203
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 204
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.DisplaySettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 205
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 206
.end local v0 #intent:Landroid/content/Intent;
:cond_7
const-string v2, "location_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_8
.line 207
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 208
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.LocationSettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 209
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 210
.end local v0 #intent:Landroid/content/Intent;
:cond_8
const-string v2, "security_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_9
.line 211
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 212
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.SecuritySettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 213
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 214
.end local v0 #intent:Landroid/content/Intent;
:cond_9
const-string v2, "applications_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_a
.line 215
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 216
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.ApplicationSettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 217
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 218
.end local v0 #intent:Landroid/content/Intent;
:cond_a
const-string v2, "privacy_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_b
.line 219
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 220
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.PrivacySettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 221
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 222
.end local v0 #intent:Landroid/content/Intent;
:cond_b
const-string v2, "storage_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_c
.line 223
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 224
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.deviceinfo.Memory"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 225
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 226
.end local v0 #intent:Landroid/content/Intent;
:cond_c
const-string v2, "language_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_d
.line 227
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 228
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.LanguageSettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 229
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 230
.end local v0 #intent:Landroid/content/Intent;
:cond_d
const-string v2, "accessibility_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_e
.line 231
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 232
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.AccessibilitySettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 234
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 235
.end local v0 #intent:Landroid/content/Intent;
:cond_e
const-string v2, "date_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_f
.line 236
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 237
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.DateTimeSettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 238
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 239
.end local v0 #intent:Landroid/content/Intent;
:cond_f
const-string v2, "power_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_10
.line 240
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 241
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.schpwronoff.AlarmClock"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 243
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 244
.end local v0 #intent:Landroid/content/Intent;
:cond_10
const-string v2, "about_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_11
.line 245
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 246
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.DeviceInfoSettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 247
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 248
.end local v0 #intent:Landroid/content/Intent;
:cond_11
const-string v2, "voice_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_12
.line 249
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 250
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.VoiceInputOutputSettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 252
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.line 253
.end local v0 #intent:Landroid/content/Intent;
:cond_12
const-string v2, "dock_settings"
invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
.line 254
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
.line 255
.restart local v0 #intent:Landroid/content/Intent;
const-string v2, "com.android.settings"
const-string v2, "com.android.settings.DockSettings"
invoke-virtual {v0, v3, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 256
invoke-virtual {p2, v0}, Landroid/preference/Preference;->setIntent(Landroid/content/Intent;)V
goto/16 :goto_0
.end method
can anyone please help me?..my phone runs on gingerbread 2.3.6 os version..please help me with the codes..thanks!
help please..still can't find the right dalvik code to use..T_T
help anyone?
I trying to edit my date format in smali file to a custom date format like day & month (without year), this is the method code
.method private getTimeText()[Ljava/lang/String;
.locals 10
.prologue
const/16 v5, 0xc
const/4 v9, 0x1
.line 110
invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;
move-result-object v0
.line 111
.local v0, calendar:Ljava/util/Calendar;
invoke-virtual {v0}, Ljava/util/Calendar;->getTime()Ljava/util/Date;
move-result-object v1
.line 112
.local v1, date:Ljava/util/Date;
invoke-virtual {v0, v5}, Ljava/util/Calendar;->get(I)I
move-result v3
.line 113
.local v3, min:I
const/16 v4, 0xb
invoke-virtual {v0, v4}, Ljava/util/Calendar;->get(I)I
move-result v2
.line 114
.local v2, hour:I
if-le v2, v5, :cond_0
iget-object v4, p0, Lcom/android/systemui/statusbar/StatusBarJellyHeaderView;->context:Landroid/content/Context;
invoke-static {v4}, Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/ContextZ
move-result v4
if-eq v4, v9, :cond_0
.line 115
add-int/lit8 v2, v2, -0xc
.line 116
:cond_0
const/4 v4, 0x2
new-array v4, v4, [Ljava/lang/String;
const/4 v5, 0x0
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v6, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v6
const-string v7, ":"
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v6
const/16 v7, 0x9
if-le v3, v7, :cond_1
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v7
:goto_0
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/ObjectLjava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
aput-object v6, v4, v5
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "EEEE"
invoke-static {v6, v1}, Landroid/text/format/DateFormat;->format(Ljava/lang/CharSequence;Ljava/util/DateLjava/lang/CharSequence;
move-result-object v6
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/ObjectLjava/lang/StringBuilder;
move-result-object v5
const-string v6, "\n"
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v5
iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarJellyHeaderView;->context:Landroid/content/Context;
invoke-static {v6}, Landroid/text/format/DateFormat;->getLongDateFormat(Landroid/content/ContextLjava/text/DateFormat;
move-result-object v6
invoke-virtual {v6, v1}, Ljava/text/DateFormat;->format(Ljava/util/DateLjava/lang/String;
move-result-object v6
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/String;->toUpperCase()Ljava/lang/String;
move-result-object v5
aput-object v5, v4, v9
return-object v4
:cond_1
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
const-string v8, "0"
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
goto :goto_0
.end method
I have edited getLongDateFormat to getMediumDateFormat but this is no look good, someone help me to make this customized?
Thanks
I do not speak English.
I want to remove XPERIA Home launcher animation.
Click to open the APP animation.
How do I modify this code?
com.sonyericsson.home 6.2.1.A.0.7
\smali\com\sonymobile\home\presenter\view\ActivityItemView.smali
# virtual methods
.method protected doHandleClick(Landroid/content/ContextZ
.locals 9
.parameter "context"
.prologue
const/4 v5, 0x0
.line 52
invoke-virtual {p0}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getItem()Lcom/sonymobile/home/data/Item;
move-result-object v6
invoke-virtual {v6}, Lcom/sonymobile/home/data/Item;->getIntent()Landroid/content/Intent;
move-result-object v2
.line 53
.local v2, intent:Landroid/content/Intent;
if-eqz v2, :cond_0
.line 59
:try_start_0
invoke-virtual {p0}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getWorldX()F
move-result v6
const/4 v7, 0x0
invoke-virtual {p0, v7}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getPointX(F)F
move-result v7
add-float/2addr v6, v7
float-to-int v3, v6
.line 60
.local v3, x:I
invoke-virtual {p0}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getWorldY()F
move-result v6
const/4 v7, 0x0
invoke-virtual {p0, v7}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getPointY(F)F
move-result v7
add-float/2addr v6, v7
float-to-int v4, v6
.line 61
.local v4, y:I
iget-object v6, p0, Lcom/sonymobile/flix/components/Component;->mScene:Lcom/sonymobile/flix/components/Scene;
invoke-virtual {v6}, Lcom/sonymobile/flix/components/Scene;->getView()Landroid/view/View;
move-result-object v6
invoke-virtual {p0}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getWidth()F
move-result v7
float-to-int v7, v7
invoke-virtual {p0}, Lcom/sonymobile/home/presenter/view/ActivityItemView;->getHeight()F
move-result v8
float-to-int v8, v8
invoke-static {v6, v3, v4, v7, v8}, Landroid/app/ActivityOptions;->makeScaleUpAnimation(Landroid/view/View;IIII)Landroid/app/ActivityOptions;
move-result-object v6
invoke-virtual {v6}, Landroid/app/ActivityOptions;->toBundle()Landroid/os/Bundle;
move-result-object v0
.line 65
.local v0, bundle:Landroid/os/Bundle;
const/high16 v6, 0x1000
invoke-virtual {v2, v6}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;
.line 66
const/high16 v6, 0x20
invoke-virtual {v2, v6}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;
.line 68
invoke-virtual {p1, v2, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;Landroid/os/BundleV
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 75
const/4 v5, 0x1
.line 78
.end local v0 #bundle:Landroid/os/Bundle;
.end local v3 #x:I
.end local v4 #y:I
:cond_0
:goto_0
return v5
.line 69
:catch_0
move-exception v1
.line 70
.local v1, e:Ljava/lang/Exception;
const v6, 0x7f06001b
invoke-static {p1, v6, v5}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;
move-result-object v6
invoke-virtual {v6}, Landroid/widget/Toast;->show()V
goto :goto_0
.end method
Click to expand...
Click to collapse
Hello XDA again,
Maybe many of you knew me before, especially my work on secure folder for rooted note 5.
I currently own Note 8 rooted.
Many devs said that Samsung introduced TEE and because of that we can not use secure folder again.
After spending a lot of time on investigating, patching both old and new lib, apk, framework, services I figured that actually Secure Folder is currently not related to TEE. Samsung just patched by code then we can bypass their patch to use Secure Folder in custom rooted rom.
How:
A. FOR PIE ROM
I. Include all Knox related things in your rom.
II. Patch build.prop:
change ro.config.iccc_version=3.0 to
ro.config.iccc_version=iccc_disabled
De-compile new SecureFolder.apk show that it uses Iccc (IntegrityControlCheckCenter) to check system integrity status (device_status). If it's ok, SecureFolder.apk will create container. Old SecureFolder.apk did not use that check.
Patch libtz_iccc.so is difficult so that just bypass this check by above patch.
III. Patch services.jar
Lcom/samsung/android/knox/SemPersonaManager is personal manager for knox related things. If device is compromised then Lcom/samsung/android/knox/SemPersonaManager will set persona's attribute to 0x4 and securefolder container will be uninstalled.
Check this code in Lcom/android/server/pm/PersonaManagerService:
Code:
iget-object v11, p0, Lcom/android/server/pm/PersonaManagerService;->mContext:Landroid/content/Context;
invoke-static {v11}, Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/Context;)Z
move-result v11
if-nez v11, :cond_2
.line 1345
const-string v11, "PersonaManagerService"
const-string v12, "Device compromise detected !"
invoke-static {v11, v12}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 1346
[COLOR="DarkOrange"] invoke-static {v10, v9}, Lcom/samsung/android/knox/SemPersonaManager;->setAttributes(II)Z[/COLOR]
move-result v10
if-nez v10, :cond_3
.line 1347
const-string v10, "PersonaManagerService"
const-string/jumbo v11, "setting compromise attribute failed !"
invoke-static {v10, v11}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_2
.line 1349
:cond_2
invoke-virtual {v8}, Landroid/content/pm/UserInfo;->isSuperLocked()Z
move-result v10
if-eqz v10, :cond_3
.line 1350
const-string v10, "PersonaManagerService"
const-string v11, "Device is super locked - start lock screen"
invoke-static {v10, v11}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 1354
.end local v8 # "ui":Landroid/content/pm/UserInfo;
:cond_3
:goto_2
iget-object v8, p0, Lcom/android/server/pm/PersonaManagerService;->mContext:Landroid/content/Context;
invoke-static {v8}, Lcom/samsung/android/knox/SemPersonaManager;->isKioskModeEnabled(Landroid/content/Context;)Z
move-result v8
if-eqz v8, :cond_4
.line 1355
iget-object v8, p0, Lcom/android/server/pm/PersonaManagerService;->mContext:Landroid/content/Context;
invoke-static {v8}, Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/Context;)Z
move-result v8
const/4 v8, 0x1
if-nez v8, :cond_4
.line 1356
invoke-direct {p0}, Lcom/android/server/pm/PersonaManagerService;->getPersonaManager()Lcom/samsung/android/knox/SemPersonaManager;
move-result-object v8
invoke-virtual {v8}, Lcom/samsung/android/knox/SemPersonaManager;->getKioskId()I
move-result v8
[COLOR="darkorange"] invoke-static {v8, v9}, Lcom/samsung/android/knox/SemPersonaManager;->setAttributes(II)Z[/COLOR]
move-result v8
if-nez v8, :cond_4
.line 1357
const-string v8, "PersonaManagerService"
const-string/jumbo v9, "setting compromise attribute failed !!"
invoke-static {v8, v9}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 1362
:cond_4
return-void
and this code in Lcom/android/server/pm/PersonaServiceHelper
Code:
.method public static shouldBlockUserStart(Landroid/content/Context;I)Z
.locals 7
.param p0, "c" # Landroid/content/Context;
.param p1, "userId" # I
.line 934
invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J
move-result-wide v0
.line 936
.local v0, "token":J
:try_start_0
const-string v2, "PersonaServiceHelper"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v4, "shouldBlockUserStart() "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 937
invoke-static {}, Lcom/android/server/pm/PersonaServiceHelper;->getUserManager()Lcom/android/server/pm/UserManagerService;
move-result-object v2
invoke-virtual {v2, p1}, Lcom/android/server/pm/UserManagerService;->getUserInfo(I)Landroid/content/pm/UserInfo;
move-result-object v2
.line 938
.local v2, "uinfo":Landroid/content/pm/UserInfo;
if-eqz v2, :cond_2
.line 939
invoke-virtual {v2}, Landroid/content/pm/UserInfo;->isManagedProfile()Z
move-result v3
const/4 v4, 0x1
if-eqz v3, :cond_0
.line 940
invoke-static {p0}, Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/Context;)Z
move-result v3
if-nez v3, :cond_0
.line 941
[COLOR="darkorange"] const/4 v3, 0x4
invoke-static {p1, v3}, Lcom/samsung/android/knox/SemPersonaManager;->setAttributes(II)Z[/COLOR]
.line 942
const-string v3, "PersonaServiceHelper"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "Device compromise attribute set for user : "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v3, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 943
iget v3, v2, Landroid/content/pm/UserInfo;->id:I
if-eqz v3, :cond_0
.line 944
const-string v3, "PersonaServiceHelper"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "blocking when device compromised "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v3, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 945
nop
.line 963
invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V
.line 945
return v4
.line 950
:cond_0
:try_start_1
iget v3, v2, Landroid/content/pm/UserInfo;->id:I
if-eqz v3, :cond_1
invoke-virtual {v2}, Landroid/content/pm/UserInfo;->isManagedProfile()Z
move-result v3
if-eqz v3, :cond_1
invoke-virtual {v2}, Landroid/content/pm/UserInfo;->isDeviceCompromised()Z
move-result v3
if-eqz v3, :cond_1
.line 951
const-string v3, "PersonaServiceHelper"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "blocking when device compromised : "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v3, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 952
nop
.line 963
invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V
.line 952
return v4
.line 955
:cond_1
:try_start_2
invoke-virtual {v2}, Landroid/content/pm/UserInfo;->isSuperLocked()Z
move-result v3
if-eqz v3, :cond_2
invoke-static {p1}, Lcom/samsung/android/knox/SemPersonaManager;->isLegacyClId(I)Z
move-result v3
if-eqz v3, :cond_2
.line 956
const-string v3, "PersonaServiceHelper"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "blocking non-BYOD super locked user "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v3, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
.line 957
nop
.line 963
invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V
.line 957
return v4
.line 961
:cond_2
const/4 v3, 0x0
.line 963
invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V
.line 961
return v3
.line 963
.end local v2 # "uinfo":Landroid/content/pm/UserInfo;
:catchall_0
move-exception v2
invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V
throw v2
.end method
Then we can bypass those things by several way:
1. Delete those Lcom/samsung/android/knox/SemPersonaManager;->setAttributes(II)Z lines
2. Patch Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/ContextZ so that it returns true. But this way may cause other issues related to tima.
3. Just add simple code like below:
Code:
invoke-static {v11}, Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/Context;)Z
move-result v11
[COLOR="DarkOrange"] const/4 v11, 0x1[/COLOR]
if-nez v11, :cond_2
Better use the third way.
IV. Patch method isUnifiedKeyStoreSupported in Lcom/android/server/locksettings/SyntheticPasswordManager so that it return true, by two way:
1. Simply add that line (from S10 firmware to system/etc/floating_features.xml:
<SEC_FLOATING_FEATURE_KNOX_SUPPORT_UKS>TRUE</SEC_FLOATING_FEATURE_KNOX_SUPPORT_UKS>
2. Modify smali file.
V. If your rom is a ported rom. You should replace services\smali_classes3\com\android\server\enterpr ise\ccm from stock services.jar.
VI. Recompile services.jar and enjoy secure folder.
B. FOR OREO ROM
I. Include all Knox related things in your rom.
II. Patch build.prop:
change ro.config.iccc_version=3.0 to
ro.config.iccc_version=iccc_disabled
De-compile new SecureFolder.apk show that it uses Iccc (IntegrityControlCheckCenter) to check system integrity status (device_status). If it's ok, SecureFolder.apk will create container. Old SecureFolder.apk did not use that check.
Patch libtz_iccc.so is difficult so that just bypass this check by above patch.
III. Patch services.jar
Lcom/samsung/android/knox/SemPersonaManager is personal manager for knox related things. If device is compromised then Lcom/samsung/android/knox/SemPersonaManager will set persona's attribute to 0x4 and securefolder container will be uninstalled.
Check this code in Lcom/android/server/pm/PersonaManagerService:
Code:
iget-object v11, p0, Lcom/android/server/pm/PersonaManagerService;->mContext:Landroid/content/Context;
invoke-static {v11}, Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/Context;)Z
move-result v11
if-nez v11, :cond_2
.line 1345
const-string v11, "PersonaManagerService"
const-string v12, "Device compromise detected !"
invoke-static {v11, v12}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 1346
[COLOR="DarkOrange"] invoke-static {v10, v9}, Lcom/samsung/android/knox/SemPersonaManager;->setAttributes(II)Z[/COLOR]
move-result v10
if-nez v10, :cond_3
.line 1347
const-string v10, "PersonaManagerService"
const-string/jumbo v11, "setting compromise attribute failed !"
invoke-static {v10, v11}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_2
.line 1349
:cond_2
invoke-virtual {v8}, Landroid/content/pm/UserInfo;->isSuperLocked()Z
move-result v10
if-eqz v10, :cond_3
.line 1350
const-string v10, "PersonaManagerService"
const-string v11, "Device is super locked - start lock screen"
invoke-static {v10, v11}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 1354
.end local v8 # "ui":Landroid/content/pm/UserInfo;
:cond_3
:goto_2
iget-object v8, p0, Lcom/android/server/pm/PersonaManagerService;->mContext:Landroid/content/Context;
invoke-static {v8}, Lcom/samsung/android/knox/SemPersonaManager;->isKioskModeEnabled(Landroid/content/Context;)Z
move-result v8
if-eqz v8, :cond_4
.line 1355
iget-object v8, p0, Lcom/android/server/pm/PersonaManagerService;->mContext:Landroid/content/Context;
invoke-static {v8}, Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/Context;)Z
move-result v8
const/4 v8, 0x1
if-nez v8, :cond_4
.line 1356
invoke-direct {p0}, Lcom/android/server/pm/PersonaManagerService;->getPersonaManager()Lcom/samsung/android/knox/SemPersonaManager;
move-result-object v8
invoke-virtual {v8}, Lcom/samsung/android/knox/SemPersonaManager;->getKioskId()I
move-result v8
[COLOR="darkorange"] invoke-static {v8, v9}, Lcom/samsung/android/knox/SemPersonaManager;->setAttributes(II)Z[/COLOR]
move-result v8
if-nez v8, :cond_4
.line 1357
const-string v8, "PersonaManagerService"
const-string/jumbo v9, "setting compromise attribute failed !!"
invoke-static {v8, v9}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 1362
:cond_4
return-void
and this code in Lcom/android/server/pm/PersonaServiceHelper
Code:
.method public static shouldBlockUserStart(Landroid/content/Context;I)Z
.locals 7
.param p0, "c" # Landroid/content/Context;
.param p1, "userId" # I
.line 934
invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J
move-result-wide v0
.line 936
.local v0, "token":J
:try_start_0
const-string v2, "PersonaServiceHelper"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v4, "shouldBlockUserStart() "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 937
invoke-static {}, Lcom/android/server/pm/PersonaServiceHelper;->getUserManager()Lcom/android/server/pm/UserManagerService;
move-result-object v2
invoke-virtual {v2, p1}, Lcom/android/server/pm/UserManagerService;->getUserInfo(I)Landroid/content/pm/UserInfo;
move-result-object v2
.line 938
.local v2, "uinfo":Landroid/content/pm/UserInfo;
if-eqz v2, :cond_2
.line 939
invoke-virtual {v2}, Landroid/content/pm/UserInfo;->isManagedProfile()Z
move-result v3
const/4 v4, 0x1
if-eqz v3, :cond_0
.line 940
invoke-static {p0}, Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/Context;)Z
move-result v3
if-nez v3, :cond_0
.line 941
[COLOR="darkorange"] const/4 v3, 0x4
invoke-static {p1, v3}, Lcom/samsung/android/knox/SemPersonaManager;->setAttributes(II)Z[/COLOR]
.line 942
const-string v3, "PersonaServiceHelper"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "Device compromise attribute set for user : "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v3, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 943
iget v3, v2, Landroid/content/pm/UserInfo;->id:I
if-eqz v3, :cond_0
.line 944
const-string v3, "PersonaServiceHelper"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "blocking when device compromised "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v3, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 945
nop
.line 963
invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V
.line 945
return v4
.line 950
:cond_0
:try_start_1
iget v3, v2, Landroid/content/pm/UserInfo;->id:I
if-eqz v3, :cond_1
invoke-virtual {v2}, Landroid/content/pm/UserInfo;->isManagedProfile()Z
move-result v3
if-eqz v3, :cond_1
invoke-virtual {v2}, Landroid/content/pm/UserInfo;->isDeviceCompromised()Z
move-result v3
if-eqz v3, :cond_1
.line 951
const-string v3, "PersonaServiceHelper"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "blocking when device compromised : "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v3, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 952
nop
.line 963
invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V
.line 952
return v4
.line 955
:cond_1
:try_start_2
invoke-virtual {v2}, Landroid/content/pm/UserInfo;->isSuperLocked()Z
move-result v3
if-eqz v3, :cond_2
invoke-static {p1}, Lcom/samsung/android/knox/SemPersonaManager;->isLegacyClId(I)Z
move-result v3
if-eqz v3, :cond_2
.line 956
const-string v3, "PersonaServiceHelper"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "blocking non-BYOD super locked user "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v5, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v3, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
.line 957
nop
.line 963
invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V
.line 957
return v4
.line 961
:cond_2
const/4 v3, 0x0
.line 963
invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V
.line 961
return v3
.line 963
.end local v2 # "uinfo":Landroid/content/pm/UserInfo;
:catchall_0
move-exception v2
invoke-static {v0, v1}, Landroid/os/Binder;->restoreCallingIdentity(J)V
throw v2
.end method
Check this code in KnoxMUMContainerPolicy
Code:
invoke-static {v5}, Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/ContextZ
move-result v5
if-nez v5, :cond_0
Then we can bypass those things by several way:
1. Delete those Lcom/samsung/android/knox/SemPersonaManager;->setAttributes(II)Z lines
2. Patch Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/ContextZ so that it returns true. But this way may cause other issues related to tima.
3. Just add simple code like below:
Code:
invoke-static {v11}, Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/Context;)Z
move-result v11
[COLOR="DarkOrange"] const/4 v11, 0x1[/COLOR]
if-nez v11, :cond_2
Code:
invoke-static {v5}, Lcom/android/server/pm/PersonaServiceHelper;->isTimaAvailable(Landroid/content/ContextZ
move-result v5
[COLOR="DarkOrange"] const/4 v5, 0x1[/COLOR]
if-nez v5, :cond_0
Better use the third way.
IV. Patch method isUnifiedKeyStoreSupported in Lcom/android/server/locksettings/SyntheticPasswordManager so that it return true, by two way:
1. Simply add that line (from S10 firmware to system/etc/floating_features.xml:
<SEC_FLOATING_FEATURE_KNOX_SUPPORT_UKS>TRUE</SEC_FLOATING_FEATURE_KNOX_SUPPORT_UKS>
2. Modify smali file.
V. Mod KnoxFileHandler
In Oreo Samsung forced using tima to store, retrive and delete encryptkey. But in Pie they changed to use KeyProtector. So that we will mod KnoxFileHandler. Compare modded one to stock one in attached to find out what need to be changed.
VI. If your rom is a ported rom. You should replace services\smali_classes3\com\android\server\enterpr ise\ccm from stock services.jar.
VII. Recompile services.jar and enjoy secure folder.
PS:
VII. SamsungPay and SamsungPass still use TEE, their own trustlets and use samsung server to check, store hash code. I will try to investigate deeper on those apk if I have time.
This is great to see, ive been curious on how you fixed SS back on Note 5 nougat for a while now, ill give it a go on my N5 running pie.
Thanks for sharing :good: god bless
Nice find mate,Keep it up
Nice finding mate, can i try the implement this method on @ananjaser1211 's Refined Nougat for N4? ?
Is great, but I don't know how to do it ?
nice !Good job!!!
Massive thanks mate!
Great! @khongloi113 welcome back!
Nicee
Great job mate, working perfect... View attachment 4794516
Sent from my SM-N950F using Tapatalk
Can someone just post the edited secure folder because i dont know how to even decompile it?
SHKOMAGDID said:
Can someone just post the edited secure folder because i dont know how to even decompile it
Click to expand...
Click to collapse
Secure Folder doesn't needs to be edited...
AbrahamGC said:
Secure Folder doesn't needs to be edited...
Click to expand...
Click to collapse
So why it didnt work i just edited the build.prop then what should i do?
SHKOMAGDID said:
So why it didnt work i just edited the build.prop then what should i do?
Click to expand...
Click to collapse
There is only 2 files to edit on the guide, build.prop and services.jar, is not much long to read...
Add back knox files you debloated (idk exactly which are required and which not, for testing I just added all knox stuff), edit prop, edit services, and done :good:
AbrahamGC said:
There is only 2 files to edit on the guide, build.prop and services.jar, is not much long to read...
Add back knox files you debloated (idk exactly which are required and which not, for testing I just added all knox stuff), edit prop, edit services, and done :good:
Click to expand...
Click to collapse
And heres the problem i dont know how to edit it maybe any guides?
What's tools you use decompile service.jar?
sazuke0703 said:
What's tools you use decompile service.jar?
Click to expand...
Click to collapse
Apktool
khongloi113 said:
Apktool
Click to expand...
Click to collapse
Link apk tool please I decompile has eror.
Can anyone please share their edited Service.jar?
AbrahamGC said:
Great job mate, working perfect...
Click to expand...
Click to collapse
Did you patch via option III.? I.e. just adding the line, or which way?