-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On x86, ask the user to download Cydia Substrate
- Loading branch information
Showing
6 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-4 Bytes
(100%)
prebuilts/tinysubstrate-bin/x86/libmcpelauncher_tinysubstrate.so
100644 → 100755
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent"> | ||
<LinearLayout | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:paddingLeft="8dp" | ||
android:paddingRight="8dp" | ||
android:paddingTop="8dp" | ||
android:paddingBottom="8dp"> | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/get_substrate_explanation" | ||
android:textSize="16sp"/> | ||
<Button | ||
android:text="@string/get_substrate_button" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:onClick="downloadClicked"/> | ||
</LinearLayout> | ||
</ScrollView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/net/zhuoweizhang/mcpelauncher/ui/GetSubstrateActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package net.zhuoweizhang.mcpelauncher.ui; | ||
|
||
import android.app.*; | ||
import android.content.*; | ||
import android.net.*; | ||
import android.os.*; | ||
import android.view.*; | ||
|
||
import net.zhuoweizhang.mcpelauncher.*; | ||
|
||
public class GetSubstrateActivity extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle icicle) { | ||
super.onCreate(icicle); | ||
setContentView(R.layout.get_substrate); | ||
} | ||
|
||
public void downloadClicked(View v) { | ||
String url = isPlay()? "market://details?id=com.saurik.substrate" : "http://www.cydiasubstrate.com/"; | ||
Intent downloadIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); | ||
downloadIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | ||
startActivity(downloadIntent); | ||
finish(); | ||
} | ||
|
||
private boolean isPlay() { | ||
try { | ||
return getPackageManager().getInstallerPackageName(getPackageName()).equals("com.android.vending"); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
return false; | ||
} | ||
} | ||
} |