├── .github
└── workflows
│ └── release.yml
├── .gitignore
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
├── release
│ ├── app-release.apk
│ └── output-metadata.json
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── samsung
│ │ └── android
│ │ └── app
│ │ └── networkstoragemanager
│ │ ├── CachedFileList.java
│ │ ├── FileManager.java
│ │ ├── LocationList.java
│ │ ├── MainService.java
│ │ └── libsupport
│ │ ├── IProgressCallback.java
│ │ ├── IRequestInterface.java
│ │ ├── IResultCallback.java
│ │ └── RequestCode.java
│ └── res
│ ├── drawable
│ ├── ic_launcher.xml
│ ├── ic_launcher_background.png
│ └── ic_launcher_foreground.png
│ ├── values-in
│ └── strings.xml
│ └── values
│ └── strings.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── readme-res
├── icon.png
├── screenshot_1.png
├── screenshot_2.png
└── screenshot_3.png
└── settings.gradle
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: New Release
2 | on:
3 | workflow_dispatch:
4 |
5 | jobs:
6 | release:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - name: Checkout
10 | uses: actions/checkout@v2
11 | - name: Init values
12 | id: values
13 | run: |
14 | version=$(grep -Po -m 1 '(?<=versionName ).*' ./app/build.gradle | tr -d \")
15 | echo ::set-output name=name::My Files Root Extension v$version
16 | echo ::set-output name=tag::v$version
17 | echo ::set-output name=apk::My_Files_Root_Extension_v$version
18 | - name: Create release
19 | id: create_release
20 | uses: actions/create-release@v1
21 | env:
22 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 | with:
24 | release_name: ${{ steps.values.outputs.name }}
25 | tag_name: ${{ steps.values.outputs.tag }}
26 | body: No changelog
27 | - name: Add apk
28 | uses: actions/upload-release-asset@v1
29 | env:
30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 | with:
32 | upload_url: ${{ steps.create_release.outputs.upload_url }}
33 | asset_path: ./app/release/app-release.apk
34 | asset_name: ${{ steps.values.outputs.apk }}.apk
35 | asset_content_type: application/vnd.android.package-archive
36 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | .idea
5 | .DS_Store
6 | /build
7 | /captures
8 | .externalNativeBuild
9 | .cxx
10 | local.properties
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #
My Files Root Extension
2 | This will allow the [Samsung My Files](https://play.google.com/store/apps/details?id=com.sec.android.app.myfiles) app to access the root directory of your rooted android device without modding it. It makes it possible because it's replacing the ``Network Storage Manager`` (com.samsung.android.app.networkstoragemanager), a separate app which provides folder and file information to the Samsung My Files app and handles file operations. So instead of providing server files, this app will provide files from the root directory and handle operations with root rights. You can download and install the latest apk [here](https://github.com/Yanndroid/Samsung-My-Files-Root-Extension/raw/master/app/release/app-release.apk). Unfortunately, due to how Samsung intended this feature, it will require an internet connection. This app also has a cache for file lists, but if a folder contains a lot of files, it may take some time to load them all for the first time.
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | compileSdk 31
7 |
8 | defaultConfig {
9 | applicationId "com.samsung.android.app.networkstoragemanager"
10 | minSdk 26
11 | targetSdk 31
12 | versionCode 2000000000 //>1210103011
13 | versionName "1.0.0"
14 |
15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | compileOptions {
25 | sourceCompatibility JavaVersion.VERSION_1_8
26 | targetCompatibility JavaVersion.VERSION_1_8
27 | }
28 | }
29 |
30 | dependencies {
31 |
32 | implementation "com.github.topjohnwu.libsu:core:5.0.1"
33 | implementation "com.github.topjohnwu.libsu:io:5.0.1"
34 |
35 | }
--------------------------------------------------------------------------------
/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
--------------------------------------------------------------------------------
/app/release/app-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yanndroid/Samsung-My-Files-Root-Extension/28137dc27908fa90937c3c89e4dc261fc6a7b6ec/app/release/app-release.apk
--------------------------------------------------------------------------------
/app/release/output-metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 3,
3 | "artifactType": {
4 | "type": "APK",
5 | "kind": "Directory"
6 | },
7 | "applicationId": "com.samsung.android.app.networkstoragemanager",
8 | "variantName": "release",
9 | "elements": [
10 | {
11 | "type": "SINGLE",
12 | "filters": [],
13 | "attributes": [],
14 | "versionCode": 2000000000,
15 | "versionName": "1.0.0",
16 | "outputFile": "app-release.apk"
17 | }
18 | ],
19 | "elementType": "File"
20 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/samsung/android/app/networkstoragemanager/CachedFileList.java:
--------------------------------------------------------------------------------
1 | package com.samsung.android.app.networkstoragemanager;
2 |
3 | import android.os.Bundle;
4 |
5 | import java.util.ArrayList;
6 | import java.util.HashMap;
7 |
8 | public class CachedFileList {
9 | private static final HashMap> sCachedData = new HashMap<>();
10 |
11 | public static boolean contains(String path) {
12 | return sCachedData.containsKey(path);
13 | }
14 |
15 | public static ArrayList get(String path) {
16 | return sCachedData.get(path);
17 | }
18 |
19 | public static void removeFileList(String path) {
20 | sCachedData.remove(path);
21 | }
22 |
23 | public static void clear() {
24 | sCachedData.clear();
25 | }
26 |
27 | public static ArrayList saveFileList(String filePath, ArrayList fileList) {
28 | sCachedData.put(filePath, fileList);
29 | return fileList;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/samsung/android/app/networkstoragemanager/FileManager.java:
--------------------------------------------------------------------------------
1 | package com.samsung.android.app.networkstoragemanager;
2 |
3 | import android.os.Bundle;
4 | import android.os.ParcelFileDescriptor;
5 | import android.util.Log;
6 |
7 | import com.samsung.android.app.networkstoragemanager.libsupport.IProgressCallback;
8 | import com.topjohnwu.superuser.io.SuFile;
9 | import com.topjohnwu.superuser.io.SuFileInputStream;
10 | import com.topjohnwu.superuser.io.SuFileOutputStream;
11 |
12 | import java.io.IOException;
13 | import java.io.InputStream;
14 | import java.io.OutputStream;
15 | import java.util.ArrayList;
16 | import java.util.concurrent.Executors;
17 |
18 | public class FileManager {
19 |
20 | public static boolean exists(String filePath) {
21 | return (new SuFile(filePath)).exists();
22 | }
23 |
24 | public static boolean renameFile(String filePath, String newName) {
25 | clearPathCache(filePath, true);
26 | SuFile file = new SuFile(filePath);
27 | return file.renameTo(new SuFile(file.getParent() + "/" + newName));
28 | }
29 |
30 | public static boolean newFolder(String path, String name) {
31 | clearPathCache(path, false);
32 | SuFile dir = new SuFile(path + "/" + name);
33 | return dir.mkdirs();
34 | }
35 |
36 | public static boolean deleteFile(String filePath) {
37 | clearPathCache(filePath, true);
38 | SuFile file = new SuFile(filePath);
39 | return file.deleteRecursive();
40 | }
41 |
42 | public static twoReturn copy(String sourcePath, String dstFolderPath, String dstFileName, IProgressCallback mProgressCallback, long requestId, int reqCode, long progress) {
43 | clearPathCache(dstFolderPath, false);
44 | SuFile file = new SuFile(sourcePath);
45 | Log.e("copy", sourcePath + " to " + dstFolderPath + "/" + dstFileName);
46 | if (file.isDirectory()) {
47 | boolean isSuccess = newFolder(dstFolderPath, dstFileName);
48 | if (isSuccess) {
49 | for (String fileName : file.list()) {
50 | twoReturn t = copy(sourcePath + "/" + fileName, dstFolderPath + "/" + dstFileName, fileName, mProgressCallback, requestId, reqCode, progress);
51 | isSuccess &= t.isSuccess;
52 | progress += t.progress;
53 | }
54 | }
55 | return new twoReturn(isSuccess, progress);
56 | } else {
57 | try {
58 | InputStream in = SuFileInputStream.open(sourcePath);
59 | OutputStream out = SuFileOutputStream.open(dstFolderPath + "/" + dstFileName);
60 |
61 | byte[] buf = new byte[4096];
62 | int len;
63 | long total = progress;
64 | Bundle bundle = new Bundle();
65 | while ((len = in.read(buf)) > 0) {
66 | bundle.putLong("handledSize", total += len);
67 | mProgressCallback.onProgress(requestId, reqCode, bundle);
68 | out.write(buf, 0, len);
69 | }
70 |
71 | in.close();
72 | out.close();
73 | return new twoReturn(true, total);
74 | } catch (Exception e) {
75 | e.printStackTrace();
76 | return new twoReturn(false, progress);
77 | }
78 | }
79 | }
80 |
81 | static class twoReturn { //python is definitely better for this :(
82 | public boolean isSuccess;
83 | public long progress;
84 |
85 | twoReturn(boolean isSuccess, long progress) {
86 | this.isSuccess = isSuccess;
87 | this.progress = progress;
88 | }
89 | }
90 |
91 | public static boolean copy(ParcelFileDescriptor fileDescriptor, String dstFolderPath, String dstFileName, IProgressCallback mProgressCallback, long requestId, int reqCode) {
92 | clearPathCache(dstFolderPath, false);
93 | try {
94 | InputStream in = new ParcelFileDescriptor.AutoCloseInputStream(fileDescriptor);
95 | OutputStream out = SuFileOutputStream.open(dstFolderPath + "/" + dstFileName);
96 |
97 | byte[] buf = new byte[4096];
98 | int len;
99 | long total = 0;
100 | Bundle progress = new Bundle();
101 | while ((len = in.read(buf)) > 0) {
102 | progress.putLong("handledSize", total += len);
103 | mProgressCallback.onProgress(requestId, reqCode, progress);
104 | out.write(buf, 0, len);
105 | }
106 |
107 | in.close();
108 | out.close();
109 | return true;
110 | } catch (Exception e) {
111 | e.printStackTrace();
112 | return false;
113 | }
114 | }
115 |
116 | public static ArrayList getFileList(String filePath, long serverId) {
117 | ArrayList fileList = new ArrayList<>();
118 | SuFile[] files = new SuFile(filePath).listFiles();
119 | if (files == null) return fileList;
120 | for (SuFile file : files)
121 | fileList.add(getFileObject(file, serverId));
122 | return fileList;
123 | }
124 |
125 | public static ArrayList getFileListWithCache(String filePath, long serverId) {
126 | if (CachedFileList.contains(filePath)) {
127 | //return cached file list and update it in async
128 | Executors.newSingleThreadExecutor().execute(() -> CachedFileList.saveFileList(filePath, getFileList(filePath, serverId)));
129 | return CachedFileList.get(filePath);
130 | } else {
131 | //return file list and cache it
132 | return CachedFileList.saveFileList(filePath, getFileList(filePath, serverId));
133 | }
134 | }
135 |
136 | public static void clearPathCache(String path, boolean parent) {
137 | if (parent) path = path.substring(0, path.lastIndexOf("/"));
138 | if (path == null) return;
139 | Log.e("clearCache", path);
140 | CachedFileList.removeFileList(path);
141 | }
142 |
143 | public static Bundle getFileObject(String filePath, long serverId) {
144 | return getFileObject(new SuFile(filePath), serverId);
145 | }
146 |
147 | private static Bundle getFileObject(SuFile file, long serverId) {
148 | Bundle bFile = new Bundle();
149 | bFile.putLong("serverId", serverId);
150 | bFile.putString("filePath", file.getPath());
151 | bFile.putString("fileName", file.getName());
152 | bFile.putBoolean("isDirectory", !file.isFile());
153 | if (file.isFile()) bFile.putLong("fileSize", file.length());
154 | bFile.putLong("fileDate", file.lastModified());
155 | return bFile;
156 | }
157 |
158 | public static ParcelFileDescriptor getFileDescriptor(String filePath) {
159 | try {
160 | InputStream inputStream = SuFileInputStream.open(filePath);
161 | ParcelFileDescriptor[] pipe = ParcelFileDescriptor.createPipe();
162 | new TransferThread(inputStream, new ParcelFileDescriptor.AutoCloseOutputStream(pipe[1])).start();
163 | return pipe[0];
164 | } catch (Exception e) {
165 | e.printStackTrace();
166 | return null;
167 | }
168 | }
169 |
170 | public static ArrayList getSharedFolderRootDir(long serverId) {
171 | ArrayList fileList = new ArrayList<>();
172 | Bundle bRootFile = new Bundle();
173 | bRootFile.putLong("serverId", serverId);
174 | bRootFile.putString("filePath", "/");
175 | bRootFile.putBoolean("isDirectory", true);
176 | fileList.add(bRootFile);
177 | return fileList;
178 | }
179 |
180 | public static String getSDCardPath() {
181 | SuFile storages = new SuFile("storage");
182 | String[] list = storages.list((file, s) -> s.matches("([A-Z0-9]){4}-([A-Z0-9]){4}"));
183 | return list.length > 0 ? list[0] : null;
184 | }
185 |
186 | private static class TransferThread extends Thread {
187 | final InputStream mIn;
188 | final OutputStream mOut;
189 |
190 | TransferThread(InputStream in, OutputStream out) {
191 | super("IPC Transfer Thread");
192 | mIn = in;
193 | mOut = out;
194 | setDaemon(true);
195 | }
196 |
197 | @Override
198 | public void run() {
199 | byte[] buf = new byte[4096];
200 | int len;
201 |
202 | try {
203 | while ((len = mIn.read(buf)) > 0) {
204 | mOut.write(buf, 0, len);
205 | }
206 | } catch (IOException e) {
207 | e.printStackTrace();
208 | } finally {
209 | try {
210 | mIn.close();
211 | } catch (IOException e) {
212 | e.printStackTrace();
213 | }
214 | try {
215 | mOut.close();
216 | } catch (IOException e) {
217 | e.printStackTrace();
218 | }
219 | }
220 | }
221 | }
222 |
223 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/samsung/android/app/networkstoragemanager/LocationList.java:
--------------------------------------------------------------------------------
1 | package com.samsung.android.app.networkstoragemanager;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.util.Log;
6 |
7 | import org.json.JSONArray;
8 | import org.json.JSONException;
9 | import org.json.JSONObject;
10 |
11 | import java.util.ArrayList;
12 |
13 | public class LocationList {
14 |
15 |
16 | public static ArrayList loadList(Context context) {
17 | String json = context.getSharedPreferences("sp", Context.MODE_PRIVATE).getString("locations", null);
18 | if (json == null) return getDefaultList(true);
19 | ArrayList list = parseJson(json);
20 | return list != null ? list : getDefaultList(true);
21 | }
22 |
23 | public static void saveList(Context context, ArrayList list) {
24 | context.getSharedPreferences("sp", Context.MODE_PRIVATE).edit().putString("locations", parseList(list)).apply();
25 | }
26 |
27 | private static ArrayList parseJson(String json) {
28 | try {
29 | Log.e("load", json);
30 | JSONArray jsonArray = new JSONArray(json);
31 | ArrayList list = new ArrayList<>();
32 | for (int i = 0; i < jsonArray.length(); i++) {
33 | JSONObject jsonObject = jsonArray.getJSONObject(i);
34 | Bundle bundle = new Bundle();
35 | bundle.putLong("serverId", jsonObject.getLong("serverId"));
36 | bundle.putString("serverName", jsonObject.optString("serverName"));
37 | bundle.putString("serverAddr", jsonObject.optString("serverAddr"));
38 | bundle.putString("sharedFolder", jsonObject.optString("sharedFolder"));
39 | bundle.putBoolean("isAnonymousMode", true);
40 | bundle.putInt("serverPort", 1);
41 | list.add(bundle);
42 | }
43 | return list;
44 | } catch (JSONException e) {
45 | e.printStackTrace();
46 | return null;
47 | }
48 | }
49 |
50 | private static String parseList(ArrayList list) {
51 | try {
52 | JSONArray jsonArray = new JSONArray();
53 | for (Bundle bundle : list) {
54 | JSONObject jsonObject = new JSONObject();
55 | jsonObject.put("serverId", bundle.getLong("serverId"));
56 | jsonObject.put("serverName", bundle.getString("serverName"));
57 | jsonObject.put("serverAddr", bundle.getString("serverAddr"));
58 | jsonObject.put("sharedFolder", bundle.getString("sharedFolder"));
59 | jsonArray.put(jsonObject);
60 | }
61 | Log.e("save", jsonArray.toString());
62 | return jsonArray.toString();
63 | } catch (JSONException e) {
64 | e.printStackTrace();
65 | return null;
66 | }
67 | }
68 |
69 | public static ArrayList getDefaultList(boolean serverIds) {
70 | ArrayList defaultList = new ArrayList<>();
71 | Bundle bStorage = new Bundle();
72 | bStorage.putBoolean("isAnonymousMode", true);
73 | bStorage.putInt("serverPort", 1);
74 |
75 | if (serverIds) bStorage.putLong("serverId", 1);
76 | bStorage.putString("serverAddr", "#\\");
77 | bStorage.putString("serverName", "Root");
78 | bStorage.putString("sharedFolder", "");
79 | defaultList.add(new Bundle(bStorage));
80 |
81 | if (serverIds) bStorage.putLong("serverId", 2);
82 | bStorage.putString("serverAddr", "#\\system");
83 | bStorage.putString("serverName", "System folder");
84 | bStorage.putString("sharedFolder", "system");
85 | defaultList.add(new Bundle(bStorage));
86 |
87 | if (serverIds) bStorage.putLong("serverId", 3);
88 | bStorage.putString("serverAddr", "#\\data");
89 | bStorage.putString("serverName", "Data folder");
90 | bStorage.putString("sharedFolder", "data");
91 | defaultList.add(new Bundle(bStorage));
92 |
93 | if (serverIds) bStorage.putLong("serverId", 4);
94 | bStorage.putString("serverAddr", "#\\sdcard");
95 | bStorage.putString("serverName", "Internal storage");
96 | bStorage.putString("sharedFolder", "sdcard");
97 | defaultList.add(new Bundle(bStorage));
98 |
99 | String sdcard = FileManager.getSDCardPath();
100 | if (sdcard != null) {
101 | if (serverIds) bStorage.putLong("serverId", 5);
102 | bStorage.putString("serverAddr", "#\\storage\\" + sdcard);
103 | bStorage.putString("serverName", "SD card");
104 | bStorage.putString("sharedFolder", "storage/" + sdcard);
105 | defaultList.add(new Bundle(bStorage));
106 | }
107 |
108 | return defaultList;
109 | }
110 |
111 | }
112 |
--------------------------------------------------------------------------------
/app/src/main/java/com/samsung/android/app/networkstoragemanager/MainService.java:
--------------------------------------------------------------------------------
1 | package com.samsung.android.app.networkstoragemanager;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.os.IBinder;
7 | import android.os.ParcelFileDescriptor;
8 | import android.os.RemoteException;
9 | import android.util.Log;
10 |
11 | import com.samsung.android.app.networkstoragemanager.libsupport.IProgressCallback;
12 | import com.samsung.android.app.networkstoragemanager.libsupport.IRequestInterface;
13 | import com.samsung.android.app.networkstoragemanager.libsupport.IResultCallback;
14 | import com.samsung.android.app.networkstoragemanager.libsupport.RequestCode;
15 | import com.topjohnwu.superuser.Shell;
16 |
17 | import java.lang.reflect.Field;
18 | import java.util.ArrayList;
19 | import java.util.HashMap;
20 | import java.util.Map;
21 | import java.util.concurrent.atomic.AtomicBoolean;
22 |
23 | public class MainService extends Service implements RequestCode {
24 |
25 | private ArrayList storageLocations = new ArrayList<>();
26 | private IResultCallback mCallback;
27 | private IProgressCallback mProgressCallback;
28 | private Map mRequestInfoMap = new HashMap();
29 |
30 | private final IRequestInterface.Stub mBinder = new IRequestInterface.Stub() {
31 |
32 | public void asyncRequest(long serverId, String type, int reqCode, Bundle extras) {
33 | (new Thread(() -> syncRequest(serverId, type, reqCode, extras))).start();
34 | }
35 |
36 | public boolean cancel(long serverId) {
37 | RequestInfo requestInfo = mRequestInfoMap.get(serverId);
38 | if (requestInfo != null) {
39 | requestInfo.mCanceled.set(true);
40 | return true;
41 | } else {
42 | return false;
43 | }
44 | }
45 |
46 | public boolean registerProgressCallback(IProgressCallback var1) {
47 | MainService.this.mProgressCallback = var1;
48 | return true;
49 | }
50 |
51 | public boolean registerResultCallback(IResultCallback var1) {
52 | MainService.this.mCallback = var1;
53 | return true;
54 | }
55 |
56 | public void retryRequest(long serverId) {
57 | RequestInfo requestInfo = mRequestInfoMap.get(serverId);
58 | if (requestInfo != null) {
59 | asyncRequest(requestInfo.mServerId, requestInfo.mType, requestInfo.mReqCode, requestInfo.mExtras);
60 | }
61 | }
62 |
63 | public Bundle syncRequest(long serverId, String type, int reqCode, Bundle extras) {
64 | RequestInfo requestInfo = new RequestInfo(serverId, type, reqCode, extras);
65 | mRequestInfoMap.put(serverId, requestInfo);
66 | Bundle result = new Bundle();
67 | handleRequest(requestInfo, result);
68 | return result;
69 | }
70 |
71 | public boolean unregisterProgressCallback(IProgressCallback var1) {
72 | MainService.this.mProgressCallback = null;
73 | return true;
74 | }
75 |
76 | public boolean unregisterResultCallback(IResultCallback var1) {
77 | MainService.this.mCallback = null;
78 | return true;
79 | }
80 | };
81 |
82 | private void handleRequest(RequestInfo requestInfo, Bundle result) {
83 | result.putBoolean("isSuccess", true);
84 | result.putBoolean("isValidRequest", true);
85 |
86 | Log.e("handleRequest", requestInfo.mReqCode + " " + requestInfo.mType);
87 | Bundle extras = requestInfo.mExtras;
88 | for (String s : extras.keySet()) Log.i(s, String.valueOf(extras.get(s)));
89 |
90 | switch (requestInfo.mReqCode) {
91 | case CONNECT:
92 | //0
93 | break;
94 | case GET_SERVER_LIST:
95 | //1 (per type!!)
96 | if (requestInfo.mType.equals("SMB")) {
97 | result.putParcelableArrayList("serverList", storageLocations);
98 | }
99 | result.putBoolean("result", true);
100 | break;
101 | case ADD_SERVER:
102 | //2
103 | if (requestInfo.mType.equals("SMB")) {
104 | long newServerId = storageLocations.size() > 0 ? storageLocations.get(storageLocations.size() - 1).getLong("serverId") + 1 : 1; //new id
105 |
106 | Bundle newLocation = new Bundle(extras);
107 | newLocation.putLong("serverId", newServerId);
108 | storageLocations.add(newLocation);
109 |
110 | result.putBoolean("result", true);
111 | result.putLong("serverId", newServerId);
112 | } else {
113 | result.putBoolean("result", false); //only allow smb
114 | }
115 | break;
116 | case UPDATE_SERVER:
117 | //4
118 | result.putBoolean("result", false);
119 | for (Bundle location : storageLocations) {
120 | if (location.getLong("serverId") == extras.getLong("serverId")) {
121 | location.putAll(extras);
122 | result.putBoolean("result", true);
123 | break;
124 | }
125 | }
126 | break;
127 | case DELETE_SERVER:
128 | //6
129 | result.putBoolean("result", false);
130 | for (Bundle location : storageLocations) {
131 | if (location.getLong("serverId") == extras.getLong("serverId")) {
132 | storageLocations.remove(location);
133 | result.putBoolean("result", true);
134 | break;
135 | }
136 | }
137 | break;
138 | case FIND_SERVER:
139 | //7 (when opening smb scan dialog)
140 | result.putParcelableArrayList("serverList", LocationList.getDefaultList(false));
141 | result.putBoolean("result", true);
142 | break;
143 | case GET_SHARED_FOLDER:
144 | //8 (aka root folder)
145 | //result.putParcelableArrayList("sharedFolderList", FileManager.getFileList("/", extras.getLong("serverId")));
146 | result.putParcelableArrayList("sharedFolderList", FileManager.getSharedFolderRootDir(extras.getLong("serverId")));
147 | result.putBoolean("result", true);
148 | break;
149 | case GET_FILE_LIST:
150 | //9
151 | //result.putParcelableArrayList("fileList", FileManager.getFileList(extras.getString("filePath"), extras.getLong("serverId")));
152 | result.putParcelableArrayList("fileList", FileManager.getFileListWithCache(extras.getString("filePath"), extras.getLong("serverId")));
153 | result.putBoolean("result", true);
154 | break;
155 | case GET_FILE_OBJECT:
156 | //10
157 | result.putParcelable("fileObject", FileManager.getFileObject(extras.getString("filePath"), extras.getLong("serverId")));
158 | result.putBoolean("result", true);
159 | break;
160 | case GET_STRING_MAP:
161 | //11
162 | Field[] fields = R.string.class.getDeclaredFields();
163 | Bundle bFiled = new Bundle();
164 | for (Field field : fields) {
165 | try {
166 | bFiled.putString(field.getName(), getResources().getString(field.getInt(null)));
167 | } catch (Exception e) {
168 | e.printStackTrace();
169 | bFiled.putString(field.getName(), "");
170 | }
171 | }
172 | result.putBundle("result", bFiled);
173 | break;
174 | case GET_RESOURCE:
175 | //12
176 | break;
177 | case VERIFY_SERVER_INFO:
178 | //13 (init server info)
179 | break;
180 | case CHECK_PERMISSION:
181 | //14 (before opening)
182 | Shell.getShell(); //request root
183 | break;
184 | case GET_SERVER_COUNT:
185 | //15
186 | break;
187 | case REMOVE_MONITOR:
188 | //16 (delete request-info)
189 | /*mRequestInfoMap.remove(requestInfo.mServerId);
190 | result.putBoolean("result", true);*/
191 | break;
192 | case REMOVE_CACHED_FILE_LIST:
193 | //17
194 | CachedFileList.clear();
195 | result.putBoolean("result", true);
196 | break;
197 | case CREATE_FOLDER:
198 | //121
199 | result.putBoolean("isSuccess", FileManager.newFolder(extras.getString("parentPath"), extras.getString("newName")));
200 | result.putBoolean("result", true);
201 | break;
202 | case RENAME:
203 | //122
204 | result.putBoolean("isSuccess", FileManager.renameFile(extras.getString("sourcePath"), extras.getString("newName")));
205 | result.putBoolean("result", true);
206 | break;
207 | case UPLOAD:
208 | //123 (copy)
209 | result.putBoolean("isSuccess", FileManager.copy((ParcelFileDescriptor) extras.getParcelable("fileDescriptor"), extras.getString("dstFolderPath"), extras.getString("dstFileName"), mProgressCallback, requestInfo.mServerId, requestInfo.mReqCode));
210 | result.putBoolean("result", true);
211 | break;
212 | case GET_FILE_DESCRIPTOR:
213 | //124 (click, copy, move)
214 | result.putParcelable("fileDescriptor", FileManager.getFileDescriptor(extras.getString("sourcePath")));
215 | result.putBoolean("result", true);
216 | break;
217 | case DELETE:
218 | //125
219 | result.putBoolean("isSuccess", FileManager.deleteFile(extras.getString("sourcePath")));
220 | result.putBoolean("result", true);
221 | break;
222 | case INTERNAL_COPY:
223 | //126
224 | result.putBoolean("isSuccess", FileManager.copy(extras.getString("sourcePath"), extras.getString("dstFolderPath"), extras.getString("dstFileName"), mProgressCallback, requestInfo.mServerId, requestInfo.mReqCode, 0).isSuccess);
225 | result.putBoolean("result", true);
226 | break;
227 | case INTERNAL_MOVE:
228 | //127
229 | boolean isSuccess = FileManager.copy(extras.getString("sourcePath"), extras.getString("dstFolderPath"), extras.getString("dstFileName"), mProgressCallback, requestInfo.mServerId, requestInfo.mReqCode, 0).isSuccess;
230 | result.putBoolean("isSuccess", isSuccess && FileManager.deleteFile(extras.getString("sourcePath")));
231 | result.putBoolean("result", true);
232 | break;
233 | case EXTERNAL_COPY:
234 | //128
235 | break;
236 | case EXTERNAL_MOVE:
237 | //129
238 | break;
239 | case EXIST:
240 | //130
241 | result.putBoolean("result", FileManager.exists(extras.getString("sourcePath")));
242 | break;
243 | }
244 |
245 | mRequestInfoMap.remove(requestInfo.mServerId);
246 | if (requestInfo.mCanceled.get()) return;
247 |
248 | try {
249 | this.mCallback.onSuccess(requestInfo.mServerId, requestInfo.mReqCode, result);
250 | } catch (RemoteException e) {
251 | e.printStackTrace();
252 | }
253 | }
254 |
255 | public IBinder onBind(Intent var1) {
256 | return this.mBinder;
257 | }
258 |
259 | public void onCreate() {
260 | if (Shell.getCachedShell() == null) {
261 | Shell.setDefaultBuilder(Shell.Builder.create().setFlags(Shell.FLAG_MOUNT_MASTER));
262 | }
263 | storageLocations = LocationList.loadList(this);
264 | }
265 |
266 | public void onDestroy() {
267 | super.onDestroy();
268 | LocationList.saveList(this, storageLocations);
269 | }
270 |
271 | public static class RequestInfo {
272 | public final AtomicBoolean mCanceled;
273 | public final Bundle mExtras;
274 | public final int mReqCode;
275 | public final long mServerId;
276 | public final String mType;
277 |
278 | private RequestInfo(long serverId, String type, int requestCode, Bundle extras) {
279 | this.mCanceled = new AtomicBoolean(false);
280 | this.mServerId = serverId;
281 | this.mType = type;
282 | this.mReqCode = requestCode;
283 | this.mExtras = extras;
284 | }
285 | }
286 |
287 | }
288 |
--------------------------------------------------------------------------------
/app/src/main/java/com/samsung/android/app/networkstoragemanager/libsupport/IProgressCallback.java:
--------------------------------------------------------------------------------
1 | package com.samsung.android.app.networkstoragemanager.libsupport;
2 |
3 | import android.os.Binder;
4 | import android.os.Bundle;
5 | import android.os.IBinder;
6 | import android.os.IInterface;
7 | import android.os.Parcel;
8 | import android.os.RemoteException;
9 |
10 | public interface IProgressCallback extends IInterface {
11 | void onProgress(long var1, int var3, Bundle var4) throws RemoteException;
12 |
13 | abstract class Stub extends Binder implements IProgressCallback {
14 | private static final String DESCRIPTOR = "com.samsung.android.app.networkstoragemanager.libsupport.IProgressCallback";
15 |
16 | public Stub() {
17 | this.attachInterface(this, DESCRIPTOR);
18 | }
19 |
20 | public static IProgressCallback asInterface(IBinder var0) {
21 | if (var0 == null) {
22 | return null;
23 | } else {
24 | IInterface var1 = var0.queryLocalInterface(DESCRIPTOR);
25 | return var1 != null && var1 instanceof IProgressCallback ? (IProgressCallback) var1 : new Proxy(var0);
26 | }
27 | }
28 |
29 | public static IProgressCallback getDefaultImpl() {
30 | return Proxy.sDefaultImpl;
31 | }
32 |
33 | public IBinder asBinder() {
34 | return this;
35 | }
36 |
37 | public boolean onTransact(int var1, Parcel var2, Parcel var3, int var4) throws RemoteException {
38 | if (var1 != 1) {
39 | if (var1 != 1598968902) {
40 | return super.onTransact(var1, var2, var3, var4);
41 | } else {
42 | var3.writeString(DESCRIPTOR);
43 | return true;
44 | }
45 | } else {
46 | var2.enforceInterface(DESCRIPTOR);
47 | long var5 = var2.readLong();
48 | var1 = var2.readInt();
49 | Bundle var7;
50 | if (var2.readInt() != 0) {
51 | var7 = Bundle.CREATOR.createFromParcel(var2);
52 | } else {
53 | var7 = null;
54 | }
55 |
56 | this.onProgress(var5, var1, var7);
57 | return true;
58 | }
59 | }
60 |
61 | private static class Proxy implements IProgressCallback {
62 | public static IProgressCallback sDefaultImpl;
63 | private IBinder mRemote;
64 |
65 | Proxy(IBinder var1) {
66 | this.mRemote = var1;
67 | }
68 |
69 | public IBinder asBinder() {
70 | return this.mRemote;
71 | }
72 |
73 | public void onProgress(long var1, int var3, Bundle var4) {
74 | Parcel var5 = Parcel.obtain();
75 |
76 | label215:
77 | {
78 | try {
79 | var5.writeInterfaceToken(DESCRIPTOR);
80 | var5.writeLong(var1);
81 | var5.writeInt(var3);
82 | } catch (Throwable var25) {
83 | break label215;
84 | }
85 |
86 | if (var4 != null) {
87 | try {
88 | var5.writeInt(1);
89 | var4.writeToParcel(var5, 0);
90 | } catch (Throwable var24) {
91 | break label215;
92 | }
93 | } else {
94 | try {
95 | var5.writeInt(0);
96 | } catch (Throwable var23) {
97 | break label215;
98 | }
99 | }
100 |
101 | label201:
102 | {
103 | try {
104 | if (!this.mRemote.transact(1, var5, (Parcel) null, 1) && Stub.getDefaultImpl() != null) {
105 | Stub.getDefaultImpl().onProgress(var1, var3, var4);
106 | break label201;
107 | }
108 | } catch (Throwable var22) {
109 | break label215;
110 | }
111 |
112 | var5.recycle();
113 | return;
114 | }
115 |
116 | var5.recycle();
117 | return;
118 | }
119 |
120 | var5.recycle();
121 | }
122 | }
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/app/src/main/java/com/samsung/android/app/networkstoragemanager/libsupport/IRequestInterface.java:
--------------------------------------------------------------------------------
1 | package com.samsung.android.app.networkstoragemanager.libsupport;
2 |
3 | import android.os.Binder;
4 | import android.os.Bundle;
5 | import android.os.IBinder;
6 | import android.os.IInterface;
7 | import android.os.Parcel;
8 | import android.os.Parcelable;
9 | import android.os.RemoteException;
10 |
11 | public interface IRequestInterface extends IInterface {
12 | void asyncRequest(long var1, String var3, int var4, Bundle var5) throws RemoteException;
13 |
14 | boolean cancel(long var1) throws RemoteException;
15 |
16 | boolean registerProgressCallback(IProgressCallback var1) throws RemoteException;
17 |
18 | boolean registerResultCallback(IResultCallback var1) throws RemoteException;
19 |
20 | void retryRequest(long var1) throws RemoteException;
21 |
22 | Bundle syncRequest(long var1, String var3, int var4, Bundle var5) throws RemoteException;
23 |
24 | boolean unregisterProgressCallback(IProgressCallback var1) throws RemoteException;
25 |
26 | boolean unregisterResultCallback(IResultCallback var1) throws RemoteException;
27 |
28 | abstract class Stub extends Binder implements IRequestInterface {
29 | private static final String DESCRIPTOR = "com.samsung.android.app.networkstoragemanager.libsupport.IRequestInterface";
30 |
31 | public Stub() {
32 | this.attachInterface(this, DESCRIPTOR);
33 | }
34 |
35 | public static IRequestInterface getDefaultImpl() {
36 | return Proxy.sDefaultImpl;
37 | }
38 |
39 | public IBinder asBinder() {
40 | return this;
41 | }
42 |
43 | public boolean onTransact(int var1, Parcel var2, Parcel var3, int var4) throws RemoteException {
44 | if (var1 != 1598968902) {
45 | long var5;
46 | boolean var8;
47 | Bundle var9;
48 | switch (var1) {
49 | case 1:
50 | var2.enforceInterface(DESCRIPTOR);
51 | var8 = this.registerResultCallback(IResultCallback.Stub.asInterface(var2.readStrongBinder()));
52 | var3.writeNoException();
53 | var3.writeInt(var8 ? 1 : 0);
54 | return true;
55 | case 2:
56 | var2.enforceInterface(DESCRIPTOR);
57 | var8 = this.unregisterResultCallback(IResultCallback.Stub.asInterface(var2.readStrongBinder()));
58 | var3.writeNoException();
59 | var3.writeInt(var8 ? 1 : 0);
60 | return true;
61 | case 3:
62 | var2.enforceInterface(DESCRIPTOR);
63 | var8 = this.registerProgressCallback(IProgressCallback.Stub.asInterface(var2.readStrongBinder()));
64 | var3.writeNoException();
65 | var3.writeInt(var8 ? 1 : 0);
66 | return true;
67 | case 4:
68 | var2.enforceInterface(DESCRIPTOR);
69 | var8 = this.unregisterProgressCallback(IProgressCallback.Stub.asInterface(var2.readStrongBinder()));
70 | var3.writeNoException();
71 | var3.writeInt(var8 ? 1 : 0);
72 | return true;
73 | case 5:
74 | var2.enforceInterface(DESCRIPTOR);
75 | var5 = var2.readLong();
76 | String var7 = var2.readString();
77 | var1 = var2.readInt();
78 | if (var2.readInt() != 0) {
79 | var9 = Bundle.CREATOR.createFromParcel(var2);
80 | } else {
81 | var9 = null;
82 | }
83 |
84 | var9 = this.syncRequest(var5, var7, var1, var9);
85 | var3.writeNoException();
86 | if (var9 != null) {
87 | var3.writeInt(1);
88 | var9.writeToParcel(var3, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
89 | } else {
90 | var3.writeInt(0);
91 | }
92 |
93 | return true;
94 | case 6:
95 | var2.enforceInterface(DESCRIPTOR);
96 | var5 = var2.readLong();
97 | String var10 = var2.readString();
98 | var1 = var2.readInt();
99 | if (var2.readInt() != 0) {
100 | var9 = Bundle.CREATOR.createFromParcel(var2);
101 | } else {
102 | var9 = null;
103 | }
104 |
105 | this.asyncRequest(var5, var10, var1, var9);
106 | return true;
107 | case 7:
108 | var2.enforceInterface(DESCRIPTOR);
109 | var8 = this.cancel(var2.readLong());
110 | var3.writeNoException();
111 | var3.writeInt(var8 ? 1 : 0);
112 | return true;
113 | case 8:
114 | var2.enforceInterface(DESCRIPTOR);
115 | this.retryRequest(var2.readLong());
116 | var3.writeNoException();
117 | return true;
118 | default:
119 | return super.onTransact(var1, var2, var3, var4);
120 | }
121 | } else {
122 | var3.writeString(DESCRIPTOR);
123 | return true;
124 | }
125 | }
126 |
127 | private static class Proxy implements IRequestInterface {
128 | public static IRequestInterface sDefaultImpl;
129 | private IBinder mRemote;
130 |
131 | Proxy(IBinder var1) {
132 | this.mRemote = var1;
133 | }
134 |
135 | public IBinder asBinder() {
136 | return this.mRemote;
137 | }
138 |
139 | public void asyncRequest(long var1, String var3, int var4, Bundle var5) {
140 | Parcel var6 = Parcel.obtain();
141 |
142 | label215:
143 | {
144 | try {
145 | var6.writeInterfaceToken(DESCRIPTOR);
146 | var6.writeLong(var1);
147 | var6.writeString(var3);
148 | var6.writeInt(var4);
149 | } catch (Throwable var26) {
150 | break label215;
151 | }
152 |
153 | if (var5 != null) {
154 | try {
155 | var6.writeInt(1);
156 | var5.writeToParcel(var6, 0);
157 | } catch (Throwable var25) {
158 | break label215;
159 | }
160 | } else {
161 | try {
162 | var6.writeInt(0);
163 | } catch (Throwable var24) {
164 | break label215;
165 | }
166 | }
167 |
168 | label201:
169 | {
170 | try {
171 | if (!this.mRemote.transact(6, var6, (Parcel) null, 1) && Stub.getDefaultImpl() != null) {
172 | Stub.getDefaultImpl().asyncRequest(var1, var3, var4, var5);
173 | break label201;
174 | }
175 | } catch (Throwable var23) {
176 | break label215;
177 | }
178 |
179 | var6.recycle();
180 | return;
181 | }
182 |
183 | var6.recycle();
184 | return;
185 | }
186 |
187 | var6.recycle();
188 | }
189 |
190 | public boolean cancel(long var1) {
191 | Parcel var3 = Parcel.obtain();
192 | Parcel var4 = Parcel.obtain();
193 |
194 | label171:
195 | {
196 | IBinder var5;
197 | try {
198 | var3.writeInterfaceToken(DESCRIPTOR);
199 | var3.writeLong(var1);
200 | var5 = this.mRemote;
201 | } catch (Throwable var18) {
202 | break label171;
203 | }
204 |
205 | boolean var6 = false;
206 |
207 | label172:
208 | {
209 | try {
210 | if (!var5.transact(7, var3, var4, 0) && Stub.getDefaultImpl() != null) {
211 | var6 = Stub.getDefaultImpl().cancel(var1);
212 | break label172;
213 | }
214 | } catch (Throwable var19) {
215 | break label171;
216 | }
217 |
218 | int var7;
219 | try {
220 | var4.readException();
221 | var7 = var4.readInt();
222 | } catch (Throwable var17) {
223 | break label171;
224 | }
225 |
226 | if (var7 != 0) {
227 | var6 = true;
228 | }
229 |
230 | var4.recycle();
231 | var3.recycle();
232 | return var6;
233 | }
234 |
235 | var4.recycle();
236 | var3.recycle();
237 | return var6;
238 | }
239 |
240 | var4.recycle();
241 | var3.recycle();
242 | return false;
243 | }
244 |
245 | public boolean registerProgressCallback(IProgressCallback var1) {
246 | Parcel var2 = Parcel.obtain();
247 | Parcel var3 = Parcel.obtain();
248 |
249 | label335:
250 | {
251 | try {
252 | var2.writeInterfaceToken(DESCRIPTOR);
253 | } catch (Throwable var35) {
254 | break label335;
255 | }
256 |
257 | IBinder var4;
258 | if (var1 != null) {
259 | try {
260 | var4 = var1.asBinder();
261 | } catch (Throwable var34) {
262 | break label335;
263 | }
264 | } else {
265 | var4 = null;
266 | }
267 |
268 | try {
269 | var2.writeStrongBinder(var4);
270 | var4 = this.mRemote;
271 | } catch (Throwable var33) {
272 | break label335;
273 | }
274 |
275 | boolean var5 = false;
276 |
277 | label329:
278 | {
279 | try {
280 | if (var4.transact(3, var2, var3, 0) || Stub.getDefaultImpl() == null) {
281 | break label329;
282 | }
283 |
284 | var5 = Stub.getDefaultImpl().registerProgressCallback(var1);
285 | } catch (Throwable var36) {
286 | break label335;
287 | }
288 |
289 | var3.recycle();
290 | var2.recycle();
291 | return var5;
292 | }
293 |
294 | int var6;
295 | try {
296 | var3.readException();
297 | var6 = var3.readInt();
298 | } catch (Throwable var32) {
299 | break label335;
300 | }
301 |
302 | if (var6 != 0) {
303 | var5 = true;
304 | }
305 |
306 | var3.recycle();
307 | var2.recycle();
308 | return var5;
309 | }
310 |
311 | var3.recycle();
312 | var2.recycle();
313 | return false;
314 | }
315 |
316 | public boolean registerResultCallback(IResultCallback var1) {
317 | Parcel var2 = Parcel.obtain();
318 | Parcel var3 = Parcel.obtain();
319 |
320 | label335:
321 | {
322 | try {
323 | var2.writeInterfaceToken(DESCRIPTOR);
324 | } catch (Throwable var35) {
325 | break label335;
326 | }
327 |
328 | IBinder var4;
329 | if (var1 != null) {
330 | try {
331 | var4 = var1.asBinder();
332 | } catch (Throwable var34) {
333 | break label335;
334 | }
335 | } else {
336 | var4 = null;
337 | }
338 |
339 | try {
340 | var2.writeStrongBinder(var4);
341 | var4 = this.mRemote;
342 | } catch (Throwable var33) {
343 | break label335;
344 | }
345 |
346 | boolean var5 = false;
347 |
348 | label329:
349 | {
350 | try {
351 | if (var4.transact(1, var2, var3, 0) || Stub.getDefaultImpl() == null) {
352 | break label329;
353 | }
354 |
355 | var5 = Stub.getDefaultImpl().registerResultCallback(var1);
356 | } catch (Throwable var36) {
357 | break label335;
358 | }
359 |
360 | var3.recycle();
361 | var2.recycle();
362 | return var5;
363 | }
364 |
365 | int var6;
366 | try {
367 | var3.readException();
368 | var6 = var3.readInt();
369 | } catch (Throwable var32) {
370 | break label335;
371 | }
372 |
373 | if (var6 != 0) {
374 | var5 = true;
375 | }
376 |
377 | var3.recycle();
378 | var2.recycle();
379 | return var5;
380 | }
381 |
382 | var3.recycle();
383 | var2.recycle();
384 | return false;
385 | }
386 |
387 | public void retryRequest(long var1) throws RemoteException {
388 | Parcel var3 = Parcel.obtain();
389 | Parcel var4 = Parcel.obtain();
390 |
391 | try {
392 | var3.writeInterfaceToken(DESCRIPTOR);
393 | var3.writeLong(var1);
394 | if (this.mRemote.transact(8, var3, var4, 0) || Stub.getDefaultImpl() == null) {
395 | var4.readException();
396 | return;
397 | }
398 |
399 | Stub.getDefaultImpl().retryRequest(var1);
400 | } finally {
401 | var4.recycle();
402 | var3.recycle();
403 | }
404 |
405 | }
406 |
407 | public Bundle syncRequest(long var1, String var3, int var4, Bundle var5) {
408 | Parcel var6 = Parcel.obtain();
409 | Parcel var7 = Parcel.obtain();
410 |
411 | label330:
412 | {
413 | try {
414 | var6.writeInterfaceToken(DESCRIPTOR);
415 | var6.writeLong(var1);
416 | var6.writeString(var3);
417 | var6.writeInt(var4);
418 | } catch (Throwable var36) {
419 | break label330;
420 | }
421 |
422 | if (var5 != null) {
423 | try {
424 | var6.writeInt(1);
425 | var5.writeToParcel(var6, 0);
426 | } catch (Throwable var35) {
427 | break label330;
428 | }
429 | } else {
430 | try {
431 | var6.writeInt(0);
432 | } catch (Throwable var34) {
433 | break label330;
434 | }
435 | }
436 |
437 | Bundle var38;
438 | label324:
439 | {
440 | try {
441 | if (this.mRemote.transact(5, var6, var7, 0) || Stub.getDefaultImpl() == null) {
442 | break label324;
443 | }
444 |
445 | var38 = Stub.getDefaultImpl().syncRequest(var1, var3, var4, var5);
446 | } catch (Throwable var37) {
447 | break label330;
448 | }
449 |
450 | var7.recycle();
451 | var6.recycle();
452 | return var38;
453 | }
454 |
455 | label308:
456 | {
457 | try {
458 | var7.readException();
459 | if (var7.readInt() != 0) {
460 | var38 = (Bundle) Bundle.CREATOR.createFromParcel(var7);
461 | break label308;
462 | }
463 | } catch (Throwable var33) {
464 | break label330;
465 | }
466 |
467 | var38 = null;
468 | }
469 |
470 | var7.recycle();
471 | var6.recycle();
472 | return var38;
473 | }
474 |
475 | var7.recycle();
476 | var6.recycle();
477 | return null;
478 | }
479 |
480 | public boolean unregisterProgressCallback(IProgressCallback var1) {
481 | Parcel var2 = Parcel.obtain();
482 | Parcel var3 = Parcel.obtain();
483 |
484 | label335:
485 | {
486 | try {
487 | var2.writeInterfaceToken(DESCRIPTOR);
488 | } catch (Throwable var35) {
489 | break label335;
490 | }
491 |
492 | IBinder var4;
493 | if (var1 != null) {
494 | try {
495 | var4 = var1.asBinder();
496 | } catch (Throwable var34) {
497 | break label335;
498 | }
499 | } else {
500 | var4 = null;
501 | }
502 |
503 | try {
504 | var2.writeStrongBinder(var4);
505 | var4 = this.mRemote;
506 | } catch (Throwable var33) {
507 | break label335;
508 | }
509 |
510 | boolean var5 = false;
511 |
512 | label329:
513 | {
514 | try {
515 | if (var4.transact(4, var2, var3, 0) || Stub.getDefaultImpl() == null) {
516 | break label329;
517 | }
518 |
519 | var5 = Stub.getDefaultImpl().unregisterProgressCallback(var1);
520 | } catch (Throwable var36) {
521 | break label335;
522 | }
523 |
524 | var3.recycle();
525 | var2.recycle();
526 | return var5;
527 | }
528 |
529 | int var6;
530 | try {
531 | var3.readException();
532 | var6 = var3.readInt();
533 | } catch (Throwable var32) {
534 | break label335;
535 | }
536 |
537 | if (var6 != 0) {
538 | var5 = true;
539 | }
540 |
541 | var3.recycle();
542 | var2.recycle();
543 | return var5;
544 | }
545 |
546 | var3.recycle();
547 | var2.recycle();
548 | return false;
549 | }
550 |
551 | public boolean unregisterResultCallback(IResultCallback var1) {
552 | Parcel var2 = Parcel.obtain();
553 | Parcel var3 = Parcel.obtain();
554 |
555 | label335:
556 | {
557 | try {
558 | var2.writeInterfaceToken(DESCRIPTOR);
559 | } catch (Throwable var35) {
560 | break label335;
561 | }
562 |
563 | IBinder var4;
564 | if (var1 != null) {
565 | try {
566 | var4 = var1.asBinder();
567 | } catch (Throwable var34) {
568 | break label335;
569 | }
570 | } else {
571 | var4 = null;
572 | }
573 |
574 | try {
575 | var2.writeStrongBinder(var4);
576 | var4 = this.mRemote;
577 | } catch (Throwable var33) {
578 | break label335;
579 | }
580 |
581 | boolean var5 = false;
582 |
583 | label329:
584 | {
585 | try {
586 | if (var4.transact(2, var2, var3, 0) || Stub.getDefaultImpl() == null) {
587 | break label329;
588 | }
589 |
590 | var5 = Stub.getDefaultImpl().unregisterResultCallback(var1);
591 | } catch (Throwable var36) {
592 | break label335;
593 | }
594 |
595 | var3.recycle();
596 | var2.recycle();
597 | return var5;
598 | }
599 |
600 | int var6;
601 | try {
602 | var3.readException();
603 | var6 = var3.readInt();
604 | } catch (Throwable var32) {
605 | break label335;
606 | }
607 |
608 | if (var6 != 0) {
609 | var5 = true;
610 | }
611 |
612 | var3.recycle();
613 | var2.recycle();
614 | return var5;
615 | }
616 |
617 | var3.recycle();
618 | var2.recycle();
619 | return false;
620 | }
621 | }
622 | }
623 | }
624 |
--------------------------------------------------------------------------------
/app/src/main/java/com/samsung/android/app/networkstoragemanager/libsupport/IResultCallback.java:
--------------------------------------------------------------------------------
1 | package com.samsung.android.app.networkstoragemanager.libsupport;
2 |
3 | import android.os.Binder;
4 | import android.os.Bundle;
5 | import android.os.IBinder;
6 | import android.os.IInterface;
7 | import android.os.Parcel;
8 | import android.os.RemoteException;
9 |
10 | public interface IResultCallback extends IInterface {
11 | void onError(long var1, int var3, int var4, Bundle var5) throws RemoteException;
12 |
13 | void onSuccess(long var1, int var3, Bundle var4) throws RemoteException;
14 |
15 | abstract class Stub extends Binder implements IResultCallback {
16 | private static final String DESCRIPTOR = "com.samsung.android.app.networkstoragemanager.libsupport.IResultCallback";
17 |
18 | public Stub() {
19 | this.attachInterface(this, DESCRIPTOR);
20 | }
21 |
22 | public static IResultCallback asInterface(IBinder var0) {
23 | if (var0 == null) {
24 | return null;
25 | } else {
26 | IInterface var1 = var0.queryLocalInterface(DESCRIPTOR);
27 | return var1 != null && var1 instanceof IResultCallback ? (IResultCallback) var1 : new Proxy(var0);
28 | }
29 | }
30 |
31 | public static IResultCallback getDefaultImpl() {
32 | return Proxy.sDefaultImpl;
33 | }
34 |
35 | public IBinder asBinder() {
36 | return this;
37 | }
38 |
39 | public boolean onTransact(int var1, Parcel var2, Parcel var3, int var4) throws RemoteException {
40 | Object var5 = null;
41 | Object var6 = null;
42 | long var7;
43 | Bundle var9;
44 | if (var1 != 1) {
45 | if (var1 != 2) {
46 | if (var1 != 1598968902) {
47 | return super.onTransact(var1, var2, var3, var4);
48 | } else {
49 | var3.writeString(DESCRIPTOR);
50 | return true;
51 | }
52 | } else {
53 | var2.enforceInterface(DESCRIPTOR);
54 | var7 = var2.readLong();
55 | var4 = var2.readInt();
56 | var1 = var2.readInt();
57 | var9 = (Bundle) var6;
58 | if (var2.readInt() != 0) {
59 | var9 = Bundle.CREATOR.createFromParcel(var2);
60 | }
61 |
62 | this.onError(var7, var4, var1, var9);
63 | return true;
64 | }
65 | } else {
66 | var2.enforceInterface(DESCRIPTOR);
67 | var7 = var2.readLong();
68 | var1 = var2.readInt();
69 | var9 = (Bundle) var5;
70 | if (var2.readInt() != 0) {
71 | var9 = Bundle.CREATOR.createFromParcel(var2);
72 | }
73 |
74 | this.onSuccess(var7, var1, var9);
75 | return true;
76 | }
77 | }
78 |
79 | private static class Proxy implements IResultCallback {
80 | public static IResultCallback sDefaultImpl;
81 | private IBinder mRemote;
82 |
83 | Proxy(IBinder var1) {
84 | this.mRemote = var1;
85 | }
86 |
87 | public IBinder asBinder() {
88 | return this.mRemote;
89 | }
90 |
91 | public void onError(long var1, int var3, int var4, Bundle var5) {
92 | Parcel var6 = Parcel.obtain();
93 |
94 | label215:
95 | {
96 | try {
97 | var6.writeInterfaceToken(DESCRIPTOR);
98 | var6.writeLong(var1);
99 | var6.writeInt(var3);
100 | var6.writeInt(var4);
101 | } catch (Throwable var26) {
102 | break label215;
103 | }
104 |
105 | if (var5 != null) {
106 | try {
107 | var6.writeInt(1);
108 | var5.writeToParcel(var6, 0);
109 | } catch (Throwable var25) {
110 | break label215;
111 | }
112 | } else {
113 | try {
114 | var6.writeInt(0);
115 | } catch (Throwable var24) {
116 | break label215;
117 | }
118 | }
119 |
120 | label201:
121 | {
122 | try {
123 | if (!this.mRemote.transact(2, var6, (Parcel) null, 1) && Stub.getDefaultImpl() != null) {
124 | Stub.getDefaultImpl().onError(var1, var3, var4, var5);
125 | break label201;
126 | }
127 | } catch (Throwable var23) {
128 | break label215;
129 | }
130 |
131 | var6.recycle();
132 | return;
133 | }
134 |
135 | var6.recycle();
136 | return;
137 | }
138 |
139 | var6.recycle();
140 | }
141 |
142 | public void onSuccess(long var1, int var3, Bundle var4) {
143 | Parcel var5 = Parcel.obtain();
144 |
145 | label215:
146 | {
147 | try {
148 | var5.writeInterfaceToken(DESCRIPTOR);
149 | var5.writeLong(var1);
150 | var5.writeInt(var3);
151 | } catch (Throwable var25) {
152 | break label215;
153 | }
154 |
155 | if (var4 != null) {
156 | try {
157 | var5.writeInt(1);
158 | var4.writeToParcel(var5, 0);
159 | } catch (Throwable var24) {
160 | break label215;
161 | }
162 | } else {
163 | try {
164 | var5.writeInt(0);
165 | } catch (Throwable var23) {
166 | break label215;
167 | }
168 | }
169 |
170 | label201:
171 | {
172 | try {
173 | if (!this.mRemote.transact(1, var5, (Parcel) null, 1) && Stub.getDefaultImpl() != null) {
174 | Stub.getDefaultImpl().onSuccess(var1, var3, var4);
175 | break label201;
176 | }
177 | } catch (Throwable var22) {
178 | break label215;
179 | }
180 |
181 | var5.recycle();
182 | return;
183 | }
184 |
185 | var5.recycle();
186 | return;
187 | }
188 |
189 | var5.recycle();
190 | }
191 | }
192 | }
193 | }
194 |
--------------------------------------------------------------------------------
/app/src/main/java/com/samsung/android/app/networkstoragemanager/libsupport/RequestCode.java:
--------------------------------------------------------------------------------
1 | package com.samsung.android.app.networkstoragemanager.libsupport;
2 |
3 | public interface RequestCode {
4 | int ADD_SERVER = 2;
5 | int CHECK_PERMISSION = 14;
6 | int CONNECT = 0;
7 | int CREATE_FOLDER = 121;
8 | int DELETE = 125;
9 | int DELETE_SERVER = 6;
10 | int EXIST = 130;
11 | int EXTERNAL_COPY = 128;
12 | int EXTERNAL_MOVE = 129;
13 | int FIND_SERVER = 7;
14 | int GET_FILE_DESCRIPTOR = 124;
15 | int GET_FILE_LIST = 9;
16 | int GET_FILE_OBJECT = 10;
17 | int GET_RESOURCE = 12;
18 | int GET_SERVER_COUNT = 15;
19 | int GET_SERVER_LIST = 1;
20 | int GET_SHARED_FOLDER = 8;
21 | int GET_STRING_MAP = 11;
22 | int INTERNAL_COPY = 126;
23 | int INTERNAL_MOVE = 127;
24 | int REMOVE_CACHED_FILE_LIST = 17;
25 | int REMOVE_MONITOR = 16;
26 | int RENAME = 122;
27 | int UPDATE_SERVER = 4;
28 | int UPLOAD = 123;
29 | int VERIFY_SERVER_INFO = 13;
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yanndroid/Samsung-My-Files-Root-Extension/28137dc27908fa90937c3c89e4dc261fc6a7b6ec/app/src/main/res/drawable/ic_launcher_background.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yanndroid/Samsung-My-Files-Root-Extension/28137dc27908fa90937c3c89e4dc261fc6a7b6ec/app/src/main/res/drawable/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/values-in/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Active
4 | Tambah kunci pribadi
5 | Tambah server FTP
6 | Lokasi penyimpanan root baru
7 | Tambah lokasi penyimpanan root
8 | Ketuk tombol di atas untuk menambahkan lokasi penyimpanan root baru.
9 | Tambah server SFTP
10 | [deskripsi]/[jalur]
11 | Ekstensi Root File Saya
12 | Tambahkan
13 | Simpan
14 | Salin
15 | Hapus %d lokasi penyimpanan?
16 | Hapus %d lokasi penyimpanan?
17 | Nama tampilan
18 | Anda tidak memiliki izin untuk menyalin file yang dipilih. Hubungi admin sistem untuk izin
19 | Anda tidak memiliki izin untuk menyalin file yang dipilih ke penyimpanan jaringan. Hubungi admin sistem untuk izin.
20 | Anda tidak memiliki izin untuk menyalin file yang dipilih. Hubungi admin sistem untuk izin
21 | Anda tidak memiliki izin untuk menyalin file yang dipilih ke penyimpanan jaringan. Hubungi admin sistem untuk izin.
22 | Anda tidak memiliki izin untuk menyalin folder yang dipilih. Hubungi admin sistem untuk izin
23 | Anda tidak memiliki izin untuk menyalin folder yang dipilih ke penyimpanan jaringan. Hubungi admin sistem untuk izin.
24 | Anda tidak memiliki izin untuk menyalin folder yang dipilih. Hubungi admin sistem untuk izin
25 | Anda tidak memiliki izin untuk menyalin folder yang dipilih ke penyimpanan jaringan. Hubungi admin sistem untuk izin.
26 | Anda tidak memiliki izin untuk menyalin item yang dipilih. Hubungi admin sistem untuk izin
27 | Anda tidak memiliki izin untuk menyalin item yang dipilih ke penyimpanan jaringan. Hubungi admin sistem untuk izin.
28 | Anda tidak memiliki izin untuk membuat folder di sini. Hubungi admin sistem untuk meminta izin.
29 | Anda tidak memiliki izin untuk menghapus file yang dipilih. Hubungi admin sistem untuk meminta izin
30 | Anda tidak memiliki izin untuk menghapus file yang dipilih. Hubungi admin sistem untuk meminta izin
31 | Anda tidak memiliki izin untuk menghapus folder yang dipilih. Hubungi admin sistem untuk meminta izin
32 | Anda tidak memiliki izin untuk menghapus folder yang dipilih. Hubungi admin sistem untuk izin
33 | Anda tidak memiliki izin untuk menghapus item yang dipilih. Hubungi admin sistem untuk izin
34 | Anda tidak memiliki izin untuk memindahkan file yang dipilih. Hubungi admin sistem untuk izin
35 | Anda tidak memiliki izin untuk memindahkan file yang dipilih ke penyimpanan jaringan. Hubungi admin sistem untuk izin.
36 | Anda tidak memiliki izin untuk memindahkan file yang dipilih. Hubungi admin sistem untuk izin
37 | Anda tidak memiliki izin untuk memindahkan file yang dipilih ke penyimpanan jaringan. Hubungi admin sistem untuk izin.
38 | Anda tidak memiliki izin untuk memindahkan folder yang dipilih. Hubungi admin sistem untuk izin
39 | Anda tidak memiliki izin untuk memindahkan folder yang dipilih ke penyimpanan jaringan. Hubungi admin sistem untuk izin.
40 | Anda tidak memiliki izin untuk memindahkan folder yang dipilih. Hubungi admin sistem untuk izin
41 | Anda tidak memiliki izin untuk memindahkan folder yang dipilih ke penyimpanan jaringan. Hubungi admin sistem untuk meminta izin.
42 | Anda tidak memiliki izin untuk memindahkan item yang dipilih. Hubungi admin sistem untuk izin
43 | Anda tidak memiliki izin untuk memindahkan item yang dipilih ke penyimpanan jaringan. Hubungi admin sistem untuk izin.
44 | Anda tidak memiliki izin untuk menghapus file yang dipilih dari penyimpanan jaringan. Hubungi admin sistem untuk meminta izin.
45 | Anda tidak memiliki izin untuk menghapus file yang dipilih dari penyimpanan jaringan. Hubungi admin sistem untuk meminta izin.
46 | Anda tidak memiliki izin untuk menghapus folder yang dipilih dari penyimpanan jaringan. Hubungi admin sistem untuk meminta izin.
47 | Anda tidak memiliki izin untuk menghapus folder yang dipilih dari penyimpanan jaringan. Hubungi admin sistem untuk meminta izin.
48 | Anda tidak memiliki izin untuk menghapus item yang dipilih dari penyimpanan jaringan. Hubungi admin sistem untuk izin.
49 | Anda tidak memiliki izin untuk mengganti nama file yang dipilih. Hubungi admin sistem untuk meminta izin
50 | Anda tidak memiliki izin untuk mengganti nama folder yang dipilih. Hubungi admin sistem untuk izin
51 | Item jatuh ke posisi %d.
52 | Mulai menyeret item pada posisi %d.
53 | Item pada posisi %d tidak dapat diseret.
54 | Pengkodean
55 | Enkripsi
56 | Canggih
57 | Eksplisit
58 | com.google.android.material.transformation.FabTransformationScrimBehavior
59 | com.google.android.material.transformation.FabTransformationSheetBehavior
60 | -
61 | Tambah lokasi penyimpanan root
62 | com.google.android.material.behavior.HideBottomViewOnScrollBehavior
63 | Sembunyikan kata sandi
64 | Implisit
65 | Tidak dapat terhubung. Pastikan alamat dan info lainnya sudah benar, lalu coba lagi.
66 | Tidak dapat terhubung. Pastikan port sudah benar, lalu coba lagi.
67 | Tidak dapat terhubung. Pastikan info server sudah benar, lalu coba lagi.
68 | Username atau kata sandi salah.
69 | Mencari drive di jaringan saat ini...
70 | Kelola lokasi penyimpanan
71 | Tambah lokasi penyimpanan root
72 | Rincian
73 | Penyimpanan Jaringan
74 | Tidak dapat terhubung. Server tidak merespons.
75 | Tidak ada drive SMB yang ditemukan di jaringan
76 | Tidak ada
77 | Tidak diatur
78 | Pasif
79 | Frasa sandi
80 | Biarkan Kosong
81 | Kata sandi
82 | Apapun
83 | \"%1$s\" disalin ke papan klip.
84 | Kunci pribadi
85 | Ganti nama lokasi penyimpanan
86 | Cari
87 | Keamanan
88 | -
89 | Tampilkan kata sandi
90 | Aktifkan ini
91 | Metode masuk
92 | Baru
93 | Lokasi penyimpanan root
94 | SSL/TLS
95 | 999+
96 | %s rincian
97 | %1$s, %2$s
98 | Mode transfer
99 | Kesalahan yang tidak diketahui
100 | Biarkan Kosong
101 |
102 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | My Files Root Extension
3 |
4 | Add root storage location
5 | Add root storage location
6 | Add root storage location
7 |
8 | -
9 | -
10 | Root storage location
11 | New
12 | Tap the button above to add a new root storage locations.
13 |
14 | New root storage location
15 | [description]/[path]
16 | Anything
17 | Leave Empty
18 | Leave Empty
19 | Enable this
20 | Display name
21 |
22 |
23 | Network Storage
24 | Active
25 | Add a private key
26 | Add FTP server
27 | Add SFTP server
28 | Add
29 | Save
30 | Copy
31 | Delete %d storage location?
32 | Delete %d storage locations?
33 | Item dropped into position %d.
34 | Started dragging item at position %d.
35 | Item at position %d cannot be dragged.
36 | Encoding
37 | Encryption
38 | Advanced
39 | Explicit
40 | com.google.android.material.transformation.FabTransformationScrimBehavior
41 | com.google.android.material.transformation.FabTransformationSheetBehavior
42 | com.google.android.material.behavior.HideBottomViewOnScrollBehavior
43 | Hide password
44 | Implicit
45 | "Can't connect. Make sure the address and other info is correct, then try again."
46 | "Can't connect. Make sure the port is correct, then try again."
47 | "Can't connect. Make sure the server info is correct, then try again."
48 | Incorrect username or password.
49 | Looking for drives on current network...
50 | Manage storage locations
51 | Details
52 | "Can't connect. The server didn't respond."
53 | No SMB drives found on network
54 | None
55 | Not set
56 | Passive
57 | Passphrases
58 | Password
59 | \"%1$s\" copied to clipboard.
60 | Private key
61 | Rename storage location
62 | Search
63 | Security
64 | Show password
65 | Sign-in method
66 | SSL/TLS
67 | 999+
68 | %s details
69 | %1$s, %2$s
70 | Transfer mode
71 | Unknown error
72 |
73 |
74 | "You don't have permission to copy the selected file. Contact the system admin for permission"
75 | "You don't have permission to copy the selected file to network storage. Contact the system admin for permission."
76 | "You don't have permission to copy the selected files. Contact the system admin for permission"
77 | "You don't have permission to copy the selected files to network storage. Contact the system admin for permission."
78 | "You don't have permission to copy the selected folder. Contact the system admin for permission"
79 | "You don't have permission to copy the selected folder to network storage. Contact the system admin for permission."
80 | "You don't have permission to copy the selected folders. Contact the system admin for permission"
81 | "You don't have permission to copy the selected folders to network storage. Contact the system admin for permission."
82 | "You don't have permission to copy the selected items. Contact the system admin for permission"
83 | "You don't have permission to copy the selected items to network storage. Contact the system admin for permission."
84 | "You don't have permission to create a folder here. Contact the system admin for permission."
85 | "You don't have permission to delete the selected file. Contact the system admin for permission"
86 | "You don't have permission to delete the selected files. Contact the system admin for permission"
87 | "You don't have permission to delete the selected folder. Contact the system admin for permission"
88 | "You don't have permission to delete the selected folders. Contact the system admin for permission"
89 | "You don't have permission to delete the selected items. Contact the system admin for permission"
90 | "You don't have permission to move the selected file. Contact the system admin for permission"
91 | "You don't have permission to move the selected file to network storage. Contact the system admin for permission."
92 | "You don't have permission to move the selected files. Contact the system admin for permission"
93 | "You don't have permission to move the selected files to network storage. Contact the system admin for permission."
94 | "You don't have permission to move the selected folder. Contact the system admin for permission"
95 | "You don't have permission to move the selected folder to network storage. Contact the system admin for permission."
96 | "You don't have permission to move the selected folders. Contact the system admin for permission"
97 | "You don't have permission to move the selected folders to network storage. Contact the system admin for permission."
98 | "You don't have permission to move the selected items. Contact the system admin for permission"
99 | "You don't have permission to move the selected items to network storage. Contact the system admin for permission."
100 | "You don't have permission to remove the selected file from network storage. Contact the system admin for permission."
101 | "You don't have permission to remove the selected files from network storage. Contact the system admin for permission."
102 | "You don't have permission to remove the selected folder from network storage. Contact the system admin for permission."
103 | "You don't have permission to remove the selected folders from network storage. Contact the system admin for permission."
104 | "You don't have permission to remove the selected items from network storage. Contact the system admin for permission."
105 | "You don't have permission to rename the selected file. Contact the system admin for permission"
106 | "You don't have permission to rename the selected folder. Contact the system admin for permission"
107 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | plugins {
3 | id 'com.android.application' version '7.1.2' apply false
4 | id 'com.android.library' version '7.1.2' apply false
5 | }
6 |
7 | task clean(type: Delete) {
8 | delete rootProject.buildDir
9 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Enables namespacing of each library's R class so that its R class includes only the
19 | # resources declared in the library itself and none from the library's dependencies,
20 | # thereby reducing the size of the R class for that library
21 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yanndroid/Samsung-My-Files-Root-Extension/28137dc27908fa90937c3c89e4dc261fc6a7b6ec/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun May 08 14:53:41 CEST 2022
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/readme-res/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yanndroid/Samsung-My-Files-Root-Extension/28137dc27908fa90937c3c89e4dc261fc6a7b6ec/readme-res/icon.png
--------------------------------------------------------------------------------
/readme-res/screenshot_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yanndroid/Samsung-My-Files-Root-Extension/28137dc27908fa90937c3c89e4dc261fc6a7b6ec/readme-res/screenshot_1.png
--------------------------------------------------------------------------------
/readme-res/screenshot_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yanndroid/Samsung-My-Files-Root-Extension/28137dc27908fa90937c3c89e4dc261fc6a7b6ec/readme-res/screenshot_2.png
--------------------------------------------------------------------------------
/readme-res/screenshot_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Yanndroid/Samsung-My-Files-Root-Extension/28137dc27908fa90937c3c89e4dc261fc6a7b6ec/readme-res/screenshot_3.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | gradlePluginPortal()
4 | google()
5 | mavenCentral()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 | maven { url 'https://jitpack.io' }
14 | }
15 | }
16 | rootProject.name = "My Files Root Extension"
17 | include ':app'
18 |
--------------------------------------------------------------------------------