Skip to content

Commit

Permalink
* Issue #20 Update to Ruboto 0.8.0
Browse files Browse the repository at this point in the history
* Got it running!
  • Loading branch information
donv committed Aug 15, 2012
1 parent 95d67b0 commit 28b8d8d
Show file tree
Hide file tree
Showing 22 changed files with 2,824 additions and 1,010 deletions.
25 changes: 23 additions & 2 deletions rakelib/ruboto.rake
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,12 @@ file BUNDLE_JAR => [GEM_FILE, GEM_LOCK_FILE] do

FileUtils.mkdir_p BUNDLE_PATH
sh "bundle install --gemfile #{GEM_FILE} --path=#{BUNDLE_PATH}"
gem_path = Dir["#{BUNDLE_PATH}/*ruby/1.8/gems"][0]

gem_paths = Dir["#{BUNDLE_PATH}/{{,j}ruby,rbx}/{1.8,1.9{,.1},shared}/gems"]
raise "Gem path not found" if gem_paths.empty?
raise "Found multiple gem paths: #{gem_paths}" if gem_paths.size > 1
gem_path = gem_paths[0]
puts "Found gems in #{gem_path}"

if package != 'org.ruboto.core' && JRUBY_JARS.none? { |f| File.exists? f }
Dir.chdir gem_path do
Expand Down Expand Up @@ -350,6 +355,17 @@ def package_installed? test = false
return false
end
end

sdcard_path = "/mnt/asec/#{package_name}#{i}/pkg.apk"
o = `adb shell ls -l #{sdcard_path}`.chomp
if o =~ /^-r-xr-xr-x system\s+root\s+(\d+) \d{4}-\d{2}-\d{2} \d{2}:\d{2} #{File.basename(sdcard_path)}$/
apk_file = test ? TEST_APK_FILE : APK_FILE
if !File.exists?(apk_file) || $1.to_i == File.size(apk_file)
return true
else
return false
end
end
end
return nil
end
Expand Down Expand Up @@ -397,7 +413,10 @@ def install_apk
when false
puts "Package #{package} already installed, but of different size. Replacing package."
output = `adb install -r #{APK_FILE} 2>&1`
return if $? == 0 && output !~ failure_pattern && output =~ success_pattern
if $? == 0 && output !~ failure_pattern && output =~ success_pattern
clear_update
return
end
case $1
when 'INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES'
puts "Found package signed with different certificate. Uninstalling it and retrying install."
Expand All @@ -407,7 +426,9 @@ def install_apk
end
uninstall_apk
end
puts "Installing package #{package}"
output = `adb install #{APK_FILE} 2>&1`
puts output
raise "Install failed (#{$?}) #{$1 ? "[#$1}]" : output}" if $? != 0 || output =~ failure_pattern || output !~ success_pattern
clear_update
end
Expand Down
2 changes: 0 additions & 2 deletions res/layout/get_ruboto_core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
android:orientation="vertical"
android:gravity="center_horizontal|center_vertical"
>
<!--
-->
<ImageButton
android:id="@+id/image"
android:layout_width="fill_parent"
Expand Down
3 changes: 2 additions & 1 deletion src/org/ruboto/EntryPointActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ protected void fireRubotoActivity() {

private void showProgress() {
if (loadingDialog == null) {
Log.i("Showing progress");
if (splash > 0) {
Log.i("Showing splash");
requestWindowFeature(android.view.Window.FEATURE_NO_TITLE);
setContentView(splash);
} else {
Log.i("Showing progress");
loadingDialog = ProgressDialog.show(this, null, "Starting...", true, true);
loadingDialog.setCanceledOnTouchOutside(false);
loadingDialog.setOnCancelListener(new OnCancelListener() {
Expand Down
Loading

0 comments on commit 28b8d8d

Please sign in to comment.