├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── UserjsUpdater3.iml ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── proguard-rules.pro ├── release │ └── output.json └── src │ ├── androidTest │ └── java │ │ └── de │ │ └── reckendrees │ │ └── systems │ │ └── userjsupdater │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── ic_launcher-playstore.png │ ├── ic_launcher-web.png │ ├── java │ │ └── de │ │ │ └── reckendrees │ │ │ └── systems │ │ │ └── userjsupdater │ │ │ ├── DownloadInterface.java │ │ │ ├── DownloadTask.java │ │ │ ├── IntroActivity.java │ │ │ ├── MainActivity.java │ │ │ └── SettingsActivity.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── ic_done_black_24dp.xml │ │ ├── ic_error_black_24dp.xml │ │ ├── ic_folder_black_24dp.xml │ │ ├── ic_help_black_24dp.xml │ │ ├── ic_info_black_24dp.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_launcher_foreground.xml │ │ └── ic_settings_black_24dp.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ └── settings_activity.xml │ │ ├── menu │ │ └── menu.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values │ │ ├── arrays.xml │ │ ├── colors.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── root_preferences.xml │ └── test │ └── java │ └── de │ └── reckendrees │ └── systems │ └── userjsupdater │ └── ExampleUnitTest.java ├── build.gradle ├── build ├── .gitignore ├── android-profile │ ├── profile-2019-04-30-09-52-32-239.json │ ├── profile-2019-04-30-09-52-32-239.rawproto │ ├── profile-2019-04-30-09-52-38-446.json │ ├── profile-2019-04-30-09-52-38-446.rawproto │ ├── profile-2019-04-30-10-01-33-743.json │ ├── profile-2019-04-30-10-01-33-743.rawproto │ ├── profile-2019-04-30-10-01-43-072.json │ ├── profile-2019-04-30-10-01-43-072.rawproto │ ├── profile-2019-04-30-11-50-37-064.json │ ├── profile-2019-04-30-11-50-37-064.rawproto │ ├── profile-2019-04-30-11-54-49-671.json │ ├── profile-2019-04-30-11-54-49-671.rawproto │ ├── profile-2019-04-30-12-06-10-949.json │ ├── profile-2019-04-30-12-06-10-949.rawproto │ ├── profile-2019-04-30-12-07-07-505.json │ ├── profile-2019-04-30-12-07-07-505.rawproto │ ├── profile-2019-04-30-12-10-52-236.json │ ├── profile-2019-04-30-12-10-52-236.rawproto │ ├── profile-2019-04-30-12-11-50-151.json │ ├── profile-2019-04-30-12-11-50-151.rawproto │ ├── profile-2019-04-30-12-12-25-700.json │ ├── profile-2019-04-30-12-12-25-700.rawproto │ ├── profile-2019-04-30-12-13-32-853.json │ ├── profile-2019-04-30-12-13-32-853.rawproto │ ├── profile-2019-04-30-12-14-32-470.json │ ├── profile-2019-04-30-12-14-32-470.rawproto │ ├── profile-2019-04-30-22-58-20-108.json │ ├── profile-2019-04-30-22-58-20-108.rawproto │ ├── profile-2019-04-30-23-11-24-455.json │ ├── profile-2019-04-30-23-11-24-455.rawproto │ ├── profile-2019-04-30-23-12-09-382.json │ ├── profile-2019-04-30-23-12-09-382.rawproto │ ├── profile-2019-04-30-23-16-23-709.json │ ├── profile-2019-04-30-23-16-23-709.rawproto │ ├── profile-2019-04-30-23-21-07-210.json │ ├── profile-2019-04-30-23-21-07-210.rawproto │ ├── profile-2019-04-30-23-26-16-593.json │ ├── profile-2019-04-30-23-26-16-593.rawproto │ ├── profile-2019-04-30-23-26-26-839.json │ ├── profile-2019-04-30-23-26-26-839.rawproto │ ├── profile-2019-04-30-23-27-31-856.json │ ├── profile-2019-04-30-23-27-31-856.rawproto │ ├── profile-2019-04-30-23-35-44-874.json │ ├── profile-2019-04-30-23-35-44-874.rawproto │ ├── profile-2019-04-30-23-40-34-413.json │ ├── profile-2019-04-30-23-40-34-413.rawproto │ ├── profile-2019-04-30-23-42-45-943.json │ ├── profile-2019-04-30-23-42-45-943.rawproto │ ├── profile-2019-04-30-23-43-09-100.json │ ├── profile-2019-04-30-23-43-09-100.rawproto │ ├── profile-2019-04-30-23-44-15-027.json │ ├── profile-2019-04-30-23-44-15-027.rawproto │ ├── profile-2019-04-30-23-51-47-831.json │ ├── profile-2019-04-30-23-51-47-831.rawproto │ ├── profile-2019-04-30-23-53-35-146.json │ ├── profile-2019-04-30-23-53-35-146.rawproto │ ├── profile-2019-04-30-23-54-53-092.json │ ├── profile-2019-04-30-23-54-53-092.rawproto │ ├── profile-2019-04-30-23-55-57-824.json │ ├── profile-2019-04-30-23-55-57-824.rawproto │ ├── profile-2019-04-30-23-57-27-773.json │ ├── profile-2019-04-30-23-57-27-773.rawproto │ ├── profile-2019-05-01-00-00-09-031.json │ ├── profile-2019-05-01-00-00-09-031.rawproto │ ├── profile-2019-05-01-00-04-11-688.json │ ├── profile-2019-05-01-00-04-11-688.rawproto │ ├── profile-2019-05-01-00-05-30-262.json │ ├── profile-2019-05-01-00-05-30-262.rawproto │ ├── profile-2019-05-01-00-06-33-087.json │ ├── profile-2019-05-01-00-06-33-087.rawproto │ ├── profile-2019-05-01-00-07-38-241.json │ ├── profile-2019-05-01-00-07-38-241.rawproto │ ├── profile-2019-05-01-00-08-05-018.json │ ├── profile-2019-05-01-00-08-05-018.rawproto │ ├── profile-2019-05-01-00-08-31-434.json │ ├── profile-2019-05-01-00-08-31-434.rawproto │ ├── profile-2019-05-01-00-10-33-112.json │ ├── profile-2019-05-01-00-10-33-112.rawproto │ ├── profile-2019-05-01-00-13-26-063.json │ ├── profile-2019-05-01-00-13-26-063.rawproto │ ├── profile-2019-05-01-00-19-00-130.json │ ├── profile-2019-05-01-00-19-00-130.rawproto │ ├── profile-2019-05-01-00-22-41-066.json │ ├── profile-2019-05-01-00-22-41-066.rawproto │ ├── profile-2019-05-01-00-40-00-314.json │ ├── profile-2019-05-01-00-40-00-314.rawproto │ ├── profile-2019-05-01-00-47-19-153.json │ ├── profile-2019-05-01-00-47-19-153.rawproto │ ├── profile-2019-05-01-00-52-24-367.json │ ├── profile-2019-05-01-00-52-24-367.rawproto │ ├── profile-2019-05-01-00-53-26-905.json │ ├── profile-2019-05-01-00-53-26-905.rawproto │ ├── profile-2019-05-01-00-55-57-821.json │ ├── profile-2019-05-01-00-55-57-821.rawproto │ ├── profile-2019-05-01-01-01-31-505.json │ ├── profile-2019-05-01-01-01-31-505.rawproto │ ├── profile-2019-05-01-01-02-33-311.json │ ├── profile-2019-05-01-01-02-33-311.rawproto │ ├── profile-2019-05-01-01-03-50-240.json │ ├── profile-2019-05-01-01-03-50-240.rawproto │ ├── profile-2019-05-01-01-05-24-757.json │ ├── profile-2019-05-01-01-05-24-757.rawproto │ ├── profile-2019-05-01-01-06-42-394.json │ ├── profile-2019-05-01-01-06-42-394.rawproto │ ├── profile-2019-05-01-01-06-47-412.json │ ├── profile-2019-05-01-01-06-47-412.rawproto │ ├── profile-2019-05-01-01-09-53-082.json │ ├── profile-2019-05-01-01-09-53-082.rawproto │ ├── profile-2019-05-02-09-18-29-858.json │ ├── profile-2019-05-02-09-18-29-858.rawproto │ ├── profile-2019-05-02-09-28-14-577.json │ ├── profile-2019-05-02-09-28-14-577.rawproto │ ├── profile-2019-05-02-09-29-52-639.json │ ├── profile-2019-05-02-09-29-52-639.rawproto │ ├── profile-2019-05-02-09-43-15-354.json │ ├── profile-2019-05-02-09-43-15-354.rawproto │ ├── profile-2019-05-02-09-43-21-323.json │ ├── profile-2019-05-02-09-43-21-323.rawproto │ ├── profile-2019-05-02-09-43-49-276.json │ ├── profile-2019-05-02-09-43-49-276.rawproto │ ├── profile-2019-05-02-09-43-56-869.json │ ├── profile-2019-05-02-09-43-56-869.rawproto │ ├── profile-2019-05-02-09-56-19-761.json │ ├── profile-2019-05-02-09-56-19-761.rawproto │ ├── profile-2019-05-02-09-58-02-966.json │ ├── profile-2019-05-02-09-58-02-966.rawproto │ ├── profile-2019-05-02-10-19-15-054.json │ ├── profile-2019-05-02-10-19-15-054.rawproto │ ├── profile-2019-05-02-10-21-15-273.json │ ├── profile-2019-05-02-10-21-15-273.rawproto │ ├── profile-2019-05-02-10-21-56-240.json │ ├── profile-2019-05-02-10-21-56-240.rawproto │ ├── profile-2019-05-02-10-29-43-543.json │ ├── profile-2019-05-02-10-29-43-543.rawproto │ ├── profile-2019-05-02-10-37-23-437.json │ ├── profile-2019-05-02-10-37-23-437.rawproto │ ├── profile-2019-05-02-10-39-05-385.json │ ├── profile-2019-05-02-10-39-05-385.rawproto │ ├── profile-2019-05-02-10-44-35-851.json │ ├── profile-2019-05-02-10-44-35-851.rawproto │ ├── profile-2019-05-02-10-47-40-105.json │ ├── profile-2019-05-02-10-47-40-105.rawproto │ ├── profile-2019-05-02-10-49-42-285.json │ ├── profile-2019-05-02-10-49-42-285.rawproto │ ├── profile-2019-05-02-10-49-55-685.json │ ├── profile-2019-05-02-10-49-55-685.rawproto │ ├── profile-2019-05-02-11-04-58-792.json │ ├── profile-2019-05-02-11-04-58-792.rawproto │ ├── profile-2019-05-02-11-09-00-737.json │ ├── profile-2019-05-02-11-09-00-737.rawproto │ ├── profile-2019-05-02-11-09-47-202.json │ ├── profile-2019-05-02-11-09-47-202.rawproto │ ├── profile-2019-05-02-11-11-05-262.json │ ├── profile-2019-05-02-11-11-05-262.rawproto │ ├── profile-2019-05-02-11-17-36-715.json │ ├── profile-2019-05-02-11-17-36-715.rawproto │ ├── profile-2019-05-02-11-19-18-013.json │ ├── profile-2019-05-02-11-19-18-013.rawproto │ ├── profile-2019-05-02-11-37-29-627.json │ ├── profile-2019-05-02-11-37-29-627.rawproto │ ├── profile-2019-05-02-11-37-34-252.json │ └── profile-2019-05-02-11-37-34-252.rawproto └── intermediates │ ├── lint-cache │ ├── maven.google │ │ ├── androidx │ │ │ ├── appcompat │ │ │ │ └── group-index.xml │ │ │ ├── constraintlayout │ │ │ │ └── group-index.xml │ │ │ ├── preference │ │ │ │ └── group-index.xml │ │ │ └── test │ │ │ │ ├── espresso │ │ │ │ └── group-index.xml │ │ │ │ └── ext │ │ │ │ └── group-index.xml │ │ ├── com │ │ │ └── android │ │ │ │ └── support │ │ │ │ ├── constraint │ │ │ │ └── group-index.xml │ │ │ │ ├── group-index.xml │ │ │ │ └── test │ │ │ │ ├── espresso │ │ │ │ └── group-index.xml │ │ │ │ └── group-index.xml │ │ └── master-index.xml │ └── sdk-registry.xml │ │ └── sdk-registry.xml │ └── proguard-files │ ├── proguard-android-optimize.txt-3.0.0 │ ├── proguard-android.txt-3.0.0 │ └── proguard-defaults.txt-3.0.0 ├── fastlane └── metadata │ └── android │ ├── de-DE │ ├── full_description.txt │ ├── short_description.txt │ └── title.txt │ └── en-US │ ├── changelogs │ └── 6.txt │ ├── full_description.txt │ ├── images │ ├── featureGraphic.png │ └── phoneScreenshots │ │ ├── screen0.png │ │ ├── screen1.png │ │ └── screen2.png │ ├── short_description.txt │ └── title.txt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties ├── screen_one.png ├── screen_two.png └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | app/release/* 2 | .gradle/ 3 | .idea/ 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # changelog 2 | 3 | 4 | ### v1.3.3 5 | - added Firefox Preview Nightly 6 | - fixed installation errors on Android 4.4 and below 7 | 8 | 9 | ### v1.3.1 10 | - fixed progressbar 11 | 12 | 13 | ### v1.3 14 | - changed colors 15 | - cleaned up UI 16 | - added another download method(now works with blokada) 17 | - added settings screen 18 | - updated urls 19 | - added purge option 20 | 21 | ### v1.2 22 | - added v1nc user.js 23 | - changed info icon and content 24 | - added settings icon in dialog 25 | 26 | 27 | ### v1.1 28 | - added browser selection 29 | - moved browser package setting 30 | - added another user.js source + details 31 | - added deep link: visit or link [https://update.userjs](https://update.userjs) 32 | 33 | ### v1.0 34 | - initial release 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # user.js-updater 2 | update your user.js on android without trouble 3 | ## [download](https://github.com/v1nc/user.js-updater/releases) 4 | ## features: 5 | * use predefined and custom user.js configurations 6 | * apply for any geckoview-based browser( e.g. fennec, firefox, icecat) 7 | * set custom browser package name 8 | * optional purge current configuration 9 | * deeplink for instant update: https://update.userjs 10 | 11 | ## screenshots: 12 |

13 | 14 | 15 |

16 | 17 | ## intro: 18 | powered by [appintro](https://github.com/AppIntro/AppIntro) 19 | 20 | ## [compare user.js configurations](https://v1nc.github.io/) 21 | 22 | 23 | -------------------------------------------------------------------------------- /UserjsUpdater3.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "de.reckendrees.systems.userjsupdater" 7 | minSdkVersion 21 8 | targetSdkVersion 28 9 | versionCode 6 10 | versionName '1.3.3' 11 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled true 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | productFlavors { 20 | } 21 | } 22 | 23 | dependencies { 24 | implementation fileTree(include: ['*.jar'], dir: 'libs') 25 | implementation 'androidx.appcompat:appcompat:1.0.2' 26 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 27 | implementation 'androidx.preference:preference:1.1.0' 28 | testImplementation 'junit:junit:4.12' 29 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 30 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 31 | implementation 'com.github.AppIntro:AppIntro:4.2.3' 32 | implementation "com.android.support:support-core-utils:28.0.0" 33 | 34 | } 35 | repositories{ 36 | maven { url 'https://jitpack.io' } 37 | 38 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/release/output.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "artifactType": { 4 | "type": "APK", 5 | "kind": "Directory" 6 | }, 7 | "applicationId": "de.reckendrees.systems.userjsupdater", 8 | "variantName": "release", 9 | "elements": [ 10 | { 11 | "type": "SINGLE", 12 | "filters": [], 13 | "properties": [], 14 | "versionCode": 6, 15 | "versionName": "6", 16 | "enabled": true, 17 | "outputFile": "app-release.apk" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/de/reckendrees/systems/userjsupdater/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package de.reckendrees.systems.userjsupdater; 2 | 3 | import android.content.Context; 4 | import androidx.test.platform.app.InstrumentationRegistry; 5 | import androidx.test.ext.junit.runners.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("de.reckendrees.systems.userjsupdater", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 21 | 22 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v1nc/user.js-updater/c10bf62fc81bee1ca2fb179215f17aa9b8cc91c8/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v1nc/user.js-updater/c10bf62fc81bee1ca2fb179215f17aa9b8cc91c8/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/de/reckendrees/systems/userjsupdater/DownloadInterface.java: -------------------------------------------------------------------------------- 1 | package de.reckendrees.systems.userjsupdater; 2 | 3 | public interface DownloadInterface { 4 | public void onDownloadSuccess(T object); 5 | public void onDownloadFailure(Exception e); 6 | } -------------------------------------------------------------------------------- /app/src/main/java/de/reckendrees/systems/userjsupdater/DownloadTask.java: -------------------------------------------------------------------------------- 1 | package de.reckendrees.systems.userjsupdater; 2 | 3 | import android.content.Context; 4 | import android.os.AsyncTask; 5 | import android.util.Log; 6 | 7 | import java.io.DataInputStream; 8 | import java.io.File; 9 | import java.io.FileOutputStream; 10 | import java.io.IOException; 11 | import java.io.InputStream; 12 | import java.net.MalformedURLException; 13 | import java.net.URL; 14 | 15 | public class DownloadTask extends AsyncTask { 16 | 17 | private DownloadInterface mCallBack; 18 | private Context mContext; 19 | public Exception mException; 20 | 21 | 22 | public DownloadTask(Context context, DownloadInterface callback) { 23 | mCallBack = callback; 24 | mContext = context; 25 | } 26 | 27 | @Override 28 | public String doInBackground(String... params) { 29 | try { 30 | URL u = new URL(params[0]); 31 | Log.e("THREAD",params[0]+" "+params[1]); 32 | InputStream is = u.openStream(); 33 | 34 | DataInputStream dis = new DataInputStream(is); 35 | 36 | byte[] buffer = new byte[1024]; 37 | int length; 38 | 39 | FileOutputStream fos = new FileOutputStream(new File(params[1])); 40 | while ((length = dis.read(buffer))>0) { 41 | fos.write(buffer, 0, length); 42 | } 43 | } catch (MalformedURLException e) { 44 | Log.e("download ERROR", "malformed url error", e); 45 | mException = e; 46 | } catch (IOException e) { 47 | Log.e("download ERROR", "io error", e); 48 | mException = e; 49 | } catch (SecurityException e) { 50 | Log.e("download ERROR", "security error", e); 51 | mException = e; 52 | } 53 | return null; 54 | } 55 | 56 | @Override 57 | protected void onPostExecute(String result) { 58 | if (mCallBack != null) { 59 | if (mException == null) { 60 | mCallBack.onDownloadSuccess(result); 61 | } else { 62 | mCallBack.onDownloadFailure(mException); 63 | } 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /app/src/main/java/de/reckendrees/systems/userjsupdater/IntroActivity.java: -------------------------------------------------------------------------------- 1 | package de.reckendrees.systems.userjsupdater; 2 | 3 | import android.Manifest; 4 | import android.content.SharedPreferences; 5 | import android.graphics.Color; 6 | import android.os.Bundle; 7 | import android.preference.PreferenceManager; 8 | 9 | import androidx.annotation.Nullable; 10 | import androidx.fragment.app.Fragment; 11 | 12 | import com.github.paolorotolo.appintro.AppIntro; 13 | import com.github.paolorotolo.appintro.AppIntroFragment; 14 | import com.github.paolorotolo.appintro.model.SliderPage; 15 | 16 | /** 17 | * Created by vinc on 02.05.19. 18 | */ 19 | 20 | public class IntroActivity extends AppIntro { 21 | @Override 22 | protected void onCreate(@Nullable Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | 25 | SliderPage sliderPage = new SliderPage(); 26 | sliderPage.setTitle(getResources().getString(R.string.intro1_title)); 27 | sliderPage.setDescription(getResources().getString(R.string.intro1_text)); 28 | sliderPage.setImageDrawable(R.mipmap.ic_launcher); 29 | sliderPage.setBgColor(Color.parseColor("#26494b")); 30 | addSlide(AppIntroFragment.newInstance(sliderPage)); 31 | SliderPage sliderPage2 = new SliderPage(); 32 | sliderPage2.setTitle(getResources().getString(R.string.intro2_title)); 33 | sliderPage2.setDescription(getResources().getString(R.string.intro2_text)); 34 | sliderPage2.setImageDrawable(R.drawable.ic_folder_black_24dp); 35 | sliderPage2.setBgColor(Color.parseColor("#26494b")); 36 | addSlide(AppIntroFragment.newInstance(sliderPage2)); 37 | askForPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 2); // OR 38 | // OPTIONAL METHODS 39 | // Override bar/separator color. 40 | setBarColor(Color.parseColor("#d65a4e")); 41 | //setSeparatorColor(Color.parseColor("#2196F3")); 42 | 43 | // Hide Skip/Done button. 44 | showSkipButton(false); 45 | //setProgressButtonEnabled(false); 46 | 47 | } 48 | 49 | @Override 50 | public void onSkipPressed(Fragment currentFragment) { 51 | super.onSkipPressed(currentFragment); 52 | // Do something when users tap on Skip button. 53 | } 54 | 55 | @Override 56 | public void onDonePressed(Fragment currentFragment) { 57 | SharedPreferences getPrefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); 58 | SharedPreferences.Editor e = getPrefs.edit(); 59 | e.putBoolean("firstStart", false); 60 | e.putString("package_name","org.mozilla.fennec_fdroid"); 61 | e.apply(); 62 | super.onDonePressed(currentFragment); 63 | finish(); 64 | } 65 | 66 | @Override 67 | public void onSlideChanged(@Nullable Fragment oldFragment, @Nullable Fragment newFragment) { 68 | super.onSlideChanged(oldFragment, newFragment); 69 | // Do something when the slide changes. 70 | } 71 | } -------------------------------------------------------------------------------- /app/src/main/java/de/reckendrees/systems/userjsupdater/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | package de.reckendrees.systems.userjsupdater; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.appcompat.app.ActionBar; 6 | import androidx.appcompat.app.AppCompatActivity; 7 | import androidx.appcompat.widget.Toolbar; 8 | import androidx.preference.PreferenceFragmentCompat; 9 | 10 | public class SettingsActivity extends AppCompatActivity { 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.settings_activity); 16 | getSupportFragmentManager() 17 | .beginTransaction() 18 | .replace(R.id.settings, new SettingsFragment()) 19 | .commit(); 20 | Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar); 21 | setSupportActionBar(myToolbar); 22 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 23 | getSupportActionBar().setDisplayShowHomeEnabled(true); 24 | myToolbar.setTitleTextColor(getResources().getColor(R.color.colorText)); 25 | myToolbar.setBackgroundColor(getResources().getColor(R.color.colorAccent)); 26 | } 27 | 28 | @Override 29 | public void onBackPressed() { 30 | super.onBackPressed(); 31 | 32 | finish(); 33 | } 34 | public static class SettingsFragment extends PreferenceFragmentCompat { 35 | @Override 36 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { 37 | setPreferencesFromResource(R.xml.root_preferences, rootKey); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_done_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_error_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_folder_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_help_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_info_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 11 | 16 | 21 | 26 | 31 | 36 | 41 | 46 | 51 | 56 | 61 | 66 | 71 | 76 | 81 | 86 | 91 | 96 | 101 | 106 | 111 | 116 | 121 | 126 | 131 | 136 | 141 | 146 | 151 | 156 | 161 | 166 | 171 | 172 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 12 | 13 | 15 | 17 | 19 | 21 | 23 | 25 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 15 | 16 | 24 | 25 | 30 | 31 | 35 | 36 | 44 | 45 | 46 | 51 | 52 | 53 | 54 | 62 | 63 | 70 | 71 | 78 | 79 | 86 | 87 | 94 | 95 | 96 | 97 | 107 | 108 |