Related
I need a help to create a toggle slide button like the one in the instagram android app. With smaliToJava tool i got the code, but, some methods came very messy.
If we succeed, we may create a github project for everyone who want use this feature too //Sorry about the english
Smali2Java Code:
Code:
package com.instagram.ui.widget.switchbutton;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.ViewConfiguration;
import android.view.ViewParent;
import android.widget.CompoundButton;
public class IgSwitch
extends CompoundButton
{
private Drawable a;
private Drawable b;
private Drawable c;
private Rect d = new Rect();
private int e;
private float f;
private int g;
private VelocityTracker h;
private float i;
private float j;
private int k;
private int l;
private int m;
private boolean n;
public IgSwitch(Context paramContext)
{
super(paramContext);
a();
}
public IgSwitch(Context paramContext, AttributeSet paramAttributeSet)
{
super(paramContext, paramAttributeSet);
a();
}
public IgSwitch(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
super(paramContext, paramAttributeSet, paramInt);
a();
}
private void a()
{
setClickable(true);
ViewConfiguration localViewConfiguration = ViewConfiguration.get(getContext());
this.l = localViewConfiguration.getScaledTouchSlop();
this.m = localViewConfiguration.getScaledMinimumFlingVelocity();
this.a = getResources().getDrawable(R.drawable.toggle);
this.b = getResources().getDrawable(R.drawable.toggle_active);
this.c = getResources().getDrawable(R.drawabletoggle_nub);
this.e = this.c.getIntrinsicWidth();
this.g = (this.a.getIntrinsicWidth() - this.e);
}
private void a(MotionEvent paramMotionEvent)
{
MotionEvent localMotionEvent = MotionEvent.obtain(paramMotionEvent);
localMotionEvent.setAction(3);
super.onTouchEvent(localMotionEvent);
localMotionEvent.recycle();
}
private void a(boolean paramBoolean)
{
this.n = true;
setChecked(paramBoolean);
}
private boolean a(float paramFloat1, float paramFloat2)
{
int i1 = getPaddingTop() - this.l;
int i2 = (int)(getPaddingLeft() + (0.5F + this.f) - this.l);
int i3 = i2 + this.e + 2 * this.l;
int i4 = i1 + this.c.getIntrinsicHeight() + 2 * this.l;
return (paramFloat1 > i2) && (paramFloat1 < i3) && (paramFloat2 > i1) && (paramFloat2 < i4);
}
[COLOR="Red"] private void b(MotionEvent paramMotionEvent)
{
int i1 = 1;
this.k = 0;
if ((paramMotionEvent.getAction() == i1) && (isEnabled()))
{
int i2 = i1;
a(paramMotionEvent);
if (i2 == 0) {
break label97;
}
this.h.computeCurrentVelocity(1000);
float f1 = this.h.getXVelocity();
if (Math.abs(f1) <= this.m) {
break label89;
}
if (f1 <= 0.0F) {
break label84;
}
}
for (;;)
{
a(i1);
return;
int i3 = 0;
break;
label84:
boolean bool = false;
continue;
label89:
bool = getTargetCheckedState();
}
label97:
a(isChecked());
}[/COLOR]
private boolean getTargetCheckedState()
{
return this.f >= this.g / 2;
}
protected void onDetachedFromWindow()
{
super.onDetachedFromWindow();
if (this.h != null)
{
this.h.recycle();
this.h = null;
}
}
protected void onDraw(Canvas paramCanvas)
{
super.onDraw(paramCanvas);
float f1 = this.f / this.g;
this.b.setAlpha((int)(f1 * 255.0F));
this.a.draw(paramCanvas);
this.b.draw(paramCanvas);
int i1 = (int)(0.5F + this.f);
this.c.setBounds(i1 + getPaddingLeft(), getPaddingTop(), i1 + this.e + getPaddingLeft(), getPaddingTop() + this.c.getIntrinsicHeight());
this.c.draw(paramCanvas);
}
[COLOR="Red"] protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
super.onLayout(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4);
this.d.set(getPaddingLeft(), getPaddingTop(), this.a.getIntrinsicWidth() + getPaddingLeft(), this.a.getIntrinsicHeight() + getPaddingTop());
this.a.setBounds(this.d);
this.b.setBounds(this.d);
if (isChecked()) {}
for (float f1 = this.g;; f1 = 0.0F)
{
this.f = f1;
return;
}
}[/COLOR]
protected void onMeasure(int paramInt1, int paramInt2)
{
setMeasuredDimension(this.b.getIntrinsicWidth() + getPaddingLeft() + getPaddingRight(), this.b.getIntrinsicHeight() + getPaddingTop() + getPaddingBottom());
}
[COLOR="red"] public boolean onTouchEvent(MotionEvent paramMotionEvent)
{
int i1 = 1;
if (this.h == null) {
this.h = VelocityTracker.obtain();
}
this.h.addMovement(paramMotionEvent);
switch (paramMotionEvent.getActionMasked())
{
}
for (;;)
{
i1 = super.onTouchEvent(paramMotionEvent);
float f1;
float f2;
do
{
return i1;
float f5 = paramMotionEvent.getX();
float f6 = paramMotionEvent.getY();
if ((!isEnabled()) || (!a(f5, f6))) {
break;
}
this.k = i1;
this.i = f5;
this.j = f6;
break;
switch (this.k)
{
case 0:
default:
break;
case 1:
float f3 = paramMotionEvent.getX();
float f4 = paramMotionEvent.getY();
if ((Math.abs(f3 - this.i) <= this.l) && (Math.abs(f4 - this.j) <= this.l)) {
break;
}
this.k = 2;
getParent().requestDisallowInterceptTouchEvent(i1);
this.i = f3;
this.j = f4;
return i1;
case 2:
f1 = paramMotionEvent.getX();
f2 = Math.max(0.0F, Math.min(f1 - this.i + this.f, this.g));
}
} while (f2 == this.f);
this.f = f2;
this.i = f1;
invalidate();
return i1;
if (this.k == 2)
{
b(paramMotionEvent);
return i1;
}
this.k = 0;
this.h.clear();
this.h.recycle();
this.h = null;
}
}[/COLOR]
public boolean performClick()
{
this.n = true;
return super.performClick();
}
[COLOR="Red"] public void setChecked(boolean paramBoolean)
{
super.setChecked(paramBoolean);
int i1;
if (paramBoolean)
{
i1 = this.g;
if ((!this.n) || (getWindowToken() == null)) {
break label62;
}
clearAnimation();
startAnimation(new b(this, this.f, i1, null));
}
for (;;)
{
this.n = false;
return;
i1 = 0;
break;
label62:
this.f = i1;
invalidate();
}
}[/COLOR]
}
Smali Code:
Code:
.class public Lcom/instagram/ui/widget/switchbutton/IgSwitch;
.super Landroid/widget/CompoundButton;
.source "IgSwitch.java"
# instance fields
.field private a:Landroid/graphics/drawable/Drawable;
.field private b:Landroid/graphics/drawable/Drawable;
.field private c:Landroid/graphics/drawable/Drawable;
.field private d:Landroid/graphics/Rect;
.field private e:I
.field private f:F
.field private g:I
.field private h:Landroid/view/VelocityTracker;
.field private i:F
.field private j:F
.field private k:I
.field private l:I
.field private m:I
.field private n:Z
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 1
.parameter "context"
.prologue
.line 56
invoke-direct {p0, p1}, Landroid/widget/CompoundButton;-><init>(Landroid/content/Context;)V
.line 33
new-instance v0, Landroid/graphics/Rect;
invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V
iput-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->d:Landroid/graphics/Rect;
.line 57
invoke-direct {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a()V
.line 58
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 1
.parameter "context"
.parameter "attrs"
.prologue
.line 61
invoke-direct {p0, p1, p2}, Landroid/widget/CompoundButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.line 33
new-instance v0, Landroid/graphics/Rect;
invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V
iput-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->d:Landroid/graphics/Rect;
.line 62
invoke-direct {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a()V
.line 63
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.locals 1
.parameter "context"
.parameter "attrs"
.parameter "defStyle"
.prologue
.line 66
invoke-direct {p0, p1, p2, p3}, Landroid/widget/CompoundButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.line 33
new-instance v0, Landroid/graphics/Rect;
invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V
iput-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->d:Landroid/graphics/Rect;
.line 67
invoke-direct {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a()V
.line 68
return-void
.end method
.method static synthetic a(Lcom/instagram/ui/widget/switchbutton/IgSwitch;F)F
.locals 0
.parameter
.parameter
.prologue
.line 20
iput p1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->f:F
return p1
.end method
.method static synthetic a(Lcom/instagram/ui/widget/switchbutton/IgSwitch;)I
.locals 1
.parameter
.prologue
.line 20
iget v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->g:I
return v0
.end method
.method private a()V
.locals 2
.prologue
.line 71
const/4 v0, 0x1
invoke-virtual {p0, v0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->setClickable(Z)V
.line 73
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getContext()Landroid/content/Context;
move-result-object v0
invoke-static {v0}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;
move-result-object v0
.line 74
invoke-virtual {v0}, Landroid/view/ViewConfiguration;->getScaledTouchSlop()I
move-result v1
iput v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->l:I
.line 75
invoke-virtual {v0}, Landroid/view/ViewConfiguration;->getScaledMinimumFlingVelocity()I
move-result v0
iput v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->m:I
.line 77
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getResources()Landroid/content/res/Resources;
move-result-object v0
sget v1, Lcom/facebook/av;->toggle:I
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v0
iput-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a:Landroid/graphics/drawable/Drawable;
.line 78
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getResources()Landroid/content/res/Resources;
move-result-object v0
sget v1, Lcom/facebook/av;->toggle_active:I
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v0
iput-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->b:Landroid/graphics/drawable/Drawable;
.line 80
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getResources()Landroid/content/res/Resources;
move-result-object v0
sget v1, Lcom/facebook/av;->toggle_nub:I
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
move-result-object v0
iput-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->c:Landroid/graphics/drawable/Drawable;
.line 81
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->c:Landroid/graphics/drawable/Drawable;
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
move-result v0
iput v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->e:I
.line 82
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a:Landroid/graphics/drawable/Drawable;
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
move-result v0
iget v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->e:I
sub-int/2addr v0, v1
iput v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->g:I
.line 83
return-void
.end method
.method private a(Landroid/view/MotionEvent;)V
.locals 2
.parameter
.prologue
.line 254
invoke-static {p1}, Landroid/view/MotionEvent;->obtain(Landroid/view/MotionEvent;)Landroid/view/MotionEvent;
move-result-object v0
.line 255
const/4 v1, 0x3
invoke-virtual {v0, v1}, Landroid/view/MotionEvent;->setAction(I)V
.line 256
invoke-super {p0, v0}, Landroid/widget/CompoundButton;->onTouchEvent(Landroid/view/MotionEvent;)Z
.line 257
invoke-virtual {v0}, Landroid/view/MotionEvent;->recycle()V
.line 258
return-void
.end method
.method private a(Z)V
.locals 1
.parameter
.prologue
.line 288
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->n:Z
.line 289
invoke-virtual {p0, p1}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->setChecked(Z)V
.line 290
return-void
.end method
.method private a(FF)Z
.locals 5
.parameter
.parameter
.prologue
.line 173
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingTop()I
move-result v0
iget v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->l:I
sub-int/2addr v0, v1
.line 174
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingLeft()I
move-result v1
int-to-float v1, v1
iget v2, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->f:F
const/high16 v3, 0x3f00
add-float/2addr v2, v3
add-float/2addr v1, v2
iget v2, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->l:I
int-to-float v2, v2
sub-float/2addr v1, v2
float-to-int v1, v1
.line 175
iget v2, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->e:I
add-int/2addr v2, v1
iget v3, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->l:I
mul-int/lit8 v3, v3, 0x2
add-int/2addr v2, v3
.line 176
iget-object v3, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->c:Landroid/graphics/drawable/Drawable;
invoke-virtual {v3}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result v3
add-int/2addr v3, v0
iget v4, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->l:I
mul-int/lit8 v4, v4, 0x2
add-int/2addr v3, v4
.line 177
int-to-float v1, v1
cmpl-float v1, p1, v1
if-lez v1, :cond_0
int-to-float v1, v2
cmpg-float v1, p1, v1
if-gez v1, :cond_0
int-to-float v0, v0
cmpl-float v0, p2, v0
if-lez v0, :cond_0
int-to-float v0, v3
cmpg-float v0, p2, v0
if-gez v0, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method private b(Landroid/view/MotionEvent;)V
.locals 5
.parameter
.prologue
const/4 v1, 0x1
const/4 v2, 0x0
.line 266
iput v2, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->k:I
.line 268
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v0
if-ne v0, v1, :cond_0
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->isEnabled()Z
move-result v0
if-eqz v0, :cond_0
move v0, v1
.line 270
:goto_0
invoke-direct {p0, p1}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a(Landroid/view/MotionEvent;)V
.line 272
if-eqz v0, :cond_3
.line 274
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->h:Landroid/view/VelocityTracker;
const/16 v3, 0x3e8
invoke-virtual {v0, v3}, Landroid/view/VelocityTracker;->computeCurrentVelocity(I)V
.line 275
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->h:Landroid/view/VelocityTracker;
invoke-virtual {v0}, Landroid/view/VelocityTracker;->getXVelocity()F
move-result v0
.line 276
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
move-result v3
iget v4, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->m:I
int-to-float v4, v4
cmpl-float v3, v3, v4
if-lez v3, :cond_2
.line 277
const/4 v3, 0x0
cmpl-float v0, v0, v3
if-lez v0, :cond_1
.line 281
:goto_1
invoke-direct {p0, v1}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a(Z)V
.line 285
:goto_2
return-void
:cond_0
move v0, v2
.line 268
goto :goto_0
:cond_1
move v1, v2
.line 277
goto :goto_1
.line 279
:cond_2
invoke-direct {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getTargetCheckedState()Z
move-result v1
goto :goto_1
.line 283
:cond_3
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->isChecked()Z
move-result v0
invoke-direct {p0, v0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a(Z)V
goto :goto_2
.end method
.method private getTargetCheckedState()Z
.locals 2
.prologue
.line 293
iget v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->f:F
iget v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->g:I
div-int/lit8 v1, v1, 0x2
int-to-float v1, v1
cmpl-float v0, v0, v1
if-ltz v0, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
# virtual methods
.method protected onDetachedFromWindow()V
.locals 1
.prologue
.line 161
invoke-super {p0}, Landroid/widget/CompoundButton;->onDetachedFromWindow()V
.line 163
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->h:Landroid/view/VelocityTracker;
if-eqz v0, :cond_0
.line 164
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->h:Landroid/view/VelocityTracker;
invoke-virtual {v0}, Landroid/view/VelocityTracker;->recycle()V
.line 165
const/4 v0, 0x0
iput-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->h:Landroid/view/VelocityTracker;
.line 167
:cond_0
return-void
.end method
.method protected onDraw(Landroid/graphics/Canvas;)V
.locals 6
.parameter "canvas"
.prologue
.line 110
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onDraw(Landroid/graphics/Canvas;)V
.line 115
iget v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->f:F
iget v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->g:I
int-to-float v1, v1
div-float/2addr v0, v1
.line 116
iget-object v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->b:Landroid/graphics/drawable/Drawable;
const/high16 v2, 0x437f
mul-float/2addr v0, v2
float-to-int v0, v0
invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V
.line 118
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a:Landroid/graphics/drawable/Drawable;
invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
.line 119
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->b:Landroid/graphics/drawable/Drawable;
invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
.line 124
iget v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->f:F
const/high16 v1, 0x3f00
add-float/2addr v0, v1
float-to-int v0, v0
.line 125
iget-object v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->c:Landroid/graphics/drawable/Drawable;
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingLeft()I
move-result v2
add-int/2addr v2, v0
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingTop()I
move-result v3
iget v4, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->e:I
add-int/2addr v0, v4
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingLeft()I
move-result v4
add-int/2addr v0, v4
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingTop()I
move-result v4
iget-object v5, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->c:Landroid/graphics/drawable/Drawable;
invoke-virtual {v5}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result v5
add-int/2addr v4, v5
invoke-virtual {v1, v2, v3, v0, v4}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
.line 131
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->c:Landroid/graphics/drawable/Drawable;
invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V
.line 132
return-void
.end method
.method protected onLayout(ZIIII)V
.locals 6
.parameter "changed"
.parameter "left"
.parameter "top"
.parameter "right"
.parameter "bottom"
.prologue
.line 144
invoke-super/range {p0 .. p5}, Landroid/widget/CompoundButton;->onLayout(ZIIII)V
.line 146
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->d:Landroid/graphics/Rect;
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingLeft()I
move-result v1
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingTop()I
move-result v2
iget-object v3, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a:Landroid/graphics/drawable/Drawable;
invoke-virtual {v3}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
move-result v3
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingLeft()I
move-result v4
add-int/2addr v3, v4
iget-object v4, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a:Landroid/graphics/drawable/Drawable;
invoke-virtual {v4}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result v4
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingTop()I
move-result v5
add-int/2addr v4, v5
invoke-virtual {v0, v1, v2, v3, v4}, Landroid/graphics/Rect;->set(IIII)V
.line 153
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a:Landroid/graphics/drawable/Drawable;
iget-object v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->d:Landroid/graphics/Rect;
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setBounds(Landroid/graphics/Rect;)V
.line 154
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->b:Landroid/graphics/drawable/Drawable;
iget-object v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->d:Landroid/graphics/Rect;
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->setBounds(Landroid/graphics/Rect;)V
.line 156
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->isChecked()Z
move-result v0
if-eqz v0, :cond_0
iget v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->g:I
int-to-float v0, v0
:goto_0
iput v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->f:F
.line 157
return-void
.line 156
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method protected onMeasure(II)V
.locals 3
.parameter "widthMeasureSpec"
.parameter "heightMeasureSpec"
.prologue
.line 136
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->b:Landroid/graphics/drawable/Drawable;
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
move-result v0
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingLeft()I
move-result v1
add-int/2addr v0, v1
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingRight()I
move-result v1
add-int/2addr v0, v1
iget-object v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->b:Landroid/graphics/drawable/Drawable;
invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result v1
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingTop()I
move-result v2
add-int/2addr v1, v2
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getPaddingBottom()I
move-result v2
add-int/2addr v1, v2
invoke-virtual {p0, v0, v1}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->setMeasuredDimension(II)V
.line 140
return-void
.end method
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 6
.parameter "ev"
.prologue
const/4 v5, 0x2
const/4 v0, 0x1
.line 182
iget-object v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->h:Landroid/view/VelocityTracker;
if-nez v1, :cond_0
.line 183
invoke-static {}, Landroid/view/VelocityTracker;->obtain()Landroid/view/VelocityTracker;
move-result-object v1
iput-object v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->h:Landroid/view/VelocityTracker;
.line 186
:cond_0
iget-object v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->h:Landroid/view/VelocityTracker;
invoke-virtual {v1, p1}, Landroid/view/VelocityTracker;->addMovement(Landroid/view/MotionEvent;)V
.line 187
invoke-virtual {p1}, Landroid/view/MotionEvent;->getActionMasked()I
move-result v1
.line 188
packed-switch v1, :pswitch_data_0
.line 250
:cond_1
:goto_0
:pswitch_0
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
:cond_2
:goto_1
return v0
.line 190
:pswitch_1
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v1
.line 191
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v2
.line 192
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->isEnabled()Z
move-result v3
if-eqz v3, :cond_1
invoke-direct {p0, v1, v2}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->a(FF)Z
move-result v3
if-eqz v3, :cond_1
.line 193
iput v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->k:I
.line 194
iput v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->i:F
.line 195
iput v2, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->j:F
goto :goto_0
.line 201
:pswitch_2
iget v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->k:I
packed-switch v1, :pswitch_data_1
goto :goto_0
.line 207
:pswitch_3
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v1
.line 208
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v2
.line 209
iget v3, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->i:F
sub-float v3, v1, v3
invoke-static {v3}, Ljava/lang/Math;->abs(F)F
move-result v3
iget v4, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->l:I
int-to-float v4, v4
cmpl-float v3, v3, v4
if-gtz v3, :cond_3
iget v3, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->j:F
sub-float v3, v2, v3
invoke-static {v3}, Ljava/lang/Math;->abs(F)F
move-result v3
iget v4, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->l:I
int-to-float v4, v4
cmpl-float v3, v3, v4
if-lez v3, :cond_1
.line 211
:cond_3
iput v5, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->k:I
.line 213
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getParent()Landroid/view/ViewParent;
move-result-object v3
invoke-interface {v3, v0}, Landroid/view/ViewParent;->requestDisallowInterceptTouchEvent(Z)V
.line 214
iput v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->i:F
.line 215
iput v2, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->j:F
goto :goto_1
.line 222
:pswitch_4
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v1
.line 223
iget v2, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->i:F
sub-float v2, v1, v2
.line 224
const/4 v3, 0x0
iget v4, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->f:F
add-float/2addr v2, v4
iget v4, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->g:I
int-to-float v4, v4
invoke-static {v2, v4}, Ljava/lang/Math;->min(FF)F
move-result v2
invoke-static {v3, v2}, Ljava/lang/Math;->max(FF)F
move-result v2
.line 225
iget v3, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->f:F
cmpl-float v3, v2, v3
if-eqz v3, :cond_2
.line 226
iput v2, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->f:F
.line 227
iput v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->i:F
.line 228
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->invalidate()V
goto :goto_1
.line 238
:pswitch_5
iget v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->k:I
if-ne v1, v5, :cond_4
.line 239
invoke-direct {p0, p1}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->b(Landroid/view/MotionEvent;)V
goto/16 :goto_1
.line 242
:cond_4
const/4 v0, 0x0
iput v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->k:I
.line 243
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->h:Landroid/view/VelocityTracker;
invoke-virtual {v0}, Landroid/view/VelocityTracker;->clear()V
.line 244
iget-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->h:Landroid/view/VelocityTracker;
invoke-virtual {v0}, Landroid/view/VelocityTracker;->recycle()V
.line 245
const/4 v0, 0x0
iput-object v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->h:Landroid/view/VelocityTracker;
goto/16 :goto_0
.line 188
:pswitch_data_0
.packed-switch 0x0
:pswitch_1
:pswitch_5
:pswitch_2
:pswitch_5
.end packed-switch
.line 201
:pswitch_data_1
.packed-switch 0x0
:pswitch_0
:pswitch_3
:pswitch_4
.end packed-switch
.end method
.method public performClick()Z
.locals 1
.prologue
.line 87
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->n:Z
.line 88
invoke-super {p0}, Landroid/widget/CompoundButton;->performClick()Z
move-result v0
return v0
.end method
.method public setChecked(Z)V
.locals 5
.parameter "checked"
.prologue
const/4 v1, 0x0
.line 93
invoke-super {p0, p1}, Landroid/widget/CompoundButton;->setChecked(Z)V
.line 95
if-eqz p1, :cond_0
iget v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->g:I
.line 97
:goto_0
iget-boolean v2, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->n:Z
if-eqz v2, :cond_1
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->getWindowToken()Landroid/os/IBinder;
move-result-object v2
if-eqz v2, :cond_1
.line 98
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->clearAnimation()V
.line 99
new-instance v2, Lcom/instagram/ui/widget/switchbutton/b;
iget v3, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->f:F
int-to-float v0, v0
const/4 v4, 0x0
invoke-direct {v2, p0, v3, v0, v4}, Lcom/instagram/ui/widget/switchbutton/b;-><init>(Lcom/instagram/ui/widget/switchbutton/IgSwitch;FFLcom/instagram/ui/widget/switchbutton/a;)V
invoke-virtual {p0, v2}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->startAnimation(Landroid/view/animation/Animation;)V
.line 105
:goto_1
iput-boolean v1, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->n:Z
.line 106
return-void
:cond_0
move v0, v1
.line 95
goto :goto_0
.line 101
:cond_1
int-to-float v0, v0
iput v0, p0, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->f:F
.line 102
invoke-virtual {p0}, Lcom/instagram/ui/widget/switchbutton/IgSwitch;->invalidate()V
goto :goto_1
.end method
The button:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
[Q&A] [GUIDE][SMALI]Understanding and Creating Smali Mods & General Smali Questions
Q&A for [GUIDE][SMALI]Understanding and Creating Smali Mods & General Smali Questions
Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.
Before posting, please use the forum search and read through the discussion thread for [GUIDE][SMALI]Understanding and Creating Smali Mods & General Smali Questions. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.
Thanks for understanding and for helping to keep XDA neat and tidy!
Help me. I die inside.
Hello, I'm stuck.
I've managed to copy the smali models and information here (thanks) and elsewhere to insert info into the sharedPreferences database. I'm testing with checkbox booleans.
What I'm trying to do is call these values back in random places in the smali so I can compare if the checkbox is on, do xxx. I'm working within kik8.2.
I am attempting to return the boolean value directly to the chat text so I can visually see the return and understand better how to use the functions.
Here is where the chat is returned:
a/b/a/g.smali
Code:
.class public Lkik/a/b/a/g;
.super Lkik/a/b/a/f;
.source "SourceFile"
# instance fields
.field private a:Ljava/lang/String;
# direct methods
.method public constructor <init>(Ljava/lang/String;)V
.locals 2
.prologue
const/4 v1, 0x1
.line 9
const/16 v0, 0xf
invoke-direct {p0, v1, v1, v1, v0}, Lkik/a/b/a/f;-><init>(IZZI)V
.line 10
iput-object p1, p0, Lkik/a/b/a/g;->a:Ljava/lang/String;
.line 11
return-void
.end method
# virtual methods
.method public final a()Ljava/lang/String;
.locals 1
.prologue
.line 15
iget-object v0, p0, Lkik/a/b/a/g;->a:Ljava/lang/String;
return-object v0
.end method
Now here are some of the things I've tried to do:
Code:
.class public Lkik/a/b/a/g;
.super Lkik/a/b/a/f;
.source "SourceFile"
# instance fields
.field private a:Ljava/lang/String;
[COLOR="Red"]
.field private c:Landroid/content/SharedPreferences;[/COLOR]
# direct methods
.method public constructor <init>(Ljava/lang/String;)V
.locals 2
.prologue
const/4 v1, 0x1
.line 9
const/16 v0, 0xf
invoke-direct {p0, v1, v1, v1, v0}, Lkik/a/b/a/f;-><init>(IZZI)V
.line 10
iput-object p1, p0, Lkik/a/b/a/g;->a:Ljava/lang/String;
.line 11
return-void
.end method
# virtual methods
.method public final a()Ljava/lang/String;
.locals [COLOR="Red"]4[/COLOR]
.prologue
.line 15
[COLOR="Red"] iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
const-string v1, "kik.enterbutton.sends"
const/4 v2, 0x0
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
move-result-object v0
# return v0
#
# iget-object v0, p0, Lkik/a/b/a/g;->a:Ljava/lang/String;[/COLOR]
return-object v0
.end method
logcat shows me I don't have access to /a/a.smali.c->. I'm not very familiar with java so this doesn't exactly help the cause but I've come this far ... so...
This is what is inside /a/a.smali
Code:
.class public Lkik/android/chat/a/a;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field private static final a:Ljava/lang/Long;
# instance fields
.field private b:Lkik/a/h/o;
.field private c:Landroid/content/SharedPreferences;
.field private d:Lkik/a/c/q;
.field private e:Lcom/kik/d/p;
# direct methods
.method static constructor <clinit>()V
.locals 2
.prologue
.line 20
const-wide/16 v0, 0x3e8
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v0
sput-object v0, Lkik/android/chat/a/a;->a:Ljava/lang/Long;
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Lkik/a/h/o;Lcom/kik/d/p;Lkik/a/c/q;)V
.locals 2
.prologue
.line 29
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 26
new-instance v0, Lcom/kik/d/p;
invoke-direct {v0}, Lcom/kik/d/p;-><init>()V
iput-object v0, p0, Lkik/android/chat/a/a;->e:Lcom/kik/d/p;
.line 30
iput-object p2, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
.line 31
const-string v0, "KikPreferences"
const/4 v1, 0x0
invoke-virtual {p1, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object v0
iput-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
.line 32
iput-object p4, p0, Lkik/android/chat/a/a;->d:Lkik/a/c/q;
.line 33
new-instance v0, Lkik/android/chat/a/b;
invoke-direct {v0, p0}, Lkik/android/chat/a/b;-><init>(Lkik/android/chat/a/a;)V
invoke-virtual {p3, v0}, Lcom/kik/d/p;->a(Lcom/kik/d/r;)Lcom/kik/d/r;
.line 40
return-void
.end method
.method static synthetic a(Lkik/android/chat/a/a;)V
.locals 3
.prologue
.line 17
iget-object v0, p0, Lkik/android/chat/a/a;->d:Lkik/a/c/q;
const-string v1, "kik.android.chat.preferences.UserPreferenceManager.restored"
const/4 v2, 0x1
invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v2
invoke-interface {v0, v1, v2}, Lkik/a/c/q;->a(Ljava/lang/String;Ljava/lang/Boolean;)Z
return-void
.end method
.method static synthetic b(Lkik/android/chat/a/a;)Lcom/kik/d/p;
.locals 1
.prologue
.line 17
iget-object v0, p0, Lkik/android/chat/a/a;->e:Lcom/kik/d/p;
return-object v0
.end method
.method private e()Lcom/kik/j/a/j/a;
.locals 2
.prologue
.line 59
new-instance v0, Lcom/kik/j/a/j/a;
invoke-direct {v0}, Lcom/kik/j/a/j/a;-><init>()V
.line 60
invoke-virtual {p0}, Lkik/android/chat/a/a;->a()Z
move-result v1
invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/kik/j/a/j/a;->a(Ljava/lang/Boolean;)Lcom/kik/j/a/j/a;
.line 61
invoke-virtual {p0}, Lkik/android/chat/a/a;->b()Lcom/kik/j/a/j/a$a;
move-result-object v1
invoke-virtual {v0, v1}, Lcom/kik/j/a/j/a;->a(Lcom/kik/j/a/j/a$a;)Lcom/kik/j/a/j/a;
.line 62
return-object v0
.end method
# virtual methods
.method public final a(Lcom/kik/j/a/j/a$a;)V
.locals 4
.prologue
.line 44
if-nez p1, :cond_0
.line 49
:goto_0
return-void
.line 47
:cond_0
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "kik.chat.bubble.id"
iget v2, p1, Lcom/kik/j/a/j/a$a;->w:I
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 48
iget-object v0, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
const-string v1, "user_preferences"
const/4 v2, 0x0
invoke-direct {p0}, Lkik/android/chat/a/a;->e()Lcom/kik/j/a/j/a;
move-result-object v3
invoke-interface {v0, v1, v2, v3}, Lkik/a/h/o;->b(Ljava/lang/String;Ljava/lang/String;Lcom/b/a/n;)Lcom/kik/d/p;
goto :goto_0
.end method
.method public final a(Z)V
.locals 5
.prologue
.line 53
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "kik.enterbutton.sends"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 54
iget-object v0, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
const-string v1, "user_preferences"
const/4 v2, 0x0
invoke-direct {p0}, Lkik/android/chat/a/a;->e()Lcom/kik/j/a/j/a;
move-result-object v3
sget-object v4, Lkik/android/chat/a/a;->a:Ljava/lang/Long;
invoke-interface {v0, v1, v2, v3, v4}, Lkik/a/h/o;->b(Ljava/lang/String;Ljava/lang/String;Lcom/b/a/n;Ljava/lang/Long;)Lcom/kik/d/p;
.line 55
return-void
.end method
.method public final a(Z)V
.locals 5
.prologue
.line 53
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "kik.pikik1"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 54
iget-object v0, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
const-string v1, "user_preferences"
const/4 v2, 0x0
invoke-direct {p0}, Lkik/android/chat/a/a;->e()Lcom/kik/j/a/j/a;
move-result-object v3
sget-object v4, Lkik/android/chat/a/a;->a:Ljava/lang/Long;
invoke-interface {v0, v1, v2, v3, v4}, Lkik/a/h/o;->b(Ljava/lang/String;Ljava/lang/String;Lcom/b/a/n;Ljava/lang/Long;)Lcom/kik/d/p;
.line 55
return-void
.end method
.method public final a(Z)V
.locals 5
.prologue
.line 53
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v0
const-string v1, "kik.pikik2"
invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;
move-result-object v0
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z
.line 54
iget-object v0, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
const-string v1, "user_preferences"
const/4 v2, 0x0
invoke-direct {p0}, Lkik/android/chat/a/a;->e()Lcom/kik/j/a/j/a;
move-result-object v3
sget-object v4, Lkik/android/chat/a/a;->a:Ljava/lang/Long;
invoke-interface {v0, v1, v2, v3, v4}, Lkik/a/h/o;->b(Ljava/lang/String;Ljava/lang/String;Lcom/b/a/n;Ljava/lang/Long;)Lcom/kik/d/p;
.line 55
return-void
.end method
.method public final a()Z
.locals 3
.prologue
.line 67
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
const-string v1, "kik.enterbutton.sends"
const/4 v2, 0x0
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
move-result v0
return v0
.end method
.method public final b()Lcom/kik/j/a/j/a$a;
.locals 3
.prologue
.line 72
iget-object v0, p0, Lkik/android/chat/a/a;->c:Landroid/content/SharedPreferences;
const-string v1, "kik.chat.bubble.id"
const/4 v2, -0x1
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
move-result v0
invoke-static {v0}, Lcom/kik/j/a/j/a$a;->a(I)Lcom/kik/j/a/j/a$a;
move-result-object v0
return-object v0
.end method
.method public final c()V
.locals 3
.prologue
.line 87
iget-object v0, p0, Lkik/android/chat/a/a;->d:Lkik/a/c/q;
const-string v1, "kik.android.chat.preferences.UserPreferenceManager.restored"
invoke-interface {v0, v1}, Lkik/a/c/q;->j(Ljava/lang/String;)Ljava/lang/Boolean;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z
move-result v0
if-eqz v0, :cond_0
.line 89
iget-object v0, p0, Lkik/android/chat/a/a;->e:Lcom/kik/d/p;
invoke-virtual {v0}, Lcom/kik/d/p;->e()V
.line 107
:goto_0
return-void
.line 92
:cond_0
iget-object v0, p0, Lkik/android/chat/a/a;->b:Lkik/a/h/o;
const-string v1, "user_preferences"
const-class v2, Lcom/kik/j/a/j/a;
invoke-interface {v0, v1, v2}, Lkik/a/h/o;->d(Ljava/lang/String;Ljava/lang/Class;)Lcom/kik/d/p;
move-result-object v0
new-instance v1, Lkik/android/chat/a/c;
invoke-direct {v1, p0}, Lkik/android/chat/a/c;-><init>(Lkik/android/chat/a/a;)V
invoke-virtual {v0, v1}, Lcom/kik/d/p;->a(Lcom/kik/d/r;)Lcom/kik/d/r;
goto :goto_0
.end method
.method public final d()Lcom/kik/d/p;
.locals 1
.prologue
.line 111
iget-object v0, p0, Lkik/android/chat/a/a;->e:Lcom/kik/d/p;
return-object v0
.end method
I was successfully able to insert using a.smali function copy and associating it throughout xml and where necessary in the other referencing smali to set its value to 1 before login. The "kik.pikik1" and "kik.pikik2" are the fields I've inserted and I'm trying to read out of the SharedPrefs. Any help is greatly appreciated.
I have tried many things in the g.smali to return the value (1/0, true/false) directly into the chat. Setting as object and regular return. I'm using "enterbuttonsends" because it's native.
Can anyone please help me im a nood at all of this and im not sure which ADB
Notepad ++
A good image editor like Photoshop or GIMP app on the play store will be the best ones that fit listed tools can anyone please help me ???
hello I'm your follower, I wanted to ask if you could explain how you created onclicklistener to change from Celsius to Fahrenheit because I wanted to adapt it to a clock change from analog to digital. I hope you can help me. I await your answer thanks sorry for my english but I'm Italian ... you can also write on telegram @Pirrotto. happy to follow you
Hi there,
It the first time here I'm asking for your help !!
I've learn a lot from these forum but can't find an answer to this question !
I first modify waze to alert about speedcamera whatever you speed (I learn from there http://marin.jb.free.fr/waze/) and then patch waze to enable radar in France!
Since Waze 3.9.9.906 alpha, waze added a signature verification at startup which cause the app to crash if signature is different than original.
I tried to dig inside libwaze.so with no sucess (including use of zynamics bindiff) to check for change between 3.9.9.0 and 3.9.9.906.
Can you help me or tell what I can do to bypass signature verification? Is it possible to modify libwaze.so without altering original signature or to spoof waze original signature?
Here is a logcat of the crash :
Code:
03-05 14:36:14.946 25806 25806 E WAZE : [email protected]
--------- beginning of crash
03-05 14:36:14.955 25806 25806 E AndroidRuntime: FATAL EXCEPTION: main
03-05 14:36:14.955 25806 25806 E AndroidRuntime: Process: com.waze, PID: 25806
03-05 14:36:14.955 25806 25806 E AndroidRuntime: java.lang.SecurityException: Signature check failed for com.waze
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1620)
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1573)
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at com.google.android.gms.common.internal.zzs$zza$zza.zza(Unknown Source)
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at com.google.android.gms.common.internal.zzj.zza(Unknown Source)
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at com.google.android.gms.common.api.internal.zzh$zzc.zzpK(Unknown Source)
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at com.google.android.gms.common.api.internal.zzh$zzf.run(Unknown Source)
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at com.google.android.gms.internal.zzob.run(Unknown Source)
03-05 14:36:14.955 25806 25806 E AndroidRuntime: at java.lang.Thread.run(Thread.java:818)
03-05 14:36:15.008 919 3085 W ActivityManager: Force finishing activity com.waze/.MainActivity
Thank you all!
Come on hackers!!!
Not an option without ripping the app apart. Even then it may refuse to work. I would just forget about it.
I think I've found the smali files to reverse engineer :
Code:
.class public Lcom/google/android/gms/common/GoogleSignatureVerifier;
.super Ljava/lang/Object;
# static fields
.field private static final zzaqd:Lcom/google/android/gms/common/GoogleSignatureVerifier;
# direct methods
.method static constructor <clinit>()V
.locals 1
new-instance v0, Lcom/google/android/gms/common/GoogleSignatureVerifier;
invoke-direct {v0}, Lcom/google/android/gms/common/GoogleSignatureVerifier;-><init>()V
sput-object v0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzaqd:Lcom/google/android/gms/common/GoogleSignatureVerifier;
return-void
.end method
.method private constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static getInstance()Lcom/google/android/gms/common/GoogleSignatureVerifier;
.locals 1
sget-object v0, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzaqd:Lcom/google/android/gms/common/GoogleSignatureVerifier;
return-object v0
.end method
.method private zzb(Landroid/content/pm/PackageInfo;Z)Z
.locals 5
const/4 v2, 0x1
const/4 v1, 0x0
iget-object v0, p1, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
array-length v0, v0
if-eq v0, v2, :cond_0
const-string/jumbo v0, "GoogleSignatureVerifier"
const-string/jumbo v2, "Package has more than one signature."
invoke-static {v0, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
move v0, v1
:goto_0
return v0
:cond_0
new-instance v3, Lcom/google/android/gms/common/zzc$zzb;
iget-object v0, p1, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
aget-object v0, v0, v1
invoke-virtual {v0}, Landroid/content/pm/Signature;->toByteArray()[B
move-result-object v0
invoke-direct {v3, v0}, Lcom/google/android/gms/common/zzc$zzb;-><init>([B)V
if-eqz p2, :cond_1
invoke-static {}, Lcom/google/android/gms/common/zzc;->zzpc()Ljava/util/Set;
move-result-object v0
:goto_1
invoke-interface {v0, v3}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_2
move v0, v2
goto :goto_0
:cond_1
invoke-static {}, Lcom/google/android/gms/common/zzc;->zzpd()Ljava/util/Set;
move-result-object v0
goto :goto_1
:cond_2
const-string/jumbo v0, "GoogleSignatureVerifier"
const/4 v2, 0x2
invoke-static {v0, v2}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v0
if-eqz v0, :cond_3
const-string/jumbo v0, "GoogleSignatureVerifier"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v4, "Signature not valid. Found: \n"
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v3}, Lcom/google/android/gms/common/zzc$zza;->getBytes()[B
move-result-object v3
invoke-static {v3, v1}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v0, v2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
:cond_3
move v0, v1
goto :goto_0
.end method
# virtual methods
.method public isPackageGoogleSigned(Landroid/content/pm/PackageManager;Landroid/content/pm/PackageInfo;)Z
.locals 3
.param p1, "packageManager" # Landroid/content/pm/PackageManager;
.param p2, "packageInfo" # Landroid/content/pm/PackageInfo;
.prologue
const/4 v2, 0x1
const/4 v0, 0x0
if-nez p2, :cond_1
:cond_0
:goto_0
return v0
:cond_1
invoke-static {p1}, Lcom/google/android/gms/common/GooglePlayServicesUtilLight;->honorsDebugCertificates(Landroid/content/pm/PackageManager;)Z
move-result v1
if-eqz v1, :cond_2
invoke-direct {p0, p2, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzb(Landroid/content/pm/PackageInfo;Z)Z
move-result v0
goto :goto_0
:cond_2
invoke-direct {p0, p2, v0}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzb(Landroid/content/pm/PackageInfo;Z)Z
move-result v0
if-nez v0, :cond_0
invoke-direct {p0, p2, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zzb(Landroid/content/pm/PackageInfo;Z)Z
move-result v1
if-eqz v1, :cond_0
const-string/jumbo v1, "GoogleSignatureVerifier"
const-string/jumbo v2, "Test-keys aren\'t accepted on this build."
invoke-static {v1, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_0
.end method
.method public isPackageGoogleSigned(Landroid/content/pm/PackageManager;Ljava/lang/String;)Z
.locals 3
.param p1, "packageManager" # Landroid/content/pm/PackageManager;
.param p2, "callingPackage" # Ljava/lang/String;
.prologue
const/16 v0, 0x40
:try_start_0
invoke-virtual {p1, p2, v0}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v0
invoke-virtual {p0, p1, v0}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->isPackageGoogleSigned(Landroid/content/pm/PackageManager;Landroid/content/pm/PackageInfo;)Z
move-result v0
:goto_0
return v0
:catch_0
move-exception v0
const-string/jumbo v0, "GoogleSignatureVerifier"
const/4 v1, 0x3
invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v0
if-eqz v0, :cond_0
const-string/jumbo v0, "GoogleSignatureVerifier"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v2, "Package manager can\'t find package "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
const-string/jumbo v2, ", defaulting to false"
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method public isUidGoogleSigned(Landroid/content/pm/PackageManager;I)Z
.locals 5
.param p1, "packageManager" # Landroid/content/pm/PackageManager;
.param p2, "uid" # I
.prologue
const/4 v0, 0x0
invoke-virtual {p1, p2}, Landroid/content/pm/PackageManager;->getPackagesForUid(I)[Ljava/lang/String;
move-result-object v2
if-eqz v2, :cond_0
array-length v1, v2
if-nez v1, :cond_1
:cond_0
:goto_0
return v0
:cond_1
array-length v3, v2
move v1, v0
:goto_1
if-ge v1, v3, :cond_0
aget-object v4, v2, v1
invoke-virtual {p0, p1, v4}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->isPackageGoogleSigned(Landroid/content/pm/PackageManager;Ljava/lang/String;)Z
move-result v4
if-eqz v4, :cond_2
const/4 v0, 0x1
goto :goto_0
:cond_2
add-int/lit8 v1, v1, 0x1
goto :goto_1
.end method
.method public verifyPackageIsGoogleSigned(Landroid/content/pm/PackageManager;Ljava/lang/String;)V
.locals 3
.param p1, "packageManager" # Landroid/content/pm/PackageManager;
.param p2, "callingPackage" # Ljava/lang/String;
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/SecurityException;
}
.end annotation
.prologue
invoke-virtual {p0, p1, p2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->isPackageGoogleSigned(Landroid/content/pm/PackageManager;Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_0
new-instance v0, Ljava/lang/SecurityException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v2, "Signature check failed for "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
throw v0
:cond_0
return-void
.end method
.method public verifyUidIsGoogleSigned(Landroid/content/pm/PackageManager;I)V
.locals 2
.param p1, "packageManager" # Landroid/content/pm/PackageManager;
.param p2, "uid" # I
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/SecurityException;
}
.end annotation
.prologue
if-nez p1, :cond_0
new-instance v0, Ljava/lang/SecurityException;
const-string/jumbo v1, "Unknown error: invalid Package Manager"
invoke-direct {v0, v1}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
throw v0
:cond_0
invoke-virtual {p0, p1, p2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->isUidGoogleSigned(Landroid/content/pm/PackageManager;I)Z
move-result v0
if-nez v0, :cond_1
new-instance v0, Ljava/lang/SecurityException;
const-string/jumbo v1, "Uid is not Google Signed"
invoke-direct {v0, v1}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
throw v0
:cond_1
return-void
.end method
.method varargs zza(Landroid/content/pm/PackageInfo;[Lcom/google/android/gms/common/zzc$zza;)Lcom/google/android/gms/common/zzc$zza;
.locals 6
const/4 v2, 0x0
const/4 v1, 0x0
iget-object v0, p1, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
array-length v0, v0
const/4 v3, 0x1
if-eq v0, v3, :cond_0
const-string/jumbo v0, "GoogleSignatureVerifier"
const-string/jumbo v1, "Package has more than one signature."
invoke-static {v0, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
move-object v0, v2
:goto_0
return-object v0
:cond_0
new-instance v3, Lcom/google/android/gms/common/zzc$zzb;
iget-object v0, p1, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
aget-object v0, v0, v1
invoke-virtual {v0}, Landroid/content/pm/Signature;->toByteArray()[B
move-result-object v0
invoke-direct {v3, v0}, Lcom/google/android/gms/common/zzc$zzb;-><init>([B)V
move v0, v1
:goto_1
array-length v4, p2
if-ge v0, v4, :cond_2
aget-object v4, p2, v0
invoke-virtual {v4, v3}, Lcom/google/android/gms/common/zzc$zza;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_1
aget-object v0, p2, v0
goto :goto_0
:cond_1
add-int/lit8 v0, v0, 0x1
goto :goto_1
:cond_2
const-string/jumbo v0, "GoogleSignatureVerifier"
const/4 v4, 0x2
invoke-static {v0, v4}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v0
if-eqz v0, :cond_3
const-string/jumbo v0, "GoogleSignatureVerifier"
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
const-string/jumbo v5, "Signature not valid. Found: \n"
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v3}, Lcom/google/android/gms/common/zzc$zza;->getBytes()[B
move-result-object v3
invoke-static {v3, v1}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;
move-result-object v1
invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
:cond_3
move-object v0, v2
goto :goto_0
.end method
.method public zza(Landroid/content/pm/PackageInfo;Z)Z
.locals 4
const/4 v0, 0x1
const/4 v1, 0x0
if-eqz p1, :cond_1
iget-object v2, p1, Landroid/content/pm/PackageInfo;->signatures:[Landroid/content/pm/Signature;
if-eqz v2, :cond_1
if-eqz p2, :cond_0
sget-object v2, Lcom/google/android/gms/common/zzc$zzcm;->zzapV:[Lcom/google/android/gms/common/zzc$zza;
invoke-virtual {p0, p1, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;[Lcom/google/android/gms/common/zzc$zza;)Lcom/google/android/gms/common/zzc$zza;
move-result-object v2
:goto_0
if-eqz v2, :cond_1
:goto_1
return v0
:cond_0
new-array v2, v0, [Lcom/google/android/gms/common/zzc$zza;
sget-object v3, Lcom/google/android/gms/common/zzc$zzcm;->zzapV:[Lcom/google/android/gms/common/zzc$zza;
aget-object v3, v3, v1
aput-object v3, v2, v1
invoke-virtual {p0, p1, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;[Lcom/google/android/gms/common/zzc$zza;)Lcom/google/android/gms/common/zzc$zza;
move-result-object v2
goto :goto_0
:cond_1
move v0, v1
goto :goto_1
.end method
.method public zza(Landroid/content/pm/PackageManager;Landroid/content/pm/PackageInfo;)Z
.locals 3
const/4 v2, 0x1
const/4 v0, 0x0
if-nez p2, :cond_1
:cond_0
:goto_0
return v0
:cond_1
invoke-static {p1}, Lcom/google/android/gms/common/GooglePlayServicesUtilLight;->honorsDebugCertificates(Landroid/content/pm/PackageManager;)Z
move-result v1
if-eqz v1, :cond_2
invoke-virtual {p0, p2, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;Z)Z
move-result v0
goto :goto_0
:cond_2
invoke-virtual {p0, p2, v0}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;Z)Z
move-result v0
if-nez v0, :cond_0
invoke-virtual {p0, p2, v2}, Lcom/google/android/gms/common/GoogleSignatureVerifier;->zza(Landroid/content/pm/PackageInfo;Z)Z
move-result v1
if-eqz v1, :cond_0
const-string/jumbo v1, "GoogleSignatureVerifier"
const-string/jumbo v2, "Test-keys aren\'t accepted on this build."
invoke-static {v1, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_0
.end method
Those features are left out purposely because its illegal to include in certain areas. And so we don't need it discussed on XDA.
Thread closed.
Darth
Forum Moderator
hi anyone has found a hack to crack open the tmobile unlock app?i search everywhere and no answer to that question
we have access to the unlock app is there anyone able to look at the inner working of the app to see what it does.we have root an unlocked bootloader maybe someone with the right skills could find a way to access the modem that by the way is read only i try everything already.
anyone?
i guess i might be asking to the wrong people.
Not possible. The unlock app gets its unlock code from the TMobile server. The IMEI also must be in TMobile's server in order for the unlock app to work. The V10 is not the first phone to use the unlock app. This goes back to LG G4. They couldn't unlock the G4 without the unlock app so I doubt the V10 is any different. Make sure the T-Mobile IMEI checker is able to find your phones IMEI before it is possible to unlock with the app. If the IMEI is not in the data base then the phone is not purchased from a T-Mobile store. It's most likely purchased from an LG partner program. If that's the case then you're SOL. You'll have to though the FCC to get it to unlock. It may take weeks or months to get it unlocked. Good luck with that.
If the commands used by the app could be logged then they could be emulated by an app, box or software that prompts for the code. It would be a matter of buying an unlock code so the app or software can insert it in the proper string and send it to the phone. Just an idea I've seen similar procedures done in other types of "scenes".
Apexseal said:
If the commands used by the app could be logged then they could be emulated by an app, box or software that prompts for the code. It would be a matter of buying an unlock code so the app or software can insert it in the proper string and send it to the phone. Just an idea I've seen similar procedures done in other types of "scenes".
Click to expand...
Click to collapse
yes i'm sure it can be emulated, the app doesnt do the unlocking , it only sends the unlock execution COMMAND , it sends the command to a file called "tsdeamon" in system/bin, which actually executes the unlock and is only found on tmo variant devices.The app just accesses the tmo server , confirms eligibility and actually gets the unlock code for your devices imei, you just dont see it.you could also port the default unlock menu from say at&t variant but the simunlockapp refuses to open and just fc's
Can the app be tricked into believing it is talking to the server so we can inject the unlock code to it? Can the server/app comms be logged?
Apexseal said:
Can the app be tricked into believing it is talking to the server so we can inject the unlock code to it? Can the server/app comms be logged?
Click to expand...
Click to collapse
exactly what i was thinking lol.i know i decompiled the app before and there was something about server address in it.i don't know how to log it though
Found this... Seems interesting, If what I posted is against the rules please delete.
Code:
.class public Lcom/tmobile/simlock/TrustletProtocol;
.super Ljava/lang/Object;
# interfaces
.implements Lcom/tmobile/simlock/w;
# static fields
.field private static final END_TIME_SIZE_BYTES:I = 0x4
.field private static final EXPIRY_TIME_OFFSET_BYTES:I = 0x14c
.field private static final HMAC_SIZE_BYTES:I = 0x20
.field private static final IMEI_SIZE_BYTES:I = 0x10
.field private static final MAC_SIZE_BYTES:I = 0x20
.field private static final MILLS_PER_SECOND:I = 0x3e8
.field private static final RESPONSE_MESSAGE_LENGTH_OFFSET:I = 0x2
.field private static final SERVER_ERROR_MESSAGE_LENGTH_OFFSET:I = 0xc
.field private static final SERVER_ERROR_MESSAGE_OFFSET:I = 0x10
.field public static final SERVER_URL:Ljava/lang/String; = "https://unlock.t-mobile.com/unlock/unlock"
.field private static final SIGNATURE_SIZE_BYTES:I = 0x100
.field private static final SIMLOCK_SETTINGS_LENGTH_BYTES:I = 0x4
.field private static final SIMLOCK_SETTINGS_VERSION_MAJOR_OFFSET:I = 0x0
.field private static final SIMLOCK_SETTINGS_VERSION_MINOR_OFFSET:I = 0x2
.field private static final START_TIME_SIZE_BYTES:I = 0x8
.field private static final TAG:Ljava/lang/String; = null
.field private static final UNLOCK_REQUEST_FIXME:I = 0x4
.field private static final UNLOCK_REQUEST_PARTIAL:I = 0x3
.field private static final UNLOCK_REQUEST_PERMANENT:I = 0x2
.field private static final UNLOCK_REQUEST_RESERVED:I = 0x0
.field private static final UNLOCK_REQUEST_TEMPORARY:I = 0x1
.field private static final UNLOCK_SERVER_RESPONSE_TYPE:B = 0x28t
.field private static mSimLockJniLoaded:Z
# instance fields
.field private mHttp:Lcom/tmobile/simlock/n;
.field private mLockedUntil:J
.field private mRebootRequired:Z
.field private mUseAttestation:Z
.field private serverMessage:Ljava/lang/String;
# direct methods
.method static constructor <clinit>()V
.locals 2
const-class v0, Lcom/tmobile/simlock/TrustletProtocol;
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v0
sput-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const/4 v0, 0x0
sput-boolean v0, Lcom/tmobile/simlock/TrustletProtocol;->mSimLockJniLoaded:Z
:try_start_0
const-string v0, "simlockjni"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
const/4 v0, 0x1
sput-boolean v0, Lcom/tmobile/simlock/TrustletProtocol;->mSimLockJniLoaded:Z
:try_end_0
.catch Ljava/lang/UnsatisfiedLinkError; {:try_start_0 .. :try_end_0} :catch_0
:goto_0
return-void
:catch_0
move-exception v0
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v1, "Cannot load simlockjni library!"
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
goto :goto_0
.end method
.method public constructor <init>(Lcom/tmobile/simlock/n;Landroid/content/SharedPreferences;)V
.locals 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mRebootRequired:Z
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mUseAttestation:Z
iput-object p1, p0, Lcom/tmobile/simlock/TrustletProtocol;->mHttp:Lcom/tmobile/simlock/n;
sget-boolean v0, Lcom/tmobile/simlock/TrustletProtocol;->mSimLockJniLoaded:Z
if-nez v0, :cond_0
new-instance v0, Ljava/lang/ExceptionInInitializerError;
invoke-direct {v0}, Ljava/lang/ExceptionInInitializerError;-><init>()V
throw v0
:cond_0
return-void
.end method
.method private static native createAttestationRequest([B)[B
.end method
.method private static native createRegisterKeyRequest([B)[B
.end method
.method private static native createUnlockRequest([BI)[B
.end method
.method private static native processResponse([B[B)[B
.end method
.method private static native requestSLBReset()V
.end method
.method private runProtocol([B)V
.locals 12
const/4 v11, 0x1
const/4 v10, 0x0
new-array v1, v11, [B
aput-byte v10, v1, v10
:goto_0
if-eqz p1, :cond_5
iget-object v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mHttp:Lcom/tmobile/simlock/n;
invoke-virtual {v0, p1}, Lcom/tmobile/simlock/n;->a([B)[B
move-result-object v2
aget-byte v0, v2, v10
const/16 v3, 0x28
if-ne v0, v3, :cond_0
invoke-static {v2}, Ljava/nio/ByteBuffer;->wrap([B)Ljava/nio/ByteBuffer;
move-result-object v0
sget-object v3, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;
invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
const/4 v3, 0x2
invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->getShort(I)S
move-result v3
sget-object v4, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "lenOfMessage: "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(I)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}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
const/16 v4, 0xc
invoke-virtual {v0, v4}, Ljava/nio/ByteBuffer;->getInt(I)I
move-result v4
sget-object v5, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "lenOfServerError: "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-static {v5, v6}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
add-int/lit8 v4, v4, 0x10
add-int/lit8 v4, v4, 0x4
add-int/lit8 v4, v4, 0x2
invoke-virtual {v0, v4}, Ljava/nio/ByteBuffer;->getShort(I)S
move-result v4
sget-object v5, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "minVersion: "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-static {v5, v6}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
if-nez v4, :cond_4
add-int/lit16 v3, v3, -0x14c
invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;
:goto_1
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->getLong()J
move-result-wide v4
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->getInt()I
move-result v0
int-to-long v6, v0
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v8, "Extracted unlock ending time (milliseconds): "
invoke-virtual {v3, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v3
const-string v8, " + "
invoke-virtual {v3, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v6, v7}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v3
const-string v8, " seconds"
invoke-virtual {v3, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v0, v3}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
const-wide/16 v8, 0x3e8
mul-long/2addr v6, v8
add-long/2addr v4, v6
iput-wide v4, p0, Lcom/tmobile/simlock/TrustletProtocol;->mLockedUntil:J
:cond_0
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v3, "runProtocol: processing the response..."
invoke-static {v0, v3}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
invoke-static {v2, v1}, Lcom/tmobile/simlock/TrustletProtocol;->processResponse([B[B)[B
move-result-object v0
if-nez v0, :cond_1
sget-object v3, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v4, "runProtocol: processResponse returned null!"
invoke-static {v3, v4}, Lcom/tmobile/simlock/s;->b(Ljava/lang/String;Ljava/lang/String;)V
:cond_1
aget-byte v2, v2, v10
const/16 v3, 0x3c
if-ne v2, v3, :cond_2
if-eqz v0, :cond_2
new-instance v2, Ljava/lang/String;
const-string v3, "UTF-8"
invoke-static {v3}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
move-result-object v3
invoke-direct {v2, v0, v3}, Ljava/lang/String;-><init>([BLjava/nio/charset/Charset;)V
iput-object v2, p0, Lcom/tmobile/simlock/TrustletProtocol;->serverMessage:Ljava/lang/String;
const/4 v0, 0x0
:cond_2
sget-object v2, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "Server message: "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
iget-object v4, p0, Lcom/tmobile/simlock/TrustletProtocol;->serverMessage:Ljava/lang/String;
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
aget-byte v2, v1, v10
if-eqz v2, :cond_3
iput-boolean v11, p0, Lcom/tmobile/simlock/TrustletProtocol;->mRebootRequired:Z
:cond_3
sget-object v2, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "Need to reboot? "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
iget-boolean v4, p0, Lcom/tmobile/simlock/TrustletProtocol;->mRebootRequired:Z
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
move-object p1, v0
goto/16 :goto_0
:cond_4
add-int/lit16 v3, v3, -0x14c
add-int/lit8 v3, v3, -0x10
invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;
goto/16 :goto_1
:cond_5
return-void
.end method
.method private unlock(ILjava/lang/String;)V
.locals 3
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "onUnlock called, with unlock type of "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Using IMSI: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
if-eqz p2, :cond_0
invoke-virtual {p2}, Ljava/lang/String;->getBytes()[B
move-result-object v0
:goto_0
invoke-static {v0, p1}, Lcom/tmobile/simlock/TrustletProtocol;->createUnlockRequest([BI)[B
move-result-object v0
invoke-direct {p0, v0}, Lcom/tmobile/simlock/TrustletProtocol;->runProtocol([B)V
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v1, "Succesfully ran the unlock protocol"
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
return-void
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
# virtual methods
.method public getServerMessage()Ljava/lang/String;
.locals 1
iget-object v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->serverMessage:Ljava/lang/String;
return-object v0
.end method
.method public isRebootRequired()Z
.locals 1
iget-boolean v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mRebootRequired:Z
return v0
.end method
.method public partialUnlock(Ljava/lang/String;)V
.locals 1
const/4 v0, 0x3
invoke-direct {p0, v0, p1}, Lcom/tmobile/simlock/TrustletProtocol;->unlock(ILjava/lang/String;)V
return-void
.end method
.method public permanentUnlock(Ljava/lang/String;)V
.locals 1
const/4 v0, 0x2
invoke-direct {p0, v0, p1}, Lcom/tmobile/simlock/TrustletProtocol;->unlock(ILjava/lang/String;)V
return-void
.end method
.method public registerKey(Ljava/lang/String;)V
.locals 3
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Using IMEI: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
iget-boolean v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mUseAttestation:Z
if-eqz v0, :cond_0
if-eqz p1, :cond_1
invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B
move-result-object v0
:goto_0
invoke-static {v0}, Lcom/tmobile/simlock/TrustletProtocol;->createAttestationRequest([B)[B
move-result-object v0
invoke-direct {p0, v0}, Lcom/tmobile/simlock/TrustletProtocol;->runProtocol([B)V
:cond_0
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v1, "Succesfully registered the key"
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
return-void
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
.method public resetSLB()V
.locals 2
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v1, "SLB reset not available"
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
return-void
.end method
.method public temporaryUnlock(Ljava/lang/String;)J
.locals 4
const-wide/16 v0, 0x0
iput-wide v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mLockedUntil:J
const/4 v0, 0x1
invoke-direct {p0, v0, p1}, Lcom/tmobile/simlock/TrustletProtocol;->unlock(ILjava/lang/String;)V
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "temporaryUnlock: until: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-wide v2, p0, Lcom/tmobile/simlock/TrustletProtocol;->mLockedUntil:J
invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
iget-wide v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mLockedUntil:J
return-wide v0
.end method
Apexseal said:
Found this... Seems interesting, If what I posted is against the rules please delete.
Code:
.class public Lcom/tmobile/simlock/TrustletProtocol;
.super Ljava/lang/Object;
# interfaces
.implements Lcom/tmobile/simlock/w;
# static fields
.field private static final END_TIME_SIZE_BYTES:I = 0x4
.field private static final EXPIRY_TIME_OFFSET_BYTES:I = 0x14c
.field private static final HMAC_SIZE_BYTES:I = 0x20
.field private static final IMEI_SIZE_BYTES:I = 0x10
.field private static final MAC_SIZE_BYTES:I = 0x20
.field private static final MILLS_PER_SECOND:I = 0x3e8
.field private static final RESPONSE_MESSAGE_LENGTH_OFFSET:I = 0x2
.field private static final SERVER_ERROR_MESSAGE_LENGTH_OFFSET:I = 0xc
.field private static final SERVER_ERROR_MESSAGE_OFFSET:I = 0x10
.field public static final SERVER_URL:Ljava/lang/String; = "https://unlock.t-mobile.com/unlock/unlock"
.field private static final SIGNATURE_SIZE_BYTES:I = 0x100
.field private static final SIMLOCK_SETTINGS_LENGTH_BYTES:I = 0x4
.field private static final SIMLOCK_SETTINGS_VERSION_MAJOR_OFFSET:I = 0x0
.field private static final SIMLOCK_SETTINGS_VERSION_MINOR_OFFSET:I = 0x2
.field private static final START_TIME_SIZE_BYTES:I = 0x8
.field private static final TAG:Ljava/lang/String; = null
.field private static final UNLOCK_REQUEST_FIXME:I = 0x4
.field private static final UNLOCK_REQUEST_PARTIAL:I = 0x3
.field private static final UNLOCK_REQUEST_PERMANENT:I = 0x2
.field private static final UNLOCK_REQUEST_RESERVED:I = 0x0
.field private static final UNLOCK_REQUEST_TEMPORARY:I = 0x1
.field private static final UNLOCK_SERVER_RESPONSE_TYPE:B = 0x28t
.field private static mSimLockJniLoaded:Z
# instance fields
.field private mHttp:Lcom/tmobile/simlock/n;
.field private mLockedUntil:J
.field private mRebootRequired:Z
.field private mUseAttestation:Z
.field private serverMessage:Ljava/lang/String;
# direct methods
.method static constructor <clinit>()V
.locals 2
const-class v0, Lcom/tmobile/simlock/TrustletProtocol;
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v0
sput-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const/4 v0, 0x0
sput-boolean v0, Lcom/tmobile/simlock/TrustletProtocol;->mSimLockJniLoaded:Z
:try_start_0
const-string v0, "simlockjni"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
const/4 v0, 0x1
sput-boolean v0, Lcom/tmobile/simlock/TrustletProtocol;->mSimLockJniLoaded:Z
:try_end_0
.catch Ljava/lang/UnsatisfiedLinkError; {:try_start_0 .. :try_end_0} :catch_0
:goto_0
return-void
:catch_0
move-exception v0
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v1, "Cannot load simlockjni library!"
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
goto :goto_0
.end method
.method public constructor <init>(Lcom/tmobile/simlock/n;Landroid/content/SharedPreferences;)V
.locals 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mRebootRequired:Z
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mUseAttestation:Z
iput-object p1, p0, Lcom/tmobile/simlock/TrustletProtocol;->mHttp:Lcom/tmobile/simlock/n;
sget-boolean v0, Lcom/tmobile/simlock/TrustletProtocol;->mSimLockJniLoaded:Z
if-nez v0, :cond_0
new-instance v0, Ljava/lang/ExceptionInInitializerError;
invoke-direct {v0}, Ljava/lang/ExceptionInInitializerError;-><init>()V
throw v0
:cond_0
return-void
.end method
.method private static native createAttestationRequest([B)[B
.end method
.method private static native createRegisterKeyRequest([B)[B
.end method
.method private static native createUnlockRequest([BI)[B
.end method
.method private static native processResponse([B[B)[B
.end method
.method private static native requestSLBReset()V
.end method
.method private runProtocol([B)V
.locals 12
const/4 v11, 0x1
const/4 v10, 0x0
new-array v1, v11, [B
aput-byte v10, v1, v10
:goto_0
if-eqz p1, :cond_5
iget-object v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mHttp:Lcom/tmobile/simlock/n;
invoke-virtual {v0, p1}, Lcom/tmobile/simlock/n;->a([B)[B
move-result-object v2
aget-byte v0, v2, v10
const/16 v3, 0x28
if-ne v0, v3, :cond_0
invoke-static {v2}, Ljava/nio/ByteBuffer;->wrap([B)Ljava/nio/ByteBuffer;
move-result-object v0
sget-object v3, Ljava/nio/ByteOrder;->BIG_ENDIAN:Ljava/nio/ByteOrder;
invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
const/4 v3, 0x2
invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->getShort(I)S
move-result v3
sget-object v4, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "lenOfMessage: "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(I)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}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
const/16 v4, 0xc
invoke-virtual {v0, v4}, Ljava/nio/ByteBuffer;->getInt(I)I
move-result v4
sget-object v5, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "lenOfServerError: "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-static {v5, v6}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
add-int/lit8 v4, v4, 0x10
add-int/lit8 v4, v4, 0x4
add-int/lit8 v4, v4, 0x2
invoke-virtual {v0, v4}, Ljava/nio/ByteBuffer;->getShort(I)S
move-result v4
sget-object v5, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "minVersion: "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-static {v5, v6}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
if-nez v4, :cond_4
add-int/lit16 v3, v3, -0x14c
invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;
:goto_1
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->getLong()J
move-result-wide v4
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->getInt()I
move-result v0
int-to-long v6, v0
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v8, "Extracted unlock ending time (milliseconds): "
invoke-virtual {v3, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v3
const-string v8, " + "
invoke-virtual {v3, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v6, v7}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v3
const-string v8, " seconds"
invoke-virtual {v3, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v0, v3}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
const-wide/16 v8, 0x3e8
mul-long/2addr v6, v8
add-long/2addr v4, v6
iput-wide v4, p0, Lcom/tmobile/simlock/TrustletProtocol;->mLockedUntil:J
:cond_0
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v3, "runProtocol: processing the response..."
invoke-static {v0, v3}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
invoke-static {v2, v1}, Lcom/tmobile/simlock/TrustletProtocol;->processResponse([B[B)[B
move-result-object v0
if-nez v0, :cond_1
sget-object v3, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v4, "runProtocol: processResponse returned null!"
invoke-static {v3, v4}, Lcom/tmobile/simlock/s;->b(Ljava/lang/String;Ljava/lang/String;)V
:cond_1
aget-byte v2, v2, v10
const/16 v3, 0x3c
if-ne v2, v3, :cond_2
if-eqz v0, :cond_2
new-instance v2, Ljava/lang/String;
const-string v3, "UTF-8"
invoke-static {v3}, Ljava/nio/charset/Charset;->forName(Ljava/lang/String;)Ljava/nio/charset/Charset;
move-result-object v3
invoke-direct {v2, v0, v3}, Ljava/lang/String;-><init>([BLjava/nio/charset/Charset;)V
iput-object v2, p0, Lcom/tmobile/simlock/TrustletProtocol;->serverMessage:Ljava/lang/String;
const/4 v0, 0x0
:cond_2
sget-object v2, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "Server message: "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
iget-object v4, p0, Lcom/tmobile/simlock/TrustletProtocol;->serverMessage:Ljava/lang/String;
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
aget-byte v2, v1, v10
if-eqz v2, :cond_3
iput-boolean v11, p0, Lcom/tmobile/simlock/TrustletProtocol;->mRebootRequired:Z
:cond_3
sget-object v2, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "Need to reboot? "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
iget-boolean v4, p0, Lcom/tmobile/simlock/TrustletProtocol;->mRebootRequired:Z
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
move-object p1, v0
goto/16 :goto_0
:cond_4
add-int/lit16 v3, v3, -0x14c
add-int/lit8 v3, v3, -0x10
invoke-virtual {v0, v3}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;
goto/16 :goto_1
:cond_5
return-void
.end method
.method private unlock(ILjava/lang/String;)V
.locals 3
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "onUnlock called, with unlock type of "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Using IMSI: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
if-eqz p2, :cond_0
invoke-virtual {p2}, Ljava/lang/String;->getBytes()[B
move-result-object v0
:goto_0
invoke-static {v0, p1}, Lcom/tmobile/simlock/TrustletProtocol;->createUnlockRequest([BI)[B
move-result-object v0
invoke-direct {p0, v0}, Lcom/tmobile/simlock/TrustletProtocol;->runProtocol([B)V
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v1, "Succesfully ran the unlock protocol"
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
return-void
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
# virtual methods
.method public getServerMessage()Ljava/lang/String;
.locals 1
iget-object v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->serverMessage:Ljava/lang/String;
return-object v0
.end method
.method public isRebootRequired()Z
.locals 1
iget-boolean v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mRebootRequired:Z
return v0
.end method
.method public partialUnlock(Ljava/lang/String;)V
.locals 1
const/4 v0, 0x3
invoke-direct {p0, v0, p1}, Lcom/tmobile/simlock/TrustletProtocol;->unlock(ILjava/lang/String;)V
return-void
.end method
.method public permanentUnlock(Ljava/lang/String;)V
.locals 1
const/4 v0, 0x2
invoke-direct {p0, v0, p1}, Lcom/tmobile/simlock/TrustletProtocol;->unlock(ILjava/lang/String;)V
return-void
.end method
.method public registerKey(Ljava/lang/String;)V
.locals 3
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Using IMEI: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
iget-boolean v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mUseAttestation:Z
if-eqz v0, :cond_0
if-eqz p1, :cond_1
invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B
move-result-object v0
:goto_0
invoke-static {v0}, Lcom/tmobile/simlock/TrustletProtocol;->createAttestationRequest([B)[B
move-result-object v0
invoke-direct {p0, v0}, Lcom/tmobile/simlock/TrustletProtocol;->runProtocol([B)V
:cond_0
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v1, "Succesfully registered the key"
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
return-void
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
.method public resetSLB()V
.locals 2
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
const-string v1, "SLB reset not available"
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
return-void
.end method
.method public temporaryUnlock(Ljava/lang/String;)J
.locals 4
const-wide/16 v0, 0x0
iput-wide v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mLockedUntil:J
const/4 v0, 0x1
invoke-direct {p0, v0, p1}, Lcom/tmobile/simlock/TrustletProtocol;->unlock(ILjava/lang/String;)V
sget-object v0, Lcom/tmobile/simlock/TrustletProtocol;->TAG:Ljava/lang/String;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "temporaryUnlock: until: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-wide v2, p0, Lcom/tmobile/simlock/TrustletProtocol;->mLockedUntil:J
invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Lcom/tmobile/simlock/s;->a(Ljava/lang/String;Ljava/lang/String;)V
iget-wide v0, p0, Lcom/tmobile/simlock/TrustletProtocol;->mLockedUntil:J
return-wide v0
.end method
Click to expand...
Click to collapse
where is this from?
jass65 said:
exactly what i was thinking lol.i know i decompiled the app before and there was something about server address in it.i don't know how to log it though
Click to expand...
Click to collapse
Wireshark or you can make your own cell tower for like $200 because SS7 sucks balls.
---------- Post added at 11:20 PM ---------- Previous post was at 11:15 PM ----------
jass65 said:
where is this from?
Click to expand...
Click to collapse
One of the files in the disassembly of the app. Check out this post https://forum.xda-developers.com/sho...d.php?t=643800 Instead of extracting "classes.dex" from the apk just disassemble the whole apk, it did error out but most of it shows up, don't know if it is of any good. The file is called "Trusted protocol.smali" inside "smali\com\tmobile\simlock folder". Maybe the apk can be modded?
Well seems it has been cracked, imeigurus is offering remote usb unlock service for tmobile app unlock phones. Let's see how long before it becomes public or copied by box makers.
i asked them about the v10 and they said its not supported .it seems they are using usb to to it and its only for the S7 series. i may have an idea of how . since they require you to be completely stock with no knox i dont think they are messing with the main partition table cause they can't. They might be writing the imei unlock code directly to the modem since you can communicate with the modem on its own.i tried this with the v10's modem idk i could never get it to write, maybe it was the formatting.you can do a lot through the modem.
Makes sense after all modem is the one parts that controls all of this...
It would be interesting just to find out how to do it on any phone. After all our V10's are just cpu killing machines due to heat... LOL...
jass65 said:
...
Click to expand...
Click to collapse
Apexseal said:
...
Click to expand...
Click to collapse
Look at this thread: t-mobile-metro-pcs-unlock-app-mod
Specifically there's a guy who showed up in that thread and is asking for t-mobile apps to analyze. I'd post mine but I don't have an account there.
He said he's got S7 figured out, and want's other examples of unlock apps from different phones.
Edit: On closer look at the thread, it seems he already got the V10 app. Let's hope he posts some good stuff there soon.
Anyone know if there is a similar device unlock for the LG G5 H830 on tmobile??
Here is the device unlock app for the LG G5 H830 on tmobile, maybe someone could work on it.
https://mega.nz/#!8gpm1BLI!zEA3hx-taq0dikdRqtVza4p3Z7GpJGhgKRJF3fwSg3g
Code is attached.
Unlock t-mobile LG v10
Did anyone figure out how to get this unlocked? I am in the same situation and would love to collaborate with anyone on getting this unlocked.
Im in the same situation, I want my phone to get unlock, Im using a Note 5 (that I wouldnt buy if I could use my V10 internationally)
hello recently my device have a custom rom miui 8 based on stockrom aosp android 6.0.1 (mmb29m) but have some issue, when im trying to copypaste or insert a text on application like facebook,instagram, or anyother socialmedia apps, its become force close im trying to compare with other miui8 based on cyanogenmod but still no luck.
here is a logcat
Code:
6-07 08:34:22.987 E/AndroidRuntime(27228): FATAL EXCEPTION: main
06-07 08:34:22.987 E/AndroidRuntime(27228): Process: com.miui.notes, PID: 27228
06-07 08:34:22.987 E/AndroidRuntime(27228): java.lang.VerifyError: Verifier rejected class android.widget.Editor$InsertionHandleView due to bad method void android.widget.Editor$InsertionHandleView.createAnimations() (declaration of 'android.widget.Editor$InsertionHandleView' appears in /system/framework/framework.jar:classes3.dex)
06-07 08:34:22.987 E/AndroidRuntime(27228): at android.widget.Editor$InsertionPointCursorController.getHandle(Editor.java:4623)
06-07 08:34:22.987 E/AndroidRuntime(27228): at android.widget.Editor$InsertionPointCursorController.show(Editor.java:4598)
06-07 08:34:22.987 E/AndroidRuntime(27228): at android.widget.Editor.onTouchUpEvent(Editor.java:1947)
06-07 08:34:22.987 E/AndroidRuntime(27228): at android.widget.TextView.onTouchEvent(TextView.java:8356)
06-07 08:34:22.987 E/AndroidRuntime(27228): at com.miui.notes.editor.RichEditView.onTouchEvent(RichEditView.java:1026)
06-07 08:34:22.987 E/AndroidRuntime(27228): at android.view.View.dispatchTouchEvent(View.java:9402)
06-07 08:34:22.987 E/AndroidRuntime(27228): at com.miui.notes.editor.RichEditView.dispatchTouchEvent(RichEditView.java:1018)
thats logcat when im trying to copy paste or insert text on notepad apps (miui apps)
and this is smali (maybe) thats cause forceclose
Code:
.method private createAnimations()V
.registers 10
.prologue
const/4 v8, 0x1
const/4 v7, 0x0
const/4 v6, 0x2
.line 4877
new-instance v2, Landroid/animation/AnimatorSet;
invoke-direct {v2}, Landroid/animation/AnimatorSet;-><init>()V
iput-object v2, p0, Landroid/widget/Editor$InsertionHandleView;->mAnimationFadeIn:Landroid/animation/AnimatorSet;
.line 4878
sget-object v2, Landroid/view/View;->SCALE_X:Landroid/util/Property;
new-array v3, v6, [F
fill-array-data v3, :array_7e
invoke-static {p0, v2, v3}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Landroid/util/Property;[F)Landroid/animation/ObjectAnimator;
move-result-object v0
.line 4879
.local v0, "scaleAnimatorX":Landroid/animation/ObjectAnimator;
sget-object v2, Landroid/view/View;->SCALE_Y:Landroid/util/Property;
new-array v3, v6, [F
fill-array-data v3, :array_86
invoke-static {p0, v2, v3}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Landroid/util/Property;[F)Landroid/animation/ObjectAnimator;
move-result-object v1
.line 4880
.local v1, "scaleAnimatorY":Landroid/animation/ObjectAnimator;
iget-object v2, p0, Landroid/widget/Editor$InsertionHandleView;->mAnimationFadeIn:Landroid/animation/AnimatorSet;
new-instance v3, Lmiui/view/animation/BackEaseOutInterpolator;
invoke-direct {v3}, Lmiui/view/animation/BackEaseOutInterpolator;-><init>()V
invoke-virtual {v2, v3}, Landroid/animation/AnimatorSet;->setInterpolator(Landroid/animation/TimeInterpolator;)V
.line 4881
iget-object v2, p0, Landroid/widget/Editor$InsertionHandleView;->mAnimationFadeIn:Landroid/animation/AnimatorSet;
const-wide/16 v4, 0x12c
invoke-virtual {v2, v4, v5}, Landroid/animation/AnimatorSet;->setDuration(J)Landroid/animation/AnimatorSet;
.line 4882
iget-object v2, p0, Landroid/widget/Editor$InsertionHandleView;->mAnimationFadeIn:Landroid/animation/AnimatorSet;
new-array v3, v6, [Landroid/animation/Animator;
aput-object v0, v3, v7
aput-object v1, v3, v8
invoke-virtual {v2, v3}, Landroid/animation/AnimatorSet;->playTogether([Landroid/animation/Animator;)V
.line 4884
new-instance v2, Landroid/animation/AnimatorSet;
invoke-direct {v2}, Landroid/animation/AnimatorSet;-><init>()V
iput-object v2, p0, Landroid/widget/Editor$InsertionHandleView;->mAnimationFadeOut:Landroid/animation/AnimatorSet;
.line 4885
sget-object v2, Landroid/view/View;->SCALE_X:Landroid/util/Property;
new-array v3, v6, [F
fill-array-data v3, :array_8e
invoke-static {p0, v2, v3}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Landroid/util/Property;[F)Landroid/animation/ObjectAnimator;
move-result-object v0
.line 4886
sget-object v2, Landroid/view/View;->SCALE_Y:Landroid/util/Property;
new-array v3, v6, [F
fill-array-data v3, :array_96
invoke-static {p0, v2, v3}, Landroid/animation/ObjectAnimator;->ofFloat(Ljava/lang/Object;Landroid/util/Property;[F)Landroid/animation/ObjectAnimator;
move-result-object v1
.line 4887
iget-object v2, p0, Landroid/widget/Editor$InsertionHandleView;->mAnimationFadeOut:Landroid/animation/AnimatorSet;
new-instance v3, Lmiui/view/animation/CubicEaseOutInterpolator;
invoke-direct {v3}, Lmiui/view/animation/CubicEaseOutInterpolator;-><init>()V
invoke-virtual {v2, v3}, Landroid/animation/AnimatorSet;->setInterpolator(Landroid/animation/TimeInterpolator;)V
.line 4888
iget-object v2, p0, Landroid/widget/Editor$InsertionHandleView;->mAnimationFadeOut:Landroid/animation/AnimatorSet;
const-wide/16 v4, 0x96
invoke-virtual {v2, v4, v5}, Landroid/animation/AnimatorSet;->setDuration(J)Landroid/animation/AnimatorSet;
.line 4889
iget-object v2, p0, Landroid/widget/Editor$InsertionHandleView;->mAnimationFadeOut:Landroid/animation/AnimatorSet;
new-array v3, v6, [Landroid/animation/Animator;
aput-object v0, v3, v7
aput-object v1, v3, v8
invoke-virtual {v2, v3}, Landroid/animation/AnimatorSet;->playTogether([Landroid/animation/Animator;)V
.line 4891
new-instance v2, Landroid/widget/Editor$InsertionHandleView$2;
invoke-direct {v2, p0}, Landroid/widget/Editor$InsertionHandleView$2;-><init>(Landroid/widget/Editor$InsertionHandleView;)V
iput-object v2, p0, Landroid/widget/Editor$InsertionHandleView;->mAnimationFadeOutListener:Landroid/animation/AnimatorListenerAdapter;
.line 4897
return-void
.line 4878
nop
:array_7e
.array-data 4
0x0
0x3f800000 # 1.0f
.end array-data
.line 4879
:array_86
.array-data 4
0x0
0x3f800000 # 1.0f
.end array-data
.line 4885
:array_8e
.array-data 4
0x3f800000 # 1.0f
0x0
.end array-data
.line 4886
:array_96
.array-data 4
0x3f800000 # 1.0f
0x0
.end array-data
.end method
thank you before