Open unforgettableid opened 9 years ago
Thanks for your consideration
A) I haven't tested it extensively, but yes it works B) There is still some work to do(though nothing complicated), to pack the Superuser in a flashable update.zip C) Thanks for the advises. I'll see when the time comes
@phhusson If I have a documentation for that, I can make sure the project is regularly built into flashable update.zip available on the web. so let me know if I can help.
Hey, if it really works, is it the right time for the F-Droid build? We lack FOSS Superuser that works on Andoid 5+.
@jeekajoo That would be great. Are you currently able to build placeholder and su? Or would you have rather me have build those ?
git clone https://github.com/phhusson/Superuser.git
cd Superuser
git clone https://github.com/koush/Widgets.git
docker run --rm -t -i -v $PWD:/data jeekajoo/android /bin/bash
docker> cd /data/Superuser
docker> gradle
(...)
FAILURE: Build failed with an exception.
* Where:
Build file '/data/Widgets/Widgets/build.gradle' line: 48
* What went wrong:
A problem occurred evaluating project ':Widgets'.
> Cannot get property 'user' on extra properties extension as it does not exist
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 22.051 secs
@phhusson : I guess I'm not far.
Maybe it would be nice to fork Widgets aswell.
to avoid the weird stuff we have in Widgets/Widgets/build.gradle
line: 48
Sorry, you need to use my own Widgets, https://github.com/phhusson/Widgets/
Thanks, I have Lint errors:
git clone https://github.com/phhusson/Superuser.git
cd Superuser
git clone https://github.com/phhusson/Widgets.git
docker run --rm -t -i -v $PWD:/data jeekajoo/android /bin/bash
docker> cd /data/Superuser
docker> gradle
...
BUILD SUCCESSFUL
...
docker> gradle build
...
14:53:46.011 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :compileLint (Thread[main,5,main]) started.
14:53:46.011 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :compileLint
14:53:46.012 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':compileLint'
14:53:46.012 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':compileLint' is up-to-date
14:53:46.012 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ':compileLint' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
14:53:46.012 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':compileLint'.
14:53:46.012 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':compileLint'
14:53:46.013 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :compileLint (Thread[main,5,main]) completed. Took 0.002 secs.
14:53:46.013 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :lint (Thread[main,5,main]) started.
14:53:46.013 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :lint
14:53:46.013 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':lint'
14:53:46.013 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':lint' is up-to-date
14:53:46.014 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ':lint' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
14:53:46.014 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':lint'.
14:53:48.883 [QUIET] [system.out] Ran lint on variant debug: 117 issues found
14:53:48.884 [QUIET] [system.out] Ran lint on variant release: 117 issues found
14:53:48.919 [QUIET] [system.out] Wrote HTML report to file:/data/Superuser/build/outputs/lint-results.html
14:53:48.925 [QUIET] [system.out] Wrote XML report to /data/Superuser/build/outputs/lint-results.xml
14:53:48.929 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':lint'
14:53:48.929 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :lint FAILED
14:53:48.929 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :lint (Thread[main,5,main]) completed. Took 2.916 secs.
14:53:48.930 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 3.366 secs, idle: 0.028 secs
14:53:48.936 [ERROR] [org.gradle.BuildExceptionReporter]
14:53:48.937 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
14:53:48.937 [ERROR] [org.gradle.BuildExceptionReporter]
14:53:48.937 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
14:53:48.937 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':lint'.
14:53:48.937 [ERROR] [org.gradle.BuildExceptionReporter] > Lint found errors in the project; aborting build.
14:53:48.937 [ERROR] [org.gradle.BuildExceptionReporter]
14:53:48.938 [ERROR] [org.gradle.BuildExceptionReporter] Fix the issues identified by lint, or add the following to your build script to proceed with errors:
14:53:48.938 [ERROR] [org.gradle.BuildExceptionReporter] ...
14:53:48.938 [ERROR] [org.gradle.BuildExceptionReporter] android {
14:53:48.938 [ERROR] [org.gradle.BuildExceptionReporter] lintOptions {
14:53:48.938 [ERROR] [org.gradle.BuildExceptionReporter] abortOnError false
14:53:48.938 [ERROR] [org.gradle.BuildExceptionReporter] }
14:53:48.938 [ERROR] [org.gradle.BuildExceptionReporter] }
14:53:48.938 [ERROR] [org.gradle.BuildExceptionReporter] ...
14:53:48.938 [ERROR] [org.gradle.BuildExceptionReporter]
14:53:48.938 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
14:53:48.938 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
14:53:48.939 [LIFECYCLE] [org.gradle.BuildResultLogger]
14:53:48.939 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
14:53:48.940 [LIFECYCLE] [org.gradle.BuildResultLogger]
14:53:48.940 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 8.355 secs
14:53:48.944 [DEBUG] [org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonManager] Stopping 0 compiler daemon(s).
14:53:48.945 [INFO] [org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonManager] Stopped 0 compiler daemon(s).
14:53:48.945 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache Plugin Resolution Cache (/root/.gradle/caches/2.5/plugin-resolution) was closed 0 times.
14:53:48.946 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache artifact-at-repository.bin (/root/.gradle/caches/modules-2/metadata-2.15/artifact-at-repository.bin)
14:53:48.946 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-metadata.bin (/root/.gradle/caches/modules-2/metadata-2.15/module-metadata.bin)
14:53:48.947 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on artifact cache (/root/.gradle/caches/modules-2).
14:53:48.947 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on buildscript class cache for settings file '/data/Superuser/settings.gradle' (/root/.gradle/caches/2.5/scripts/settings_1wo518zn57bbb1l4d1wgod52p/SettingsScript/buildscript).
14:53:48.947 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on no_buildscript class cache for settings file '/data/Superuser/settings.gradle' (/root/.gradle/caches/2.5/scripts/settings_1wo518zn57bbb1l4d1wgod52p/SettingsScript/no_buildscript).
14:53:48.948 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on buildscript class cache for build file '/data/Superuser/build.gradle' (/root/.gradle/caches/2.5/scripts/build_2wgjxfdobour9sqw5566w1s3q/ProjectScript/buildscript).
14:53:48.948 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on no_buildscript class cache for build file '/data/Superuser/build.gradle' (/root/.gradle/caches/2.5/scripts/build_2wgjxfdobour9sqw5566w1s3q/ProjectScript/no_buildscript).
14:53:48.948 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on buildscript class cache for build file '/data/Widgets/Widgets/build.gradle' (/root/.gradle/caches/2.5/scripts/build_315273e3bl97sck6fvgdj08fl/ProjectScript/buildscript).
14:53:48.948 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on no_buildscript class cache for build file '/data/Widgets/Widgets/build.gradle' (/root/.gradle/caches/2.5/scripts/build_315273e3bl97sck6fvgdj08fl/ProjectScript/no_buildscript).
14:53:48.949 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache outputFileStates.bin (/data/Superuser/.gradle/2.5/taskArtifacts/outputFileStates.bin)
14:53:48.949 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache fileSnapshots.bin (/data/Superuser/.gradle/2.5/taskArtifacts/fileSnapshots.bin)
14:53:48.949 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache taskArtifacts.bin (/data/Superuser/.gradle/2.5/taskArtifacts/taskArtifacts.bin)
14:53:48.949 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache fileHashes.bin (/data/Superuser/.gradle/2.5/taskArtifacts/fileHashes.bin)
14:53:48.949 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on task history cache (/data/Superuser/.gradle/2.5/taskArtifacts).
14:53:48.950 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 14 (avg: 0.0 secs, total: 0.012 secs)
14:53:48.950 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolved configuration cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs)
14:53:48.950 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.ResolutionResultsStoreFactory] Deleted 2 resolution results binary files in 0.001 secs
14:53:48.950 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedRepositoryFactory] In-memory dependency metadata cache closed. Repos cached: 6, cache instances: 2, modules served from cache: 0, artifacts: 0
The appropriate command is assembleRelease or assembleDebug Though thanks for making see lint errors
right.. thanks :D
...
BUILD SUCCESSFUL
Total time: 17.36 secs
This build could be faster, please consider using the Gradle Daemon: http://gradle.org/docs/2.5/userguide/gradle_daemon.html
root@e708718a94c7:/data/Superuser# find . -name "*apk"
./build/outputs/apk
./build/outputs/apk/Superuser-debug-unaligned.apk
./build/outputs/apk/Superuser-release-unsigned.apk
./build/outputs/apk/Superuser-debug.apk
You still need to build placeholder and su, by doing an AOSP-like build in Superuser/ (running mma in this folder after a lunch should do the trick)
I'm trying with last NDK version (android-ndk-r10e-linux-x86_64.bin). Is it supposed to be working with it ?
git clone https://github.com/phhusson/Superuser.git
cd Superuser
git clone https://github.com/phhusson/Widgets.git
docker pull jeekajoo/android
docker run --rm -t -i -v $PWD:/data jeekajoo/android /bin/bash
docker> echo $NDK_PROJECT_PATH
/data
docker> cd /data/
docker> ls
Android.mk LICENSE README.md Superuser Widgets build.gradle executables gradle gradlew gradlew.bat init.superuser.rc local_manifest.xml settings.gradle
docker> ndk-build
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /data/jni/Android.mk
/opt/android-ndk-r10e/build/core/add-application.mk:199: *** Android NDK: Aborting... . Stop.
Looks likes it is expecting to have something in jni
dir that doesn't exist.
$NDK_PROJECT_PATH
is supposed to be the directory where we have Android.mk. Right? (I'm a n00b regarding all of this android stuff building.).
My docker file: https://github.com/jeekajoo/docker-android/blob/master/Dockerfile uptodate Image available on Dockerhub registry: https://hub.docker.com/r/jeekajoo/android/
Thanks
@phhusson
The Android.mk file resides in a subdirectory of your project's jni/ directory, and describes your sources and shared libraries to the build system. It is really a tiny GNU makefile fragment that the build system parses once or more. The Android.mk file is useful for defining project-wide settings that Application.mk, the build system, and your environment variables leave undefined. It can also override project-wide settings for specific modules.
https://developer.android.com/ndk/guides/android_mk.html
The Application.mk file is really a tiny GNU Makefile fragment that defines several variables for compilation. It usually resides under $PROJECT/jni/, where $PROJECT points to your application's project directory. Another alternative is to place it under a sub-directory of the top-level $NDK/apps/ directory. For example:
$NDK/apps/<myapp>/Application.mk
https://developer.android.com/ndk/guides/application_mk.html
This can't be built with ndk It can only be built in an android source tree itself.
@phhusson Thank you very much for continuing the work on superuser! Does your fork also work with SElinux in enforcing mode?
That's actually the goal of my fork, and yes it works.
This was NDK compatible, but may not be with newer versions of hte NDK. Probably needs build script fixes.
Yes sorry, we were speaking about my fork of your Superuser :)
Dear @jeekajoo:
Like phhusson wrote, you need to build Superuser in an Android source tree.
If you want to check out the Android "master" branch including all history, https://source.android.com/source/downloading.html offers instructions:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
mkdir WORKING_DIRECTORY
cd WORKING_DIRECTORY
repo init -u https://android.googlesource.com/platform/manifest
repo sync
If you plan to ever send in Android patches to Google, then you should tell repo init
your real name and email address when it asks.
The first time you run repo sync
, it may take half a day or more, and I assume it will cause dozens of gigabytes to be downloaded.
If you want to save time, you can do a Git "shallow clone". See here for instructions.
Erm sorry I actually fixed it to be buildable with NDK/SDK again :)
@unforgettableid yes thanks. I was able to build it thanks to @phhusson 's fixes/help 6 days ago https://github.com/jeekajoo/docker-android/commit/f81e5aff18f74ddd21ea8a5c3d7a39747ef06f66 Now I need to find time to make a flashable zip from it and test it..
When I use new Android SDK and Eclipse to build the project, it has a trouble and can not generate the R file. It hints error: Error retrieving parent for item: No resource found that matches the given name '@style/AppDarkTheme'. I have try a log time to fix it, but it doesn't work. If anyone can run the project in his new Android SDK(like api19 or newer).Please send your project to me. My email is 1243090271@qq.com. thanks!!
Perhaps stop talking about my fork in this bug tracker, rather use mine, and open specific issues.
@phhusson problem is that we can't report issue in your fork :) I can't see issue tab
Oh thanks. Fixed.
To get to the phhusson/Superuser issue tracker, simply follow this link.
Dear @phhusson:
In reply to this comment of yours:
Thank you for working on your fork of Superuser!
A) Does your fork work fine on Android 5.0 "Lollipop"?
B) Is it ready for use by the general public?
C) If so, I wonder if you could please do the following?:
If you try contacting Koush three or four times, and wait one or two weeks in between each try, then that means Koush is uncontactable. If this is so, it would be good if you could please change the name of your fork to something new — to a name which is less common and easier to Google for. A name different than ChainsDD picked ("Superuser") and a name different than Koush picked ("Superuser"). May I suggest the name "AndAuthenticate", which is a name reminiscent of the Mac OS X "Authenticate" privilege authorization feature.