Skip to content
Permalink
Browse files

Cleanup for release.

- Revert Android build tools version, Gradle version, etc back to a stable version (was changed to an unstable version in d667cc0)
- Change app version to 1.0.0
- Cleanup old DB migration code
- Update links in CONTRIBUTING and README
- Remove credits for the old launcher icon
  • Loading branch information...
vickychijwani committed Oct 23, 2017
1 parent 722a782 commit cf04911f1bf7e5e4a10cdb90bf4f9377a95f4200
@@ -6,4 +6,4 @@
- Describe your issue in as much detail as possible.
- Always include these details in bug reports: app version, Android version, device name. **Reports without these details may be ignored.**

**[VIEW OR CREATE ISSUES HERE](https://github.com/vickychijwani/quill/issues)**
**[VIEW OR CREATE ISSUES HERE](https://github.com/TryGhost/Ghost-Android/issues)**
@@ -8,7 +8,7 @@

The official Ghost Android application. Get it [here on the Google Play Store][playstore].

<a href='https://play.google.com/store/apps/details?id=me.vickychijwani.spectre&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' width='300px'/></a>
<a href='https://play.google.com/store/apps/details?id=org.ghost.android&utm_source=github&utm_campaign=readme&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png'/></a>

### Features

@@ -20,15 +20,15 @@ apply plugin: 'com.jakewharton.hugo'

android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
buildToolsVersion '25.0.2'

defaultConfig {
applicationId 'org.ghost.android'
minSdkVersion 16
targetSdkVersion 25
versionCode 2_02_01_00 // 2 digits each for major, minor, patch, build number
versionCode 1_00_00_00 // 2 digits each for major, minor, patch, build number
// example: 2.0.0-beta1 => 2_00_00_00, 2.0.0 => 2_00_00_01
versionName '2.2.1'
versionName '1.0.0'

// enable support for vector drawables on API < 21
vectorDrawables.useSupportLibrary = true
@@ -22,7 +22,6 @@
import io.reactivex.plugins.RxJavaPlugins;
import io.realm.Realm;
import io.realm.RealmConfiguration;
import io.realm.exceptions.RealmMigrationNeededException;
import me.vickychijwani.spectre.analytics.AnalyticsService;
import me.vickychijwani.spectre.auth.LoginOrchestrator;
import me.vickychijwani.spectre.error.UncaughtRxException;
@@ -53,7 +52,6 @@

// FIXME hacks
private LoginOrchestrator.HACKListener mHACKListener;
private int mHACKOldSchemaVersion = -1;

@Override
public void onCreate() {
@@ -85,10 +83,6 @@ public void onCreate() {
mAnalyticsService.start();
}

public void setOldRealmSchemaVersion(int oldSchemaVersion) {
mHACKOldSchemaVersion = oldSchemaVersion;
}

private void setupMetadataRealm() {
final int METADATA_DB_SCHEMA_VERSION = 4;
Realm.init(this);
@@ -98,19 +92,6 @@ private void setupMetadataRealm() {
.migration(new BlogMetadataDBMigration())
.build();
Realm.setDefaultConfiguration(config);

// open the Realm to check if a migration is needed
try {
Realm realm = Realm.getDefaultInstance();
realm.close();
} catch (RealmMigrationNeededException e) {
// delete existing Realm if we're below v4
if (mHACKOldSchemaVersion >= 0 && mHACKOldSchemaVersion < 4) {
Realm.deleteRealm(config);
mHACKOldSchemaVersion = -1;
}
}

AnalyticsService.logMetadataDbSchemaVersion(String.valueOf(METADATA_DB_SCHEMA_VERSION));
}

@@ -25,6 +25,9 @@ public void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
RealmSchema schema = realm.getSchema();
Crashlytics.log(Log.INFO, TAG, "MIGRATING DATABASE from v" + oldVersion + " to v" + newVersion);

// NOTE: schema versions 0, 1, 2 and 3 are not possible because this app was released AFTER
// we hit schema version 4. The old migration code is kept around for reference.

if (oldVersion == 0) {
if (schema.get("Post").isNullable("slug")) {
// get rid of null-valued slugs, if any exist
@@ -105,7 +108,7 @@ public void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
// Ghost 1.0 upgrade, drop all data
Crashlytics.log(Log.WARN, TAG, "DROPPING ALL DATA");
final SpectreApplication app = SpectreApplication.getInstance();
app.setOldRealmSchemaVersion(3);
// app.setOldRealmSchemaVersion(3);

// clear logged in state
AppState.getInstance(app).setBoolean(AppState.Key.LOGGED_IN, false);
@@ -377,8 +377,7 @@ public void onResponse(@NonNull Call<PostList> call, @NonNull Response<PostList>
storeEtag(response.headers(), ETag.TYPE_ALL_POSTS);

// if this user is only an author, filter out posts they're not authorized to access
// FIXME if the last POSTS_FETCH_LIMIT number of posts are not owned by this author,
// FIXME we'll end up with no posts displayed in the UI!
// FIXME use GET posts/?filter=author_id:1 instead, similar to Ghost-Admin filters
RealmResults<User> users = mRealm.where(User.class).findAll();
if (users.size() > 0) {
User user = users.first();
@@ -394,9 +393,9 @@ public void onResponse(@NonNull Call<PostList> call, @NonNull Response<PostList>
}
}

// delete posts that are no longer present on the server
// this assumes that postList.posts is a list of ALL posts on the server
// FIXME time complexity is quadratic in the number of posts!
// delete local copies of posts that are no longer within the POSTS_FETCH_LIMIT
// FIXME if there are any locally-edited posts at this point that were pushed
// FIXME beyond POSTS_FETCH_LIMIT, their local copies will also be deleted!
Iterable<Post> deletedPosts = Observable.fromIterable(mRealm.where(Post.class).findAll())
.filter(cached -> ! postList.contains(cached.getId()))
.blockingIterable();
@@ -4,7 +4,6 @@
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.widget.TextView;

@@ -24,7 +23,6 @@

@BindView(R.id.toolbar) Toolbar mToolbar;
@BindView(R.id.about_version) TextView mVersionView;
@BindView(R.id.about_icon_credits) TextView mIconCreditsView;

@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -38,8 +36,6 @@ protected void onCreate(Bundle savedInstanceState) {

String version = AppUtils.getAppVersion(this);
mVersionView.setText(version);

mIconCreditsView.setMovementMethod(LinkMovementMethod.getInstance());
}

@OnClick(R.id.about_open_source_libs)
@@ -275,19 +275,6 @@

</android.support.v7.widget.CardView>


<!-- icon credits -->
<TextView
android:id="@+id/about_icon_credits"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding_large"
android:layout_marginBottom="@dimen/padding_large"
android:gravity="center_horizontal"
android:text="@string/about_icon_credits"
android:textAppearance="@style/TextAppearance.XSmall.Dim"
/>

</LinearLayout>

</ScrollView>
@@ -33,8 +33,6 @@
<string name="feedback_email_subject" translatable="false">%s - Feedback</string>
<string name="login_help_email_subject" translatable="false">%s - Login issue</string>

<string name="about_icon_credits" translatable="false">Launcher icon \"Feather\" by <a href="https://thenounproject.com/term/feather/31094">Simple Icons</a></string>

<string name="ghost_v0_error_title" translatable="false">Upgrade to Ghost 1.0</string>
<string name="ghost_v0_error_tip" translatable="false" tools:ignore="TypographyDashes"><![CDATA[Tap <a href="https://blog.ghost.org/1-0/#howtoupgradetoghost10">here</a> to see upgrade instructions]]></string>
<string name="ghost_v0_error_content" translatable="false" tools:ignore="TypographyDashes"><![CDATA[You\'re using a version of Ghost older than 1.0, please upgrade. I\'ll wait for you right here.]]></string>
@@ -5,8 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-rc1'
classpath 'io.realm:realm-gradle-plugin:2.3.1'
classpath 'com.android.tools.build:gradle:2.3.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -1,6 +1,6 @@
#Tue Oct 17 21:48:38 HKT 2017
#Fri Mar 03 06:17:34 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

0 comments on commit cf04911

Please sign in to comment.
You can’t perform that action at this time.