Android的Web浏览器主页浏览器、主页、Android、Web

2023-09-06 00:20:15 作者:19.千年泪

我见过几个应​​用程序和广告网络像的startApp改变由code在Android网页浏览器主页。这怎么可能?

I have seen several apps and advertising networks like startapp changing the android web browser homepage by code. How is this possible?

我已经采取了看看在startApp SDK,但我还没有设法找到他们改变主页的部分。

I have taken a look at the startapp sdk but i have not managed to find the part where they change the homepage.

我也采取了看 BrowserSettings com.android.browser.BrowserSettings

BrowserSettings ,有一个叫设为首页(背景下,字符串)接口

public void setHomePage(Context context, String url) {
    Editor ed = PreferenceManager.
            getDefaultSharedPreferences(context).edit();
    ed.putString(PREF_HOMEPAGE, url);
    ed.commit();
    homeUrl = url;
}

我不知道很多java / Android的,所以纠正我,如果我错了:设为首页()未声明为静态的,因此不能从其他的活动被称为。所以我不能用这个。

I dont know a lot java/android, so correct me if i am wrong: The setHomepage() is not declared static so it can not be called from other activities. So i can not use this.

我看不到应用于共享preferences任何模式,以便这意味着它在默认情况下采取私人的方式是,我不能编辑共享preferences还是?

I cant see any Mode applied to the Shared Preferences so it means that it will by default take Private as is Mode and i cant edit the Shared Preferences or ?

有人说,它可能将有可能做的ContentProvider /解析器。

Some people have said that it may would be possible to do with contentProvider/Resolver.

链接的BrowserSettings.java

任何帮助或想法将AP preciated:)

Any help or thoughts would be appreciated:)

推荐答案

我用的黛安HackBorn(谷歌的Andr​​oid工程师)在这一个:这应该是不可能的,因为这将是一个平台的安全漏洞

I'm with Diane HackBorn (Google's Android Engineer) on this one: this shouldn't be possible, as it would be a platform security flaw.

如果碰巧是可能的,是通过某种黑客攻击(即:具有root访问权限的应用程序,可以写入浏览器应用程序的设置文件直接)。

If it happens to be possible, would be through some sort of hack (i.e.: an App with root access that can write into the Browser app Settings file directly).

 
精彩推荐