[Android Apps and Games] ninestarkoko:
How to disable update youtube nag screen

For the nag update/upgrade screen that appears everytime you open an outdated Youtube version, you can disable it by modding the .apk

Simply extract the classes2.dex file from inside the apk, baksmali/decompile it and search for the file that contains the "time_between_upgrade_prompts_millis" keyword (can be dew.smali , dej.smali or any other name). In this file replace the .method:

.method public final a(Landroid/content/Intent;Z)Landroid/content/Intent;
.registers 14

.line 41
iget-object v0, p0, Ldew;->e:Landroid/content/SharedPreferences;

const-string v1, "application_first_start"

const/4 v2, 0x1

invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

move-result v0

.line 42
invoke-direct {p0}, Ldew;->b()I

move-result v1

const/4 v3, 0x3

const/4 v4, 0x0

if-eqz v0, :cond_25

.line 43
iget-object v0, p0, Ldew;->e:Landroid/content/SharedPreferences;

invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

move-result-object v0

const-string v5, "application_first_start"

const/4 v6, 0x0

invoke-interface {v0, v5, v6}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

move-result-object v0

invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V

if-ne v1, v3, :cond_24

goto :goto_25

:cond_24
return-object v4

:cond_25
:goto_25
if-eqz v1, :cond_ad

if-eqz p2, :cond_2a

goto :goto_2d

:cond_2a
if-ne v1, v2, :cond_2d

return-object v4

.line 44
:cond_2d
:goto_2d
iget-object p2, p0, Ldew;->e:Landroid/content/SharedPreferences;

const-string v0, "upgrade_prompt_shown_millis"

const-wide/16 v5, 0x0

invoke-interface {p2, v0, v5, v6}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J

move-result-wide v7

.line 45
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

move-result-wide v9

sub-long/2addr v9, v7

.line 46
invoke-direct {p0}, Ldew;->b()I

move-result p2

if-eq p2, v3, :cond_75

.line 47
invoke-direct {p0}, Ldew;->a()Z

move-result p2

if-eqz p2, :cond_5f

.line 48
iget-object p2, p0, Ldew;->c:Ldjw;

.line 49
iget-object p2, p2, Ldjw;->a:Lupw;

const-string v0, "time_between_upgrade_prompts_millis"

.line 50
invoke-virtual {p2, v0}, Lupw;->b(Ljava/lang/String;)V

.line 51
iget-object v3, p2, Lupw;->c:Landroid/content/ContentResolver;

invoke-virtual {p2, v0}, Lupw;->a(Ljava/lang/String;)Ljava/lang/String;

move-result-object p2

const-wide/32 v5, 0x240c8400

invoke-static {v3, p2, v5, v6}, Lpjf;->a(Landroid/content/ContentResolver;Ljava/lang/String;J)J

move-result-wide v5

goto :goto_6f

.line 59
:cond_5f
iget-object p2, p0, Ldew;->b:Lwlt;

.line 60
invoke-virtual {p2}, Lwlt;->v()Lahiw;

move-result-object p2

.line 61
iget-object p2, p2, Lahiw;->I:Lajem;

if-eqz p2, :cond_6b

.line 62
iget-wide v5, p2, Lajem;->d:J

:cond_6b
const-wide/16 v7, 0x3e8

mul-long v5, v5, v7

:goto_6f
const-wide/16 v7, 0x7530

.line 52
invoke-static {v5, v6, v7, v8}, Ljava/lang/Math;->max(JJ)J

move-result-wide v5

:cond_75
if-ne v1, v2, :cond_7d

cmp-long p2, v9, v5

if-lez p2, :cond_7c

goto :goto_7d

:cond_7c
return-object v4

:cond_7d
:goto_7d
const/4 p2, 0x2

if-eq v1, p2, :cond_81

goto :goto_92

:cond_81
cmp-long p2, v9, v5

if-gtz p2, :cond_92

.line 57
invoke-direct {p0}, Ldew;->d()Lahdu;

move-result-object p2

if-eqz p2, :cond_91

.line 58
iget-wide v2, p2, Lahdu;->d:J

cmp-long p2, v2, v9

if-gez p2, :cond_92

:cond_91
return-object v4

.line 53
:cond_92
:goto_92
new-instance p2, Landroid/content/Intent;

iget-object v0, p0, Ldew;->d:Landroid/content/Context;

const-class v2, Lcom/google/android/apps/youtube/app/application/upgrade/NewVersionAvailableActivity;

invoke-direct {p2, v0, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

const/high16 v0, 0x10000000

.line 54
invoke-virtual {p2, v0}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

const-string v0, "upgrade_enforcement_type"

.line 55
invoke-virtual {p2, v0, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

if-eqz p1, :cond_ac

const-string v0, "forward_intent"

.line 56
invoke-virtual {p2, v0, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

:cond_ac
return-object p2

:cond_ad
return-object v4
.end method

with this:

# virtual methods
.method public final a(Landroid/content/Intent;Z)Landroid/content/Intent;
.registers 14

const/4 v0, 0x0

return-object v0

.end method

be careful to use the same .registers as the original method.

save the file, recompile classes2.dex and dragNdrop into the apk file.

If you are using the root version (system app) there's no need to resign the apk, if you are using non-root version you'll have to sign the apk again.