try to edit settings.apk>HtcBeatAudioFeatureFlags.smali
.class public Lcom/android/settings/framework/flag/feature/HtcBeatAudioFeatureFlags;
.super Ljava/lang/Object;
.source "HtcBeatAudioFeatureFlags.java"
# direct methods
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static final getBeatAudioSettingsVisibility()Z
.locals 1
invoke-static {}, Lcom/htc/wrap/android/media/HtcWrapAudioManager;->isSupportBeats()Z
move-result v0
if-eqz v0, :cond_0
sget-boolean v0, Lcom/android/settings/framework/flag/HtcDeviceFlags;->isH0007:Z
if-eqz v0, :cond_0
sget-boolean v0, Lcom/android/settings/framework/flag/HtcProjectFlags;->isA0003:Z
if-eqz v0, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
change to
.class public Lcom/android/settings/framework/flag/feature/HtcBeatAudioFeatureFlags;
.super Ljava/lang/Object;
.source "HtcBeatAudioFeatureFlags.java"
# direct methods
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static final getBeatAudioSettingsVisibility()Z
.locals 1
const/4 v0, 0x1
return v0
.end method
Click to expand...
Click to collapse
try to edited only this line in framework/ext.jar>HtcBuildFlag.smali
.method public static final getHTC_Pyramid_LE_flag()Z
.registers 1
.prologue
.line 815
const/4 v0, 0x0
-----------------------------------------------------------------
.method public static final getHTC_Pyramid_LE_flag()Z
.registers 1
.prologue
.line 815
const/4 v0, 0x1
Click to expand...
Click to collapse
&
.method public static final getHTC_GLOBAL_BEATS()Z
.registers 1
.prologue
.line 823
const/4 v0, 0x0
return v0
.end method
.method public static final getHTC_GLOBAL_BEATS()Z
.registers 1
.prologue
.line 823
const/4 v0, 0x1
Click to expand...
Click to collapse
try to edit framework>framework.jar>AudioManager.smali
.method public static isSpecialCase()Z
.registers 3
.prologue
.line 2220
sget-short v1, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S
const/16 v2, 0x3e
if-ne v1, v2, :cond_11
sget-short v1, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_PROJECT_flag:S
const/4 v2, 0x2
if-ne v1, v2, :cond_11
sget-boolean v1, Lcom/htc/htcjavaflag/HtcBuildFlag;->HTC_GLOBAL_BEATS:Z
if-eqz v1, :cond_11
const/4 v0, 0x1
.line 2222
.local v0, support:Z
:goto_10
return v0
.line 2220
.end local v0 #support:Z
:cond_11
const/4 v0, 0x0
goto :goto_10
.end method
change to
.method public static isSpecialCase()Z
.registers 3
const/4 v0, 0x1
return v0
.end method
Click to expand...
Click to collapse
please mark the credit when you use this method
Quick question - I can't find "HtcBeatAudioFeatureFlags.smali" in Settings.apk. I found "HtcBuildFlag.smali" and "AudioManager.smali" in ext.jar and framework.jar, but can't find the first one anywhere after going through each folder individually... All I can find that mentions Beats is at /com/android/settings/framework/activity/beats/ where it has "HtcBeatsSwitchEnabler.smali" and "HtcBeatsSwitchEnabler$1.smali", neither of which reference "HtcBeatAudioFeatureFlags.java". I figured it would be in /com/android/settings/framework/flag/feature/, but here it goes from "HtcApplicationsFeatureFlags.smali" to "HtcCallFeatureFlags.smali". Appears this is the case in both the 3.26.502.52 and 3.26.502.56 base (which is weird 'cause the .56 base has Beats enabled already, unless I'm missing the point of this mod, which is very possible) - am I missing something?
homeslice976 said:
Quick question - I can't find "HtcBeatAudioFeatureFlags.smali" in Settings.apk. I found "HtcBuildFlag.smali" and "AudioManager.smali" in ext.jar and framework.jar, but can't find the first one anywhere after going through each folder individually... All I can find that mentions Beats is at /com/android/settings/framework/activity/beats/ where it has "HtcBeatsSwitchEnabler.smali" and "HtcBeatsSwitchEnabler$1.smali", neither of which reference "HtcBeatAudioFeatureFlags.java". I figured it would be in /com/android/settings/framework/flag/feature/, but here it goes from "HtcApplicationsFeatureFlags.smali" to "HtcCallFeatureFlags.smali". Appears this is the case in both the 3.26.502.52 and 3.26.502.56 base (which is weird 'cause the .56 base has Beats enabled already, unless I'm missing the point of this mod, which is very possible) - am I missing something?
Click to expand...
Click to collapse
sorry, well, I suspect there are things I am forgetting... Holiday settings.apk does not support beats audio. but The Sensation features Beats Audio support.. So, need to get from sensation..
bananacakes said:
sorry, well, I suspect there are things I am forgetting... Holiday settings.apk does not support beats audio. but The Sensation features Beats Audio support.. So, need to get from sensation..
Click to expand...
Click to collapse
Thanks for that. And for the instruction. One last pick of your brain if you don't mind - After doing this, I flashed a fresh install of the .52 build with these edits (including the .smali added to Settings.apk). After flashing, it looks like it's automatically enabling Beats audio in all music apps, however there's no sound in the HTC Music Player with Beats enabled. If I disable Beats, sounds play normally. Also, Google Play Music and iHeartRadio plays everything fine with Beats enabled - haven't tested any other media players yet. Any thoughts?
Edit: I thought maybe GSLeon's Vivid_Beats_Dolby_SRS_EQ.zip that installs Beats, Dolby Digital, SRS & the standard EQ for the HTC Vivid in music & Videos might fix HTC Music and Video Player so that Beats can be utilized with these apps as well, but still no go (though the other EQs work).
Edit 2: Interestingly, GSLeon's Vivid_Beats_Dolby_SRS_EQ.zip alone, on top of a fresh install with none of the above modifications, does the same thing (no sound in stock player when using Beats). But using this mod alone, Beats isn't available globally. So why's the HTC Music player not like it? I don't personally use it, so it's not a big deal for me...still curious though
What value would have to be changed to activate beats notification in the statusbar ? (to let it pop up)
bananacakes said:
sorry, well, I suspect there are things I am forgetting... Holiday settings.apk does not support beats audio. but The Sensation features Beats Audio support.. So, need to get from sensation..
Click to expand...
Click to collapse
Will this attachment enable beats for everything .?
Sent from my HTC PH39100 using xda app-developers app
Great guide and thanks for sharing this info...the only issue I am having is that in my AudioManager.smali I did a ctrl f to attempt to find "special" to make the changes and it indicated that its not present, but the ROM does have beats support. Enclosed is a pastebin copy of my AudioManager.smali.
My question is can I just add your code to my AudioManager.smali? If so what needs to be removed? And where should it go (if it matters)? Thanks
Related
Hi guys,i translated the key part of this guide,untill now,this guide is not completed ,if it updated ,i'll update this thread too
and until now,our MIUI PORT TEAM have these guys:
me,gabwerkz,redy2006
N00BY0815 and SquaDrive after read this post and if you want to join in plz let me know anyone else wants to join in are welcomed
===========================================line
1.A Sample For Smali
imagane that there's a Hello worlk application,we install the apk and open it,we can see a blackscreen and at the first line written:Hello world!
ok,this is a simple app.now we decompile it.
===================
we get a folder,then find the HelloActivity.smali,there's its content:
Code:
.class public Lcom/example/android/helloactivity/HelloActivity;
.super Landroid/app/Activity;
.source "HelloActivity.java"
# direct methods
.method public constructor <init>()V
.locals 0
.prologue
.line 27
invoke-direct {p0}, Landroid/app/Activity;-><init>()V
return-void
.end method
# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
.locals 2
.parameter "savedInstanceState"
.prologue
.line 33
invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
.line 37
const/high16 v1, 0x7f03
invoke-virtual {p0, v1},
Lcom/example/android/helloactivity/HelloActivity;->setContentView(I)V
.line 38
const/high16 v1, 0x7f05
invoke-virtual {p0, v1},
Lcom/example/android/helloactivity/HelloActivity;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/TextView;
.line 39
.local v0, txtView:android/widget/TextView;
const/high16 v1, 0x7f04
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(I)V
.line 40
return-void
.end method
"#" refers to notes.
begin with a dot named "annotations".
".line" means line number,it mainly used for debug.
.metho and .end method means a method's starting and endding.
more code plz goto http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html
now we want to change the "Hello,world!" into "Happy,Craker!",what should we do?
in this smali
.lne 39 is
Code:
.local v0, txtView:android/widget/TextView;
const/high16 v1, 0x7f04
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(I)V
and actually the source code is
Code:
txtView.setText(R.string.hello_activity_text_text)
here we can see it define a textview with R.string.hello_activity_text_text ,and i guess the string "Hello world!" is in it.
now we could not change the string,but we can replace it by change it directly
but how we do it in smali?
here we go
Code:
.line 39
.local v0, txtView:android/widget/TextView;
const-string v1, "Happy, Cracker!"
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
ps.i can't explane it more clearly,but we can see we replace the id with our string.
==========================
2.Porting MIUI Framework
Before starting i should tell us :all porting is based on deodexed files.and there's a stock android rom and miui rom to show you a example to understand how we make the porting work.
the main idea is change the smali code to port it.cause we can't get the souce code of miui,and by this way we can port it to our phone too.
the three files we should touch is :framework.jar ,android.policy.jar andservices.jar.they are the "core" of android system
there's an attach file download and open it we can see:
porting-miui/
|-----------------android
|------------framework.jar
|------------services.jar
|------------android.policy.jar
|------------------miui
|----------framework.jar
|----------services.jar
|----------android.policy.jar
|-----------framework-res/
|-----------framework-miui-res.apk
the android folder is from stock android ,miui folder is miui's files,and we need your phone's files here too.and in this guide we assume your phone is I9100.now we should decompile all of them and compare,to "patch" miui things to your phone.
that means ,we need to compare stock files with our files,compare stock files with miui files
i.porting resources
decompile framework-res.apk,all the resources in miui we need porting to our rom,so copy them to your compiled framework-res folder and then recompile it.
framework-miui-res.apk is a resouces package,all the miui apps need it.in our rom we can find RES_cappuccino.apk,RES_sui.apk and RES_model.apk.
usually miui's resource's id is started with 0x03,and the stock rom has two resouce package,framework-res.apk is started with 0x01 and another is started with 0x02.so if your phone has more than two package,you need contact with us.in the future we'll considering make the resouce's id started with 0x06 in miui.
ii.after we finish the decompile we can use the script rmline.sh to delete all the lines started with .line to make us more easier to compare the difference with two smali code.but backup the original decomplied files first plz.we can debug from it.
then,if you based on linux,you'd try meld to compare,if you are on windows,use beyoun compare
between stock and miui,we can see there's a lot of new classes which started with Miui,and a new miui folder,just copy those new files and folders to our stock folders(with .line)
in the attach file,there's a change-list file,which list what miui did change.maybe it's a little different with what we compared by ourselves,but it's nop (dummy instruction),it caused by apktool,so we don't need to care it,just compare listed files.
there are 3 solutions
1.ex. ActivityThread.smali,miui changed the method "getTopLevelResources",but i9100's and stock is the same,this is the easiest situation and we can replace the miui code into our files happily
2.also in ActivityThread.smali,miui changed the another method "applyConfigurationToResourcesLocked",and after comparation,we can see miui changed this method,so i9100 does.then what should we do?let's see the miui's code first
Code:
.method final applyConfigurationToResourcesLocked(Landroid/content/res/Configuration;)Z
invoke-virtual {v5, p1}, Landroid/content/res/Configuration;->updateFrom(Landroid/content/res/Configuration;)I
move-result v0
.local v0, changes:I
invoke-static {v0}, Landroid/app/MiuiThemeHelper;->handleExtraConfigurationChanges(I)V
invoke-virtual {p0, v7}, Landroid/app/ActivityThread;->getDisplayMetricsLocked(Z)Landroid/util/DisplayMetrics;
move-result-object v1
.local v1, dm:Landroid/util/DisplayMetrics;
at line 5 is what miui changed.before that,we should know some rule about smali
all the local variable is started with "v"
.locals 8 means this method use 8 local variables.
all the parameters are started by "p".and local variable and parameters started from 0.for all the nonstatic method,p0 means itself,i.e "this" pointer.
here we can see miui added a new static method,the code like this we call it linear code.it as one entry and one exit.and in compiler it called basic block.
so we just need to copy this block and paste into 9100's files at the same position,and we done.
3.for example,in Resources.smali,miui changed the "loadDrawable" method.here's the code
Code:
.method loadDrawable(Landroid/util/TypedValue;I)Landroid/graphics/drawable/Drawable;
.end local v8 #e:Ljava/lang/Exception;
.end local v13 #rnf:Landroid/content/res/Resources$NotFoundException;
:cond_6
invoke-virtual/range {p0 .. p2},
Landroid/content/res/Resources;->loadOverlayDrawable(Landroid/util/TypedValue;I)Landroid/graphics/drawable/Drawable;
move-result-object v6
if-nez v6, :cond_1
:try_start_1
move-object/from16 v0, p0
from line 6 to line 9 is what miui added.then we compare 9100 and stock android,we can find it's totally different.then how should we do now?
the key is find the added code's entry and exit.
at line 4 we see a ":cond_6",it says there should be a goto command to this :cond_6.so we got to find where used the :cond_6 and we finally got this:
Code:
const-string v15, ".xml"
invoke-virtual {v9, v15}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
move-result v15
if-eqz v15, :cond_6
read this code block carefully,and seems it is check if the string "v9" is ending with ".xml",if not,goto :cond_6 .ok ,let's go to see 9100's framework.
so we search ".xml" in the loadDrable method.find this:
Code:
const-string v17, ".xml"
move-object v0, v10
move-object/from16 v1, v17
invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
move-result v17
if-eqz v17, :cond_b
the logic is same as which in miui hmm?so goto :cond_b ,what we can see is totally same as miui's :cond_6 right? so we are sure this is where miui changed
look at the exit,miui has two exit point
one is if-nez v6, :cond_1 ,if so,goto :cond_1,if not,go on.so let's see what the :cond_1 did
here's cond_1's code
Code:
:cond_1
:goto_1
if-eqz v6, :cond_2
move-object/from16 v0, p1
iget v0, v0, Landroid/util/TypedValue;->changingConfigurations:I
and in 9100's file we can find this
Code:
:cond_1
:goto_1
if-eqz v7, :cond_2
move-object/from16 v0, p1
iget v0, v0, Landroid/util/TypedValue;->changingConfigurations:I
this time it check the v7's value,so we should add this into 9100
Code:
invoke-virtual/range {p0 .. p2},
Landroid/content/res/Resources;->loadOverlayDrawable(Landroid/util/TypedValue;I)Landroid/graphics/drawable/Drawable;
move-result-object v7
if-nez v7, :cond_1
a little dizzy hmm?take a break time and go back
iii.and the last we'll talk about inner class.
every inner class have a separete smali file.
e. ActivityThread$1.smali
if it is a Anonymous class,the name should be "outer class+$+number",else it should be "outer class+$+inner class"as its name.
if a inner class use outer class's privte method,the compiler will auto fill a static function like this:
Code:
public class Hello {
public class A {
void func() {
setup();
}
}
private void setup() {
}
we use the outer class's setup method in inner class A's "func" method.and we'll get the smali code:
part of Hello$A.smali
Code:
# virtual methods
.method func()V
.locals 1
.prologue
.line 5
iget-object v0, p0, LHello$A;->this$0:LHello;
#calls: LHello;->setup()V
invoke-static {v0}, LHello;->access$000(LHello;)V
.line 6
return-void
.end method
part of Hello.smali
Code:
.method static synthetic access$000(LHello;)V
.locals 0
.parameter
.prologue
.line 1
invoke-direct {p0}, LHello;->setup()V
return-void
.end method
we can see the compiler auto made a access$000 method,if we use a outer class's private method in a more complicate inner class,it'll made a new method,but every class may have various new class name,it changes a lot .compare it carefully,find the private method and find a name that you ever seened.
iiii.Finally there are some advices:
1.careful,find where to add miui's code
2.notice the local variable number
3.step by step,if you done a part of port,recompile it to see if it work
4.find a problem is not neccessary,use adb logcat and find what caused the problem.
5.more practice and you'll handle the smali code
==================================
because of my bad english ,if you can understand what i mean,plz point me out and i'll correct it as i can
if you think this post may help you,press the thanks button
here's the attachment:
http://www.multiupload.com/I33A07PRTF
For God Sake..
ahahahaha...
My head goin crazy...><..
maybe i need a little walk by learn..
after read those stuff i got fired up..
i want to learn Android from this..
can u guys teaching me little by little??
if so, count me on..i'm ready for testing every single build
and ready to burst my brain to learn this stuff..
SquaDrive said:
For God Sake..
ahahahaha...
My head goin crazy...><..
maybe i need a little walk by learn..
after read those stuff i got fired up..
i want to learn Android from this..
can u guys teaching me little by little??
if so, count me on..i'm ready for testing every single build
and ready to burst my brain to learn this stuff..
Click to expand...
Click to collapse
just use search...
after i tranlated this guide,i'd say i've understand a part of the "how to",and i'll gonna have a try based on v20n
dxdiag32 said:
after i tranlated this guide,i'd say i've understand a part of the "how to",and i'll gonna have a try based on v20n
Click to expand...
Click to collapse
Nice... and I'm just waiting here for your progress... LOL
Man, you got moves like jagger.
good luck dxdiag
Is there some progress?
Sent from my LG-P970 using XDA App
I would like to help, but I have too work now...
Good luck!
I think Huexxx should start porting MIUI to ours blacks xd His rom is good at this moment so he can make some break and create MIUI
doooh !
I really would offer my help but the only dev related thing I know is scripting with nsis. I don't know coding even if I'm pretty sure scripting and coding have similar principles. I don't even know what deodexing / zipaligning mean
As I learned everything by myself I know that all guides can't do 100% of the job. Learning is the key.
So I'm not sure if I can contribute but it will be a pleasure to join to your work.
Any news guys ?
Sent from my LG-P970 using xda premium
Now, I'm using HK RUU ROM. and when I push ext.jar from AT&T. Then the Beats Audio Notify works!
And BeatsAudio will also displayed on Settings List,just like AT&T's Settings.
But. Wi-Fi Hotspot function not work anymore.
--------------------------------------------------
And Funny thing is: Wi-Fi Hotspot not working on other devices, like Velocity/Raider. even flashed RUU
So I tried to push ext.jar from HK RUU. Then. Wi-Fi HotSpot Function works!
But Beats Audio Notify and Settings item disappear.
So I decompile them, after MD5 check.
I found file "HtcBuildFlag.smali" aren't same
Compare results:2 difference
FIRST:
HK:
.method public static final getHTC_GLOBAL_BEATS()Z
.registers 1
.prologue
.line 823
const/4 v0, 0x0
return v0
.end method
AT&T:
.method public static final getHTC_GLOBAL_BEATS()Z
.registers 1
.prologue
.line 823
const/4 v0, 0x1
return v0
.end method
SECOND:
HK:
.method public static final getHtc_MODEL_ID()Ljava/lang/String;
.registers 1
.prologue
.line 720
const-string v0, "HERO*****"
return-object v0
.end method
.method public static final getHtc_PROJECT_flag()S
.registers 1
.prologue
.line 714
const/16 v0, 0x32
return v0
.end method
AT&T:
.method public static final getHtc_MODEL_ID()Ljava/lang/String;
.registers 1
.prologue
.line 720
const-string v0, "HERO*****"
return-object v0
.end method
.method public static final getHtc_PROJECT_flag()S
.registers 1
.prologue
.line 714
const/4 v0, 0x2
return v0
.end method
Edit "const/16 v0, 0x36" to "const/16 v0, 0x2"
Beats notify Works and display item in settings list.
Wi-FiHotspot not working.
where should I try to push the ext.jar like /etc/ or /system/ . I want to try to use the bell version of this as I really don't care much about beats right now and want the hotspot feature to work.
zombie.raised said:
where should I try to push the ext.jar like /etc/ or /system/ . I want to try to use the bell version of this as I really don't care much about beats right now and want the hotspot feature to work.
Click to expand...
Click to collapse
Push the ext.jar file from the (Hk or telstra RUU) to system/framework.
Great thanks a lot.I am downloading the ota from Bell if by anychance any one has access to bell ota zip can they post the ext.jar.
Sent from my HTC Raider X710e
Worked just need a reboot, I picked the ext.jar as you suggested from the Stock HK rom and it worked thanks a lot.
Here if you want to try the Bell ICS one :
- http://www.filefactory.com/file/6su72ndc9a1f/n/ext_Bell_ICS.jar
Great I will try this too, overall even the hk version worked.
Sent from my HTC Raider X710e
When I tried the bell verso o got a bootloop.
Reflashed 0.6
Sent from my HTC Raider X710e
enable wifi hotspot with Beats Audio Notify for HK RUU ROM
try to edited only this line in HtcBuildFlag.smali
.method public static final getHTC_Pyramid_LE_flag()Z
.registers 1
.prologue
.line 815
const/4 v0, 0x0
-----------------------------------------------------------------
.method public static final getHTC_Pyramid_LE_flag()Z
.registers 1
.prologue
.line 815
const/4 v0, 0x1
Shouldn't it be in the HTC_GLOBAL_BEATS function?
Code:
.method public static final getHTC_GLOBAL_BEATS()Z
.registers 1
.prologue
.line 823
const/4 v0, [B]0x1[/B]
return v0
.end method
bananacakes said:
enable wifi hotspot with Beats Audio Notify for HK RUU ROM
try to edited only this line in HtcBuildFlag.smali
.method public static final getHTC_Pyramid_LE_flag()Z
.registers 1
.prologue
.line 815
const/4 v0, 0x0
-----------------------------------------------------------------
.method public static final getHTC_Pyramid_LE_flag()Z
.registers 1
.prologue
.line 815
const/4 v0, 0x1
Click to expand...
Click to collapse
Thank you very much. I will try right now. Good Luck
bananacakes said:
enable wifi hotspot with Beats Audio Notify for HK RUU ROM
try to edited only this line in HtcBuildFlag.smali
.method public static final getHTC_Pyramid_LE_flag()Z
.registers 1
.prologue
.line 815
const/4 v0, 0x0
-----------------------------------------------------------------
.method public static final getHTC_Pyramid_LE_flag()Z
.registers 1
.prologue
.line 815
const/4 v0, 0x1
Click to expand...
Click to collapse
I tried this and it shows BEATS active, but the wifi hotspot, although appearing to work, won't actually activate. Pressing the checkbox at the top will show "checked" for a split second, then go to unchecked.
Use wifi tether from the market end of issue =]
exynos5250x said:
Use wifi tether from the market end of issue =]
Click to expand...
Click to collapse
I could not get it to work with the Stock AT&T ICS (S-OFF and rooted). It would even crash the WiFi driver so bad it needed a reboot. I haven't tried it with some of the other ICS ROMs floating around (namely Telstra which I'm running as a hybrid right now on my Vivid).
After searching months for a way to allow Unknown Sources by default on the HTC One, I've finally discovered where to mod it so I thought I would share for the benefit of the community. Its one of the more convenient mods to have and I thought it would be a great for lazy people like me who want to quickly restore their setup while trying other roms and not have to deal with Blocked install messages lol.
You will need to have apktool or similar tools and decompiling knowledge before attempting this.
Previously you would need to mod SettingsProvider.apk but on Sense 5 that is no longer the case. There are two APK's to look at here. PureC_PackageInstaller and Settings.apk. PureC is the main one you want to look at.
Decompile PureC_PackageInstaller and find this directory in smali folder:
\smali\com\android\packageinstaller\PackageInstallerActivity.smali
open up PackageInstallerActivity.smali and look for this method:
Code:
.method private isInstallingUnknownAppsAllowed()Z
.locals 3
.prologue
const/4 v0, 0x0
.line 261
invoke-virtual {p0}, Lcom/android/packageinstaller/PackageInstallerActivity;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "install_non_market_apps"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-lez v1, :cond_0
const/4 v0, 0x1
:cond_0
return v0
.end method
change
Code:
.locals 3
.prologue
const/4 v0, 0x0
.line 261
to this
Code:
.locals 3
.prologue
const/4 v0, 0x1
.line 261
recompile and you are done
next decompile Settings.apk(optional!)
the only reason to edit this is to give the mod the appearance that Unknown Sources is visibly checked in Settings menu, otherwise the mod still works fine even if it isn't checked.
find this directory:
\smali\com\android\settings\SecuritySettings.smali
locate this method:
Code:
.method private isNonMarketAppsAllowed()Z
.locals 3
const/4 v0, 0x0
invoke-virtual {p0}, Lcom/android/settings/SecuritySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "install_non_market_apps"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-lez v1, :cond_0
const/4 v0, 0x1
:cond_0
return v0
.end method
change the 0x0 to 0x1, and change the 0x1 to 0x0.
recompile and your done.
tested this and working on Sprint HTC One variant, but i'm almost certain this should work on any carrier with version of Sense 5.
also of note: there is a small glitch to this mod while toggling the checkbox on and off. it'll recheck itself if you turn it off and come back to the options screen again. Plus, I turned off the disabled function completely as a temporary solution because there was another glitch where you couldn't install apps while it was checked on if you messed around trying to turn it off, but why would you want to? lol
You can also just edit the default.xml in customize
<item name="def_install_non_market_apps">1</item>
Sent from my HTCONE using Tapatalk 2
is there any way to do this in android10 ?
Hey guys! I'm on stock rooted 4.3 sense 5.0 using Xposed framework + Sense 5 toolbox for all the tweaks/mods (awesome btw for anyone unaware) and I've been looking for a way to get rid of the GPS crosshair in the status bar.
I've only had this phone for about a week but I did some searching for something but was unable to come up with anything. The closest I could find was OMJ's mod pack but to enable that feature, it looks like you have enable a couple other things... plus I believe I'm still odexed.
I'd like to stay stock like I am. Is there an easy way to do this, or have I missed something?
Thanks in advance!
Hixman said:
Hey guys! I'm on stock rooted 4.3 sense 5.0 using Xposed framework + Sense 5 toolbox for all the tweaks/mods (awesome btw for anyone unaware) and I've been looking for a way to get rid of the GPS crosshair in the status bar.
I've only had this phone for about a week but I did some searching for something but was unable to come up with anything. The closest I could find was OMJ's mod pack but to enable that feature, it looks like you have enable a couple other things... plus I believe I'm still odexed.
I'd like to stay stock like I am. Is there an easy way to do this, or have I missed something?
Thanks in advance!
Click to expand...
Click to collapse
If you like stock so much then flash the stock deodexed Rom , problem solved
sent from my Sprint HTC ONE using Tapatalk 4
olorolo said:
If you like stock so much then flash the stock deodexed Rom , problem solved
sent from my Sprint HTC ONE using Tapatalk 4
Click to expand...
Click to collapse
Not necessarily. I'd thought of that but, as I said in my previous post, the only mod I'd found that would take care of it is OMJ's mod pack which comes with eqs and something else that I didn't really want.
Thanks for the reply though :laugh: I now feel like I'm being too picky haha! I like my setup but it's the only thing that bothers me having that icon just sitting there for no reason.
Gps removal is a smali mod to SystemUi.apk(not really that hard)
Sent from my HTCONE using Tapatalk
dased14 said:
Gps removal is a smali mod to SystemUi.apk(not really that hard)
Sent from my HTCONE using Tapatalk
Click to expand...
Click to collapse
Please share how to modify it bro because I actually hate it too
Sent from my unknown using Tapatalk
you have to decompile SystemUI.apk and the you have go to smali/com/android/systemui/statusbar/policy/LocationBasedController.small and find this
Code:
method private updateIcon()V
.locals 4
const/4 v1, 0x1
const/4 v2, 0x0
const/4 v0, 0x1
invoke-static {}, Lcom/android/systemui/statusbar/policy/HtcGenericNetworkController;->isVerizon()Z
move-result v3
if-eqz v3, :cond_2
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isGpsEnabled:Z
if-nez v3, :cond_0
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isVerizonLbsEnabled:Z
if-eqz v3, :cond_1
:cond_0
move v0, v2
:goto_0
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->setIconType(I)V
return-void
:cond_1
move v0, v1
goto :goto_0
:cond_2
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isGpsEnabled:Z
if-eqz v3, :cond_3
move v0, v2
:goto_1
goto :goto_0
:cond_3
move v0, v1
goto :goto_1
.end method
and make it like this
Code:
.method private updateIcon()V
.locals 4
const/4 v0, 0x0
return-void
.end method
then recompile SystemUI.apk(make sure you sign it) and flash or adb push
(i would do it this way.
Code:
adb remount(hit enter)
adb shell stop(hit enter)
adb push<drag newly signed and compiled SystemUI here> /system/app/(hit enter)
adb reboot(hit enter)
then go set permissions(with whatever file explorer you use) to rw-r-r
dased14 said:
you have to decompile SystemUI.apk and the you have go to smali/com/android/systemui/statusbar/policy/LocationBasedController.small and find this
Code:
method private updateIcon()V
.locals 4
const/4 v1, 0x1
const/4 v2, 0x0
const/4 v0, 0x1
invoke-static {}, Lcom/android/systemui/statusbar/policy/HtcGenericNetworkController;->isVerizon()Z
move-result v3
if-eqz v3, :cond_2
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isGpsEnabled:Z
if-nez v3, :cond_0
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isVerizonLbsEnabled:Z
if-eqz v3, :cond_1
:cond_0
move v0, v2
:goto_0
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->setIconType(I)V
return-void
:cond_1
move v0, v1
goto :goto_0
:cond_2
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/LocationBasedServiceController;->isGpsEnabled:Z
if-eqz v3, :cond_3
move v0, v2
:goto_1
goto :goto_0
:cond_3
move v0, v1
goto :goto_1
.end method
and make it like this
Code:
.method private updateIcon()V
.locals 4
const/4 v0, 0x0
return-void
.end method
then recompile SystemUI.apk(make sure you sign it) and flash or adb push
(i would do it this way.
Code:
adb remount(hit enter)
adb shell stop(hit enter)
adb push<drag newly signed and compiled SystemUI here> /system/app/(hit enter)
adb reboot(hit enter)
then go set permissions(with whatever file explorer you use) to rw-r-r
Click to expand...
Click to collapse
thanks bro it worked! :laugh:
dased14 said:
you have to decompile SystemUI.apk and the you have go to smali/com/android/systemui/statusbar/policy/LocationBasedController.small and find this
Click to expand...
Click to collapse
nice...this is how I did it...
Code:
find:
.method public static isSupported()Z
.locals 1
invoke-static {}, Lcom/android/systemui/statusbar/policy/HtcGenericNetworkController;->isSprint()Z
move-result v0
return v0
.end method
change to:
.method public static isSupported()Z
.locals 1
invoke-static {}, Lcom/android/systemui/statusbar/policy/HtcGenericNetworkController;->isSprint()Z
move-result v0
if-eqz v0, :cond_e
:cond_e
const/4 v0, 0x0
return v0
.end method
this xposed module might get rid of it: http://forum.xda-developers.com/showthread.php?t=2353965
its purpose is to fix the data icons, but it also gets rid of the persistent gps icon (on 4.1.2 at least, the 4.3 rom I'm using already has it removed so I haven't checked that on 4.3).
hotaru2k3 said:
this xposed module might get rid of it: http://forum.xda-developers.com/showthread.php?t=2353965
its purpose is to fix the data icons, but it also gets rid of the persistent gps icon (on 4.1.2 at least, the 4.3 rom I'm using already has it removed so I haven't checked that on 4.3).
Click to expand...
Click to collapse
Nice! Confirmed working on 4.3.
Sent from my HTCONE using Tapatalk
[Guide] How to add a SettingsObserver to your Rom
This will allow you to add a settings observer to existing smali.
Adding a settings observer allows you to create a real-time update to an existing mod such as colors and toggles so the modification takes effect instantly without any other user intervention such as reboots, etc.
Huge credits @remuntada for all the information included in this guide.
Probably the most utilized settings observer is present for the PhoneStatusBar.smali in SystemUI.apk so we will provide this as an example:
Also see here for example of how to add a RegObserver to QSPanel
RegObserver Guide
SettingsObserver Guide
SystemUI.apk smali edits:
\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali
New code is in BLUE
Code:
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$PmsBrightnessEnableObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$EasyModeEnableObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BrightnessEnableObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$DozeServiceHost;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$ShadeUpdates;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$FastColorDrawable;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;,
[COLOR="Blue"]Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;,[/COLOR]
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$EmergencyModeObserver;,
}
.end annotation
Same smali, add new code in BLUE
The edit is about halfway into the smali. Make sure the values of the new code match the surrounding values. Note that after that :cond_0 there may be additional code in your smali. Just insert the new code where indicated.
Code:
.method public start()V
.
.
.
:cond_0[COLOR="Blue"]
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;
invoke-direct {v0, p0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V[/COLOR]
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCastController:Lcom/android/systemui/statusbar/policy/CastControllerImpl;
invoke-direct {v0, v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;-><init>(Landroid/content/Context;Lcom/android/systemui/statusbar/policy/CastController;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIconPolicy:Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
Same smali, add YOUR new method.
This is just an example method of a mod I added to change the dateview color that gets invoked from the SettingsObserver:
Code:
.method setDateTextViewColor()V
.locals 8
iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "pulldown_date_color"
const v1, -0x111112
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v7
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v6, 0x7f0d02b8 ## [COLOR="Green"]<public type="id" name="date_expanded"
[/COLOR]
invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v4
check-cast v4, Landroid/widget/TextView;
invoke-virtual {v4, v7}, Landroid/widget/TextView;->setTextColor(I)V
return-void
.end method
Add the PhoneStatusBar$SettingsObserver.smali file already attached at the bottom of this post to the same folder as PhoneStatusBar.smali.
Now lets look in the PhoneStatusBar$SettingsObserver.smali to see how we made the changes to it.
Note the text in BLUE, this where we check for changes to the key string and in the second method is where the new method gets launched to update the view if changes have been detected to that key.
Note the text in GREEN, this is how you would add two more mods to the settings observer with two additional methods to invoke in PhoneStatusBar. They are only present as an example.
Code:
.class Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
.super Landroid/database/ContentObserver;
.source "PhoneStatusBar.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = "SettingsObserver"
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
# direct methods
.method constructor <init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V
.locals 0
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-direct {p0, p2}, Landroid/database/ContentObserver;-><init>(Landroid/os/Handler;)V
return-void
.end method
# virtual methods
.method observe()V
.locals 3
const/4 v2, 0x0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v1, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
[COLOR="Blue"]const-string v1, "pulldown_date_color"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver[/COLOR](Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
[COLOR="Green"]const-string v1, "second_settings_key_goes_here"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
const-string v1, "third_settings_key_goes_here"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V[/COLOR]
return-void
.end method
.method public onChange(Z)V
.locals 1
[COLOR="Blue"] iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setDateTextViewColor()V
[/COLOR]
[COLOR="Green"]iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setSecondMethod()V
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setThirdMethod()V
[/COLOR] return-void
.end method
Modifying and adding a Settings Observer to most other smalis:
For smali where #annotations does not exist, add a new one right below the .source line like in this example. If #annotations already exist, add the line to #annotations as in the PhoneStatusBar.smali example above.
Note the highlighted text in RED, this path must match the smali you are working in (the green highlighted path).
Code:
.class public [COLOR="Green"]Lcom/android/incallui/dialpad/DialpadView[/COLOR];
.super Landroid/widget/LinearLayout;
.source "DialpadView.java"
[COLOR="Blue"]# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
[COLOR="Red"]Lcom/android/incallui/dialpad/DialpadView[/COLOR]$SettingsObserver;
}
.end annotation[/COLOR]
Search for either one of these methods:
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
And add the new code in BLUE (and Red) before the return-void at the end of the method.
Note that the paths in RED have to match the smali you're working in.
Note that I had to increase the .locals value to accommodate the new entry which I did in this example.
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
[COLOR="Blue"].locals 3[/COLOR]
const/4 v0, 0x0
invoke-direct {p0, p1, p2, v0}, Lcom/android/incallui/dialpad/DialpadView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
[COLOR="blue"]new-instance v1, [COLOR="red"]Lcom/android/incallui/dialpad/DialpadView[/COLOR]$SettingsObserver;
new-instance v2, Landroid/os/Handler;
invoke-direct {v2}, Landroid/os/Handler;-><init>()V
invoke-direct {v1, p0, v2}, [COLOR="red"]Lcom/android/incallui/dialpad/DialpadView[/COLOR]$SettingsObserver;-><init>([COLOR="Red"]Lcom/android/incallui/dialpad/DialpadView[/COLOR];Landroid/os/Handler;)V
invoke-virtual {v1}, [COLOR="red"]Lcom/android/incallui/dialpad/DialpadView[/COLOR]$SettingsObserver;->observe()V
[/COLOR]
return-void
.end method
Important note:
Wouldn't you know it, the smali I chose to use as an example does not support mcontext so I used getContext here and in the attached DateView$SettingsObserver.smali
After the last .method public constructor method (or with the rest of the access$xxx methods, if they exist) insert this method.
Note the path highlighted in RED must match the smali you are working with.
Code:
.method static synthetic access$001([COLOR="Red"]Lcom/android/incallui/dialpad/DialpadView[/COLOR];)Landroid/content/Context;
.locals 1
invoke-virtual {p0}, [COLOR="red"]Lcom/android/incallui/dialpad/DialpadView[/COLOR];->getContext()Landroid/content/Context;
move-result-object v0
return-object v0
.end method
Important note:
Use this one instead if your smali DOES support mcontext:
Code:
.method static synthetic access$001([COLOR="red"]Lcom/android/keyguard/sec/SecKeyguardClockSingleView[/COLOR];)Landroid/content/Context;
.locals 1
iget-object v0, p0, [COLOR="red"]Lcom/android/keyguard/sec/SecKeyguardClockSingleView[/COLOR];->mContext:Landroid/content/Context;
return-object v0
.end method
How to create a new YourFile$SettingsObserver
I don't recommend using
PhoneStatusBar$SettingsObserver.smali or DateView$SettingsObserver.smali
as your templates. The first is specifically for PhoneStatusBar.smali and use DateView$SettingsObserver.smali if your smali does not support mcontext.
Using one of the attached $SettingsObserver files as a template, do the following edits throughout the ENTIRE $SettingsObserver.smali (only highlighting first few lines for brevity).
Find and replace all 14 of the paths to correspond with the smali you are working in.
The .source line is the smali name only. Change this to match the smali you are working in also.
The completed SettingsObserver.smali gets placed in the same folder as the parent smali we are working with.
Code:
.class public [COLOR="Red"]Lcom/android/incallui/dialpad/DialpadView[/COLOR]$SettingsObserver;
.super Landroid/database/ContentObserver;
.source "[COLOR="red"]DialpadView[/COLOR].java"
SettingsObserver example files have been attached to this post.
** some MM guide discussions begin here: http://forum.xda-developers.com/showpost.php?p=66480317&postcount=70
Reserved
I am totally open to alternate methods and critique on improving on this folks so don't be shy with the input.
tdunham said:
I am totally open to alternate methods and critique on improving on this folks so don't be shy with the input.
Click to expand...
Click to collapse
Are you??? tomorrow we will add our observer then ???
Sent from my awesome g920f powered by 6thGear
daxgirl said:
Are you??? tomorrow we will add our observer then ???
Click to expand...
Click to collapse
Awesome!
I am fairly new to adding observers but I thought it was necessary to start this discussion with the established method and work our way up from there.
How would it be to change in real time with this guide ?: [How-to Guide] Colorize main dialpad Android letters & digits L
Do I have to create the settings observer?
tdunham said:
Awesome!
I am fairly new to adding observers but I thought it was necessary to start this discussion with the established method and work our way up from there.
Click to expand...
Click to collapse
No doubt!!! Keep it up! You're making xda tolerable again!
Sent from my awesome g920f powered by 6thGear
I have to say most of the work comes from the suggestion given to me by @CNexus here http://forum.xda-developers.com/showpost.php?p=50961314&postcount=527
Add the smali DateView$SettingsObserver to smali/com/android/dialer/dialpad and change all the routes to which it belongs.
Changing the .class public.
Should I do anything else?
aceqott said:
Add the smali DateView$SettingsObserver to smali/com/android/dialer/dialpad and change all the routes to which it belongs.
Changing the .class public.
Should I do anything else?
Click to expand...
Click to collapse
Its going to be pretty tough to add an observer to SecContacts, they chose to use letters for every single method so its going to be difficult to figure out where to place anything.
I'll look at it when I can but its probably not going to happen right away and like I said, I'm not having the dialpad color not changing instantly even without an observer so it is hard to tell if it will even work if I do find something.
tdunham said:
Its going to be pretty tough to add an observer to SecContacts, they chose to use letters for every single method so its going to be difficult to figure out where to place anything.
I'll look at it when I can but its probably not going to happen right away and like I said, I'm not having the dialpad color not changing instantly even without an observer so it is hard to tell if it will even work if I do find something.
Click to expand...
Click to collapse
Well, too bad, anyway I do not understand, I have seen now a video of other ROMs where if the digit is changed and letters SecContact real time.
While I catch a cold and am having a fever, honestly cannot convince myself to lay down and tell myself read this thread later. Thanks for amazing guide.:good:
kmokhtar79 said:
While I catch a cold and am having a fever, honestly cannot convince myself to lay down and tell myself read this thread later. Thanks for amazing guide.:good:
Click to expand...
Click to collapse
Get to bed and read on Tapatalk. ..
Sent from my awesome g920f powered by 6thGear
daxgirl said:
Get to bed and read on Tapatalk. ..
Sent from my awesome g920f powered by 6thGear
Click to expand...
Click to collapse
I need wide screen [emoji16]
OK for start, I am asking to see whether if in theory I am understanding it correctly or not.
I am trying adding a new observe for battery color as once shared by @remuntada78.
I added this in my settings observer
Code:
const-string v1, "battery_color"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
and
Code:
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/BatteryMeterView;
invoke-virtual {v0}, Lcom/android/systemui/BatteryMeterView;->setBatteryColor()V
and then in
BatteryMeterView.smali
Code:
.class public Lcom/android/systemui/BatteryMeterView;
.super Landroid/view/View;
.source "BatteryMeterView.java"
# interfaces
.implements Lcom/android/systemui/DemoMode;
.implements Lcom/android/systemui/statusbar/policy/BatteryController$BatteryStateChangeCallback;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
[COLOR="Red"] Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;,[/COLOR]
Lcom/android/systemui/BatteryMeterView$BatteryTracker;
}
.end annotation
in the same smali:
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals [COLOR="red"]2[/COLOR]
const/4 v0, 0x0
invoke-direct {p0, p1, p2, v0}, Lcom/android/systemui/BatteryMeterView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
[COLOR="red"] new-instance v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
new-instance v2, Landroid/os/Handler;
invoke-direct {v2}, Landroid/os/Handler;-><init>()V
invoke-direct {v1, p0, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;-><init>(Lcom/android/systemui/BatteryMeterView;Landroid/os/Handler;)V
invoke-virtual {v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V[/COLOR]
return-void
.end method
and as my smali does not support mcontext I added following method in red
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V [COLOR="SeaGreen"]#last public constructor[/COLOR]
.
.
.
.end method
.method static synthetic access$000(Lcom/android/systemui/BatteryMeterView;)Landroid/os/Handler;
.locals 1
iget-object v0, p0, Lcom/android/systemui/BatteryMeterView;->mPostInvalidateHandler:Landroid/os/Handler;
return-object v0
.end method
[COLOR="red"].method static synthetic access$001(Lcom/android/systemui/BatteryMeterView;)Landroid/content/Context;
.locals 1
invoke-virtual {p0}, Lcom/android/systemui/BatteryMeterView;->getContext()Landroid/content/Context;
move-result-object v0
return-object v0
.end method[/COLOR]
And lastly have done those samli modification described here I don't try it.
kmokhtar79 said:
OK for start, I am asking to see whether if in theory I am understanding it correctly or not.
I am trying adding a new observe for battery color as once shared by @remuntada78.
I added this in my settings observer
Code:
const-string v1, "battery_color"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
and
Code:
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/BatteryMeterView;
invoke-virtual {v0}, Lcom/android/systemui/BatteryMeterView;->setBatteryColor()V
and then in
BatteryMeterView.smali
Code:
.class public Lcom/android/systemui/BatteryMeterView;
.super Landroid/view/View;
.source "BatteryMeterView.java"
# interfaces
.implements Lcom/android/systemui/DemoMode;
.implements Lcom/android/systemui/statusbar/policy/BatteryController$BatteryStateChangeCallback;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
[COLOR="Red"] Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;,[/COLOR]
Lcom/android/systemui/BatteryMeterView$BatteryTracker;
}
.end annotation
in the same smali:
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals [COLOR="red"]2[/COLOR]
const/4 v0, 0x0
invoke-direct {p0, p1, p2, v0}, Lcom/android/systemui/BatteryMeterView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
[COLOR="red"] new-instance v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
new-instance v2, Landroid/os/Handler;
invoke-direct {v2}, Landroid/os/Handler;-><init>()V
invoke-direct {v1, p0, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;-><init>(Lcom/android/systemui/BatteryMeterView;Landroid/os/Handler;)V
invoke-virtual {v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V[/COLOR]
return-void
.end method
and as my smali does not support mcontext I added following method in red
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V [COLOR="SeaGreen"]#last public constructor[/COLOR]
.
.
.
.end method
.method static synthetic access$000(Lcom/android/systemui/BatteryMeterView;)Landroid/os/Handler;
.locals 1
iget-object v0, p0, Lcom/android/systemui/BatteryMeterView;->mPostInvalidateHandler:Landroid/os/Handler;
return-object v0
.end method
[COLOR="red"].method static synthetic access$001(Lcom/android/systemui/BatteryMeterView;)Landroid/content/Context;
.locals 1
invoke-virtual {p0}, Lcom/android/systemui/BatteryMeterView;->getContext()Landroid/content/Context;
move-result-object v0
return-object v0
.end method[/COLOR]
And lastly have done those samli modification described here I don't try it.
Click to expand...
Click to collapse
Look at the red class declaration. You added observer class that belongs to a different class. You need an observer for this class. Not for PhoneStatusBar.smali
Sent from my awesome g920f powered by 6thGear
daxgirl said:
Look at the red class declaration. You added observer class that belongs to a different class. You need an observer for this class. Not for PhoneStatusBar.smali
Sent from my awesome g920f powered by 6thGear
Click to expand...
Click to collapse
You are saying I need another observer to create as BatteryMeterView$SettingsObserver.smali right?
kmokhtar79 said:
You are saying I need another observer to create as BatteryMeterView$SettingsObserver.smali right?
Click to expand...
Click to collapse
Exactly. Observer is in this case an inner class. BatteryMeterView class cannot have an inner class that's called PhoneStatusBar$SettingsObserver.
http://www.javaworld.com/article/2077411/core-java/inner-classes.html
Sent from my awesome g920f powered by 6thGear
daxgirl said:
Are you??? tomorrow we will add our observer then ???
Click to expand...
Click to collapse
@daxgirl
Looking for an alternate method to add an observer where one wouldn't normally work. No rush on this.
tdunham said:
@daxgirl
Looking for an alternate method to add an observer where one wouldn't normally work. No rush on this.
Click to expand...
Click to collapse
Lol... hi there. On this side "looking forward to finishing properly handling assets and scripts for the new custom settings app so I cac concentrate on other things"
Just to clarify the thing...
We have built a settings app a while ago for ourselves. Since we both work with java, we don't need it to be as automated as ficeto's app is. So now the biggest challenge is to make it available for all, by providing a code that wouldn't require an entire forum on xda to couch devs to use it and minimize your exposure to java where possible. Our goal is to provide as clean code is possible, so minimal changes to code would be required to operate the app. That is because we understand that most devs have minimal skills when it comes to original development. We dont want to force people to build special conditions and make huge changes to the java part of the app. So the automating part... It's taking time....
We have so far fully automated and integrative nav drawer, where items can be added easily with little guiding, theme change support, automated preference fragments, automated scripts execution from the app assets and automated preference handling from the get go, no matter how deep the preference tree goes (as many nesting preference screens as you want). Right now I am working on handling those things in separate classes, so the devs wouldn't need to copy huge chunks of code when they want to create another new preference fragment for their drawer.... and as much as it's fun, little time is left for anything else for now...
Sent from my awesome g920f powered by 6thGear