add workaround for USAirways

This commit is contained in:
ligi 2014-08-10 14:43:42 +02:00
parent 01effab39a
commit ee9dcf8e78
2 changed files with 73 additions and 0 deletions

View file

@ -140,6 +140,43 @@
android:pathPattern="/virginaustralia/.*" android:pathPattern="/virginaustralia/.*"
android:scheme="https" /> android:scheme="https" />
</intent-filter> </intent-filter>
<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:host="mobile.virginaustralia.com"
android:pathPattern="/virginaustralia/.*"
android:scheme="http" />
</intent-filter>
</activity>
<activity android:name=".ui.quirk_fix.USAirwaysLoadActivity">
<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:host="www.usairwaysmobile.com"
android:pathPattern="/mobiqa/wap/.*"
android:scheme="https" />
</intent-filter>
<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:host="www.usairwaysmobile.com"
android:pathPattern="/mobiqa/wap/.*"
android:scheme="http" />
</intent-filter>
</activity> </activity>

View file

@ -0,0 +1,36 @@
package org.ligi.passandroid.ui.quirk_fix;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import org.ligi.passandroid.Tracker;
import org.ligi.passandroid.ui.PassImportActivity;
public class USAirwaysLoadActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final String url;
if (getIntent().getData().toString().endsWith("/")) {
url = getIntent().getData().toString().substring(0, getIntent().getData().toString().length() - 1);
} else {
url = getIntent().getData().toString();
}
final String[] split = url.split("/");
final String passId = split[split.length - 2] + "/" + split[split.length - 1];
final String redirectUrl = "http://prod.wap.ncrwebhost.mobi/mobiqa/wap/" + passId + "/passbook";
Tracker.get().trackEvent("quirk_fix", "redirect", "usairways", null);
final Intent intent = new Intent(this, PassImportActivity.class);
intent.setData(Uri.parse(redirectUrl));
startActivity(intent);
finish();
}
}