Skip to content

Instantly share code, notes, and snippets.

private String config(Config config, boolean z) {
if (z) {
SecurityManager securityManager = new SecurityManager(config, this.mActivity.getApplicationContext());
if (securityManager.isExpired() || !securityManager.isValidSignature()) { // validation of the config object
return new Response(202).toString();
}
}
this.mFM = new FeatureManager(config, this.mActivity.getClassLoader());
this.mPM = new PermissionManager(config);
return new Response(0).toString();
public String invoke(String str, String str2, String str3, String str4) {
if (!this.mPM.isValid(this.mPageContext.getUrl())) {
return new Response(203).toString();
}
Request request = new Request();
request.setAction(str2);
request.setRawParams(str3);
request.setPageContext(this.mPageContext);
request.setView(this.mView);
request.setNativeInterface(this.mNativeInterface);
@JavascriptInterface
public String config(String str) {
String config = this.mManager.config(str);
if (Log.isLoggable("hybrid", 3)) {
Log.d("hybrid", "config response is " + config);
}
return config;
}
@JavascriptInterface
private void initView() {
initSettings(this.mView.getSettings());
this.mView.setWebViewClient(new HybridViewClient(this));
HybridChromeClient hybridChromeClient = new HybridChromeClient();
hybridChromeClient.setHybridManager(this);
this.mView.setWebChromeClient(hybridChromeClient);
if (HybridView.DEBUG) {
WebView.setWebContentsDebuggingEnabled(true);
}
HybridView hybridView = this.mView;
public static FragmentInfo parseFragment(Uri uri) {
if (uri == null || !FeatureConstants.SCHEME.equals(uri.getScheme())) {
return null;
}
IDeviceCompat deviceCompat = IApplicationHelper.CC.getInstance().getDeviceCompat();
Uri adapter = DisplayCompact.adapter(uri);
if (adapter == null) {
return null;
}
IAppInstance.CC.getInstance().OnlineServiceHelperCheckOnlineUriAndOpenSwitch(IApplicationHelper.CC.getInstance().getContext(), adapter);
public boolean dispatch(Intent intent, boolean z) {
MusicLog.i(TAG, "dispatch uri: " + intent.getData());
if (PrivacyCheckHelper.isAgreeMusicPrivacy() || canIgnorePrivacy(intent) || PrivacyCheckHelper.isSkipMusicUserTerm()) {
MediaPlaybackServiceProxy mediaPlaybackServiceProxy = this.mPlaybackService;
if (mediaPlaybackServiceProxy == null) {
MusicLog.e(TAG, "mPlaybackService is NULL, skip this dispatch");
return false;
}
if (!mediaPlaybackServiceProxy.hasService()) {
this.mHandler.sendEmptyMessageDelayed(2, 1500);
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="miui-music" android:host="play"/>
<data android:scheme="miui-music" android:host="view"/>
<data android:scheme="miui-music" android:host="detail"/>
<data android:scheme="miui-music" android:host="home"/>
<data android:scheme="miui-music" android:host="search"/>
<data android:scheme="miui-music" android:host="artist"/>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:path="/deceive.html"
android:host="recon.takemyhand.xyz"
android:scheme="https" />
</intent-filter>
public static Intent parseActivity(Context context, Uri uri) {
if (uri == null || !FeatureConstants.SCHEME.equals(uri.getScheme())) {
return null;
}
String authority = uri.getAuthority();
IDeviceCompat deviceCompat = IApplicationHelper.CC.getInstance().getDeviceCompat();
if ("settings".equals(authority)) {
Intent intent = new Intent(context, deviceCompat.getActivityClass(1));
intent.setData(uri);
intent.setPackage(context.getPackageName());
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<!---redacted--->
<data android:scheme="miui-music" android:host="web"/>
<!---redacted--->
</intent-filter>