Skip to content

Commit fae5fb3

Browse files
committed
removed package export option
1 parent fc0ec60 commit fae5fb3

File tree

5 files changed

+30
-102
lines changed

5 files changed

+30
-102
lines changed

mode/languages/mode.properties

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# | File | Edit | Sketch | Android | Tools | Help |
1212
# | File |
1313

14-
menu.file.export_signed_package = Export Signed Package
1514
menu.file.export_android_project = Export Android Project
1615
menu.file.export_signed_bundle = Export Signed Bundle
1716

@@ -46,7 +45,7 @@ android_build.error.zip_files_not_allowed = .zip files are not allowed in Androi
4645
android_build.error.cannot_copy_icons = Problem while copying icons.
4746
android_build.error.cannot_create_icon_folder = Could not create "%s" folder
4847
android_build.warn.cannot_find_zipalign.title = Cannot find zipaling...
49-
android_build.warn.cannot_find_zipalign.body = The zipalign build tool needed to prepare the export package is missing.\nMake sure that your Android SDK was downloaded correctly.
48+
android_build.warn.cannot_find_zipalign.body = The zipalign build tool needed to prepare the export bundle is missing.\nMake sure that your Android SDK was downloaded correctly.
5049

5150
# ---------------------------------------
5251
# Android Debugger
@@ -61,11 +60,8 @@ android_debugger.error.debugger_exception = Debugger error: %s
6160
android_editor.status.exporting_project = Exporting an Android project of the sketch...
6261
android_editor.status.project_export_completed = Done with project export.
6362
android_editor.status.project_export_failed = Error with project export.
64-
android_editor.status.exporting_package = Exporting signed package...
6563
android_editor.status.exporting_bundle = Exporting signed bundle...
66-
android_editor.status.package_export_completed = Done with package export.
6764
android_editor.status.bundle_export_completed = Done with bundle export.
68-
android_editor.status.package_export_failed = Error with package export.
6965
android_editor.status.bundle_export_failed = Error with bundle export.
7066
android_editor.error.cannot_create_sketch_properties = Error While creating sketch properties file "%s": %s
7167

@@ -87,11 +83,9 @@ android_mode.dialog.wallpaper_installed_title = Wallpaper installed!
8783
android_mode.dialog.wallpaper_installed_body = Processing just built and installed your sketch as a live wallpaper on the selected device.<br><br>You need to open the wallpaper picker in the device in order to select it as the new background.
8884
android_mode.dialog.watchface_installed_title = Watch face installed!
8985
android_mode.dialog.watchface_installed_body = Processing just built and installed your sketch as a watch face on the selected device.<br><br>You need to add it as a favourite watch face on the device and then select it from the watch face picker in order to run it.
90-
android_mode.dialog.cannot_export_package_title = Cannot export package...
9186
android_mode.dialog.cannot_export_bundle_title = Cannot export bundle...
9287
android_mode.dialog.cannot_export_package_body = The sketch still has the default package name. Not good, since this name will uniquely identify your app on the Play store... for ever! Come up with a different package name and write in the AndroidManifest.xml file in the sketch folder, after the "package=" attribute inside the manifest tag, which also contains version code and name. Once you have done that, try exporting the sketch again.<br><br>For more info on distributing apps from Processing,<br>check <a href=\"%s\">this online tutorial</a>.
93-
android_mode.dialog.cannot_use_default_icons_title = Cannot export package...
94-
android_mode.dialog.cannot_use_default_icons_title_bundle = Cannot export bundle...
88+
android_mode.dialog.cannot_use_default_icons_title = Cannot export bundle...
9589
android_mode.dialog.cannot_use_default_icons_body = The sketch does not include all required app icons. Processing could use its default set of Android icons, which are okay to test the app on your device, but a bad idea to distribute it on the Play store. Create a full set of unique icons for your app, and copy them into the sketch folder. Once you have done that, try exporting the sketch again.<br><br>For more info on distributing apps from Processing,<br>check <a href=\"%s\">this online tutorial</a>.
9690
android_mode.warn.cannot_load_sdk_title = Bad news...
9791
android_mode.warn.cannot_load_sdk_body = The Android SDK could not be loaded.\nThe Android Mode will be disabled.

mode/src/processing/mode/android/AndroidEditor.java

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,16 @@ public void actionPerformed(ActionEvent e) {
131131
}
132132
});
133133

134-
String exportPkgTitle = AndroidToolbar.getTitle(AndroidToolbar.EXPORT, false);
135-
JMenuItem exportPackage = Toolkit.newJMenuItem(exportPkgTitle, 'X');
136-
exportPackage.addActionListener(new ActionListener() {
137-
public void actionPerformed(ActionEvent e) {
138-
handleExportPackage();
139-
}
140-
});
141134

142-
String exportProjectTitle = AndroidToolbar.getTitle(AndroidToolbar.EXPORT, true);
143-
JMenuItem exportProject = Toolkit.newJMenuItem(exportProjectTitle, 'J');
135+
String exportProjectTitle = AndroidToolbar.getTitle(AndroidToolbar.EXPORT_PROJECT, true);
136+
JMenuItem exportProject = Toolkit.newJMenuItem(exportProjectTitle, 'P');
144137
exportProject.addActionListener(new ActionListener() {
145138
public void actionPerformed(ActionEvent e) {
146139
handleExportProject();
147140
}
148141
});
149142

150-
return buildFileMenu(new JMenuItem[] { exportBundle, exportPackage, exportProject});
143+
return buildFileMenu(new JMenuItem[] { exportBundle, exportProject});
151144
}
152145

153146

@@ -532,9 +525,9 @@ public void run() {
532525
* Create a release bundle of the sketch
533526
*/
534527
public void handleExportBundle() {
535-
if (androidMode.checkPackageName(sketch, appComponent, true) &&
536-
androidMode.checkAppIcons(sketch, appComponent, true) && handleExportCheckModified()) {
537-
new KeyStoreManager(this, true);
528+
if (androidMode.checkPackageName(sketch, appComponent) &&
529+
androidMode.checkAppIcons(sketch, appComponent) && handleExportCheckModified()) {
530+
new KeyStoreManager(this);
538531
}
539532
}
540533

@@ -566,46 +559,6 @@ public void run() {
566559
}.start();
567560
}
568561

569-
/**
570-
* Create a release build of the sketch and install its apk files on the
571-
* attached device.
572-
*/
573-
public void handleExportPackage() {
574-
if (androidMode.checkPackageName(sketch, appComponent, false) &&
575-
androidMode.checkAppIcons(sketch, appComponent, false) && handleExportCheckModified()) {
576-
new KeyStoreManager(this, false);
577-
}
578-
}
579-
580-
581-
public void startExportPackage(final String keyStorePassword) {
582-
new Thread() {
583-
public void run() {
584-
startIndeterminate();
585-
statusNotice(AndroidMode.getTextString("android_editor.status.exporting_package"));
586-
AndroidBuild build = new AndroidBuild(sketch, androidMode, appComponent);
587-
try {
588-
File projectFolder = build.exportPackage(keyStorePassword);
589-
if (projectFolder != null) {
590-
statusNotice(AndroidMode.getTextString("android_editor.status.package_export_completed"));
591-
Platform.openFolder(projectFolder);
592-
} else {
593-
statusError(AndroidMode.getTextString("android_editor.status.package_export_failed"));
594-
}
595-
} catch (IOException e) {
596-
statusError(e);
597-
} catch (SketchException e) {
598-
statusError(e);
599-
} catch (InterruptedException e) {
600-
e.printStackTrace();
601-
} catch (Exception e) {
602-
e.printStackTrace();
603-
}
604-
stopIndeterminate();
605-
}
606-
}.start();
607-
}
608-
609562

610563
public int getAppComponent() {
611564
return appComponent;

mode/src/processing/mode/android/AndroidMode.java

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -326,26 +326,21 @@ public void handleStop(RunnerListener listener) {
326326
}
327327

328328

329-
public boolean checkPackageName(Sketch sketch, int comp, boolean forBundle) {
329+
public boolean checkPackageName(Sketch sketch, int comp) {
330330
Manifest manifest = new Manifest(sketch, comp, getFolder(), false);
331331
String defName = Manifest.BASE_PACKAGE + "." + sketch.getName().toLowerCase();
332332
String name = manifest.getPackageName();
333333
if (name.toLowerCase().equals(defName.toLowerCase())) {
334334
// The user did not set the package name, show error and stop
335-
if (forBundle) {
336-
AndroidUtil.showMessage(AndroidMode.getTextString("android_mode.dialog.cannot_export_bundle_title"),
337-
AndroidMode.getTextString("android_mode.dialog.cannot_export_package_body", DISTRIBUTING_APPS_TUT_URL));
338-
}else {
339-
AndroidUtil.showMessage(AndroidMode.getTextString("android_mode.dialog.cannot_export_package_title"),
340-
AndroidMode.getTextString("android_mode.dialog.cannot_export_package_body", DISTRIBUTING_APPS_TUT_URL));
341-
}
335+
AndroidUtil.showMessage(AndroidMode.getTextString("android_mode.dialog.cannot_export_bundle_title"),
336+
AndroidMode.getTextString("android_mode.dialog.cannot_export_package_body", DISTRIBUTING_APPS_TUT_URL));
342337
return false;
343338
}
344339
return true;
345340
}
346341

347342

348-
public boolean checkAppIcons(Sketch sketch, int comp, boolean forBundle) {
343+
public boolean checkAppIcons(Sketch sketch, int comp) {
349344
File sketchFolder = sketch.getFolder();
350345

351346
File[] launcherIcons = AndroidUtil.getFileList(sketchFolder, AndroidBuild.SKETCH_LAUNCHER_ICONS,
@@ -360,13 +355,8 @@ public boolean checkAppIcons(Sketch sketch, int comp, boolean forBundle) {
360355

361356
if (!allFilesExist) {
362357
// The user did not set custom icons, show error and stop
363-
if (forBundle) {
364-
AndroidUtil.showMessage(AndroidMode.getTextString("android_mode.dialog.cannot_use_default_icons_title_bundle"),
365-
AndroidMode.getTextString("android_mode.dialog.cannot_use_default_icons_body", DISTRIBUTING_APPS_TUT_URL));
366-
}else {
367-
AndroidUtil.showMessage(AndroidMode.getTextString("android_mode.dialog.cannot_use_default_icons_title"),
368-
AndroidMode.getTextString("android_mode.dialog.cannot_use_default_icons_body", DISTRIBUTING_APPS_TUT_URL));
369-
}
358+
AndroidUtil.showMessage(AndroidMode.getTextString("android_mode.dialog.cannot_use_default_icons_title"),
359+
AndroidMode.getTextString("android_mode.dialog.cannot_use_default_icons_body", DISTRIBUTING_APPS_TUT_URL));
370360
return false;
371361
}
372362
return true;

mode/src/processing/mode/android/AndroidToolbar.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939

4040
@SuppressWarnings("serial")
4141
public class AndroidToolbar extends EditorToolbar {
42-
static protected final int RUN = 0;
43-
static protected final int STOP = 1;
42+
static protected final int RUN = 0;
43+
static protected final int STOP = 1;
4444

45-
static protected final int NEW = 2;
46-
static protected final int OPEN = 3;
47-
static protected final int SAVE = 4;
48-
static protected final int EXPORT = 5;
49-
static protected final int EXPORT_BUNDLE = 6;
45+
static protected final int NEW = 2;
46+
static protected final int OPEN = 3;
47+
static protected final int SAVE = 4;
48+
static protected final int EXPORT_BUNDLE = 5;
49+
static protected final int EXPORT_PROJECT = 6;
5050

5151

5252
private AndroidEditor aEditor;
@@ -77,9 +77,8 @@ static public String getTitle(int index, boolean shift) {
7777
case NEW: return "New";
7878
case OPEN: return "Open";
7979
case SAVE: return "Save";
80-
case EXPORT: return !shift ? AndroidMode.getTextString("menu.file.export_signed_package") :
81-
AndroidMode.getTextString("menu.file.export_android_project");
82-
case EXPORT_BUNDLE: return AndroidMode.getTextString("menu.file.export_signed_bundle");
80+
case EXPORT_BUNDLE: return AndroidMode.getTextString("menu.file.export_signed_bundle");
81+
case EXPORT_PROJECT: return AndroidMode.getTextString("menu.file.export_android_project");
8382
}
8483
return null;
8584
}

mode/src/processing/mode/android/KeyStoreManager.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ public class KeyStoreManager extends JFrame {
6464
JTextField country;
6565
JTextField stateName;
6666

67-
public KeyStoreManager(final AndroidEditor editor, boolean forBundle) {
67+
public KeyStoreManager(final AndroidEditor editor) {
6868
super("Android keystore manager");
6969
this.editor = editor;
7070

71-
createLayout(forBundle);
71+
createLayout();
7272
}
7373

74-
private void createLayout( boolean forBundleExport) {
74+
private void createLayout() {
7575
Container outer = getContentPane();
7676
outer.removeAll();
7777

@@ -104,22 +104,14 @@ public void actionPerformed(ActionEvent e) {
104104
commonName.getText(), organizationalUnit.getText(), organizationName.getText(),
105105
localityName.getText(), stateName.getText(), country.getText());
106106

107-
setVisible(false);
108-
if (forBundleExport) {
109-
editor.startExportBundle(new String(passwordField.getPassword()));
110-
}else {
111-
editor.startExportPackage(new String(passwordField.getPassword()));
112-
}
107+
setVisible(false);
108+
editor.startExportBundle(new String(passwordField.getPassword()));
113109
} catch (Exception e1) {
114110
e1.printStackTrace();
115111
}
116112
} else {
117113
setVisible(false);
118-
if (forBundleExport) {
119-
editor.startExportBundle(new String(passwordField.getPassword()));
120-
}else {
121-
editor.startExportPackage(new String(passwordField.getPassword()));
122-
}
114+
editor.startExportBundle(new String(passwordField.getPassword()));
123115
}
124116
}
125117
}
@@ -155,7 +147,7 @@ public void actionPerformed(ActionEvent e) {
155147
setVisible(true);
156148
} else {
157149
keyStore = null;
158-
createLayout(forBundleExport);
150+
createLayout();
159151
}
160152
}
161153
}

0 commit comments

Comments
 (0)